You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Engineering__Norm__List_...

2 lines
15 KiB

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[6741],{74725:function(te,A,r){r.r(A),r.d(A,{default:function(){return ke}});var e=r(59301),L=r(52306),y=r(63144),c=r(58334),F={flex_box_center:"flex_box_center___X9V7U",flex_space_between:"flex_space_between___yrftj",flex_box_vertical_center:"flex_box_vertical_center___L4TZS",flex_box_center_end:"flex_box_center_end___cg_Zt",flex_box_column:"flex_box_column___wze1F",normContainer:"normContainer___W8XuE",header:"header___b9n4K",select:"select___HP7t1",button:"button___mqRKo",tips:"tips___r2hsJ"},S=r(57809),h=r(3113),B={normTablistContainer:"normTablistContainer___yLRBP",red:"red___hyG5_",green:"green___YdwJo"},N=r(6848),ue=r(81327),W=r(71796),j=r(14491),ne=Object.defineProperty,V=Object.getOwnPropertySymbols,ae=Object.prototype.hasOwnProperty,le=Object.prototype.propertyIsEnumerable,Y=(n,u,t)=>u in n?ne(n,u,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[u]=t,re=(n,u)=>{for(var t in u||(u={}))ae.call(u,t)&&Y(n,t,u[t]);if(V)for(var t of V(u))le.call(u,t)&&Y(n,t,u[t]);return n};const oe=({headerData:n,tabListData:u,loading:t,expandedRowKeys:p,dispatch:_})=>{const o=[{title:"\u6BD5\u4E1A\u8981\u6C42\u53CA\u6307\u6807\u70B9",key:"content",ellipsis:{showTitle:!1},width:"50%",render:l=>e.createElement(N.Z,{placement:"topLeft",title:l.content},l.children?e.createElement("span",null,l.position,".",l.content):e.createElement("span",null,l.content))},{title:"\u8FBE\u6210\u9608\u503C",dataIndex:"goal_value",align:"center"},{title:"\u8FBE\u6210\u5EA6\u5B9E\u9645\u503C",dataIndex:"actual_value",align:"center"},{title:"\u8BC4\u4EF7\u7ED3\u679C",dataIndex:"status",align:"center",render:l=>e.createElement("div",{className:l?B.green:B.red},l?"":"\u672A","\u8FBE\u6210")},{title:"\u72B6\u6001",dataIndex:"compute_status",render:l=>e.createElement("div",null,l||"--")},{title:"\u8BA1\u7B97\u65F6\u95F4",dataIndex:"compute_time",render:l=>e.createElement("div",null,l||"--")},{title:"\u64CD\u4F5C",width:80,render:l=>l.children?e.createElement(ue.Z,null,e.createElement(W.default.Link,{onClick:()=>v(l.id)},e.createElement("i",{className:"iconfont icon-jisuan",style:{color:"#0152D9"}})),e.createElement(W.default.Link,{onClick:()=>{y.history.push(`/engineering/evaluate/norm/${n.active[c.k[1]]}/${l.id}`)}},e.createElement("i",{className:"iconfont icon-chakansvg",style:{color:"#0152D9"}}))):e.createElement(e.Fragment,null)}],v=l=>{_({type:"engineeringNormList/compute",payload:{all:!1,ec_year_id:n.active[c.k[1]],id:l}})};return e.createElement("div",{className:B.normTablistContainer},e.createElement(j.default,{loading:t.effects["engineeringNormList/getGraduationResults"]||t.effects["engineeringNormList/compute"],rowKey:"id",columns:o,bordered:!1,dataSource:u,expandable:{expandedRowKeys:p,expandIcon:()=>e.createElement(e.Fragment,null)},pagination:!1}))};var ie=(0,y.connect)(({engineeringNormList:n,loading:u})=>re({loading:u},n))(oe),g={flex_box_center:"flex_box_center___XsJky",flex_space_between:"flex_space_between___YT9jW",flex_box_vertical_center:"flex_box_vertical_center___m1XRe",flex_box_center_end:"flex_box_center_end___tpcG6",flex_box_column:"flex_box_column___dcmMW",normCalcModalWrap:"normCalcModalWrap___Vh4Nx",tableCotainer:"tableCotainer___mgwQ9",name:"name___did8y",content:"content___NUsYT",subtitle:"subtitle___zYm_7",tag:"tag___Ym3uV"},K=r(99313),T=r(5112),D=r(8591),R=r(43418),ce=Object.defineProperty,se=Object.defineProperties,me=Object.getOwnPropertyDescriptors,G=Object.getOwnPropertySymbols,de=Object.prototype.hasOwnProperty,Ee=Object.prototype.propertyIsEnumerable,z=(n,u,t)=>u in n?ce(n,u,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[u]=t,P=(n,u)=>{for(var t in u||(u={}))de.call(u,t)&&z(n,t,u[t]);if(G)for(var t of G(u))Ee.call(u,t)&&z(n,t,u[t]);return n},Z=(n,u)=>se(n,me(u));const{TabPane:pe}=K.default,J={formula_one:"\u6307\u6807\u70B9\u8FBE\u6210\u5B9E\u9645\u503C",formula_two:"\u6307\u6807\u70B9\u8BC4\u4EF7\u7ED3\u679C",formula_three:"\u6BD5\u4E1A\u8981\u6C42\u8FBE\u6210\u5B9E\u9645\u503C"},ve=({actionTabs:n,loading:u,dispatch:t})=>{const[p,_]=(0,e.useState)({}),[o,v]=(0,e.useState)({formula_one:[],formula_two:[],formula_three:[]});(0,e.useEffect)(()=>{t({type:"engineeringNormList/getFormulas",callback:i=>{if(i){v(i);let s={};for(let C in i){const a=i[C].find(m=>m.checked);s[C]=a?a.id:void 0}_(s)}}})},[]);const l=i=>[{title:`${J[i]}\u8BA1\u7B97\u516C\u5F0F`,key:"content",render:s=>e.createElement("div",{className:g.name},e.createElement("div",null,s.checked&&e.createElement("span",{className:g.tag},"\u9ED8\u8BA4")),e.createElement("div",{className:g.content},e.createElement("div",null,s.content),s.explain&&e.createElement("div",{className:g.subtitle},"\u8BF4\u660E\uFF1A",s.explain)))},{title:"\u64CD\u4F5C",width:120,render:s=>e.createElement("div",null,e.createElement(T.ZP,{checked:p[i]===s.id,onClick:()=>d(i,s.id)},"\u8BBE\u7F6E\u9ED8\u8BA4\u516C\u5F0F"))}],d=(i,s)=>{const C=o[i].map(a=>Z(P({},a),{checked:s===a.id}));_(Z(P({},p),{[i]:s})),v(Z(P({},o),{[i]:C}))},E=()=>{t({type:"engineeringNormList/save",payload:{actionTabs:{key:"",params:{}}}})},b=()=>{t({type:"engineeringNormList/setFormulas",payload:P({ec_year_id:n.params.id},p),callback:i=>{i&&i.status===0?(D.ZP.success("\u66F4\u65B0\u6210\u529F"),t({type:"engineeringNormList/getGraduationResults"}),E()):D.ZP.error("\u66F4\u65B0\u5931\u8D25")}})};return e.createElement("div",{className:g.normCalcModalContainer},e.createElement(R.default,{title:"\u8BBE\u7F6E\u8BA1\u7B97\u516C\u5F0F",open:!0,width:918,wrapClassName:g.normCalcModalWrap,onCancel:E,onOk:b,confirmLoading:u.effects["engineeringNormList/getFormulas"]||u.effects["engineeringNormList/setFormulas"]||!1},e.createElement("div",{className:g.normCalcContent},e.createElement(K.default,{defaultActiveKey:"1"},Object.entries(J).map(([i,s],C)=>e.createElement(pe,{tab:s,key:(C+1).toString()},e.createElement("div",{className:g.tableCotainer},e.createElement(j.default,{rowKey:"id",columns:l(i),dataSource:o[i],pagination:!1}))))))))};var fe=(0,y.connect)(({loading:n,engineeringNormList:u})=>P({loading:n},u))(ve),M={normThresholdsModalWrap:"normThresholdsModalWrap___VJWzM",normThresholdsContent:"normThresholdsContent___ygrNj",tips:"tips___yRoBl",tableCotainer:"tableCotainer____phIu",name:"name___oQNhw",tag:"tag___MmgZg"},k=r(78241),X=r(26220),_e=r(95237),$=r(43604),Ce=Object.defineProperty,ge=Object.defineProperties,Fe=Object.getOwnPropertyDescriptors,H=Object.getOwnPropertySymbols,Be=Object.prototype.hasOwnProperty,ye=Object.prototype.propertyIsEnumerable,Q=(n,u,t)=>u in n?Ce(n,u,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[u]=t,x=(n,u)=>{for(var t in u||(u={}))Be.call(u,t)&&Q(n,t,u[t]);if(H)for(var t of H(u))ye.call(u,t)&&Q(n,t,u[t]);return n},w=(n,u)=>ge(n,Fe(u)),he=(n,u,t)=>new Promise((p,_)=>{var o=d=>{try{l(t.next(d))}catch(E){_(E)}},v=d=>{try{l(t.throw(d))}catch(E){_(E)}},l=d=>d.done?p(d.value):Promise.resolve(d.value).then(o,v);l((t=t.apply(n,u)).next())});const Ne={wrapperCol:{span:21}},be=({actionTabs:n,tabListData:u,expandedRowKeys:t,all_goal_value:p,loading:_,dispatch:o})=>{const[v]=k.default.useForm(),[l,d]=(0,e.useState)("all"),[E,b]=(0,e.useState)({});(0,e.useEffect)(()=>{d("all");let a={};u.forEach(m=>{m.children&&m.children.length>0&&m.children.forEach(f=>a[f.id]=f.goal_value!==void 0?f.goal_value:"")}),b(a)},[]);const i=[{title:"\u6BD5\u4E1A\u8981\u6C42\u53CA\u6307\u6807\u70B9",key:"content",render:a=>e.createElement(N.Z,{placement:"top",title:a.content},a.children?e.createElement("span",null,a.position,".",a.content):e.createElement("span",null,a.content))},{title:"\u8FBE\u6210\u9608\u503C",key:"action",width:100,render:a=>e.createElement("div",null,a.children?"\u81EA\u52A8\u8BA1\u7B97":e.createElement(X.Z,{key:a.id,defaultValue:a.goal_value,onChange:m=>b(w(x({},E),{[a.id]:m})),style:{width:64},min:0,max:1,step:.1,precision:3}))}],s=()=>{o({type:"engineeringNormList/save",payload:{actionTabs:{key:"",params:{}}}})},C=()=>he(void 0,null,function*(){const{configure:a,goal_value:m}=yield v.validateFields();let f=!1,O={ec_year_id:n.params.id,type:a};if(a==="all"&&(O=w(x({},O),{goal_value:m})),a==="each"){let ee=[];for(let I in E)E[I]===""&&(f=!0),ee.push({id:Number(I),goal_value:E[I]});O=w(x({},O),{subitems:ee})}f&&D.ZP.info("\u8BF7\u586B\u5199\u5168\u90E8\u7684\u9608\u503C"),["each","all"].includes(a)&&!f&&o({type:"engineeringNormList/putGoalValue",payload:O})});return e.createElement("div",{className:M.normThresholdsModalModalContainer},e.createElement(R.default,{title:"\u914D\u7F6E\u8FBE\u6210\u9608\u503C",open:!0,width:880,wrapClassName:M.normThresholdsModalWrap,onCancel:s,onOk:C,confirmLoading:_.effects["engineeringNormList/putGoalValue"]||!1},e.createElement("div",{className:M.normThresholdsContent},e.createElement("div",{className:M.tips},e.createElement("div",null,"\u8BF4\u660E\uFF1A"),e.createElement("div",null,"1.\u6307\u6807\u70B9\u7684\u8FBE\u6210\u9608\u503C\u8BBE\u7F6E\u8303\u56F4\uFF080,1\uFF09\uFF0C\u4FDD\u7559\u5C0F\u6570\u70B9\u540E\u4E09\u4F4D\uFF1B"),e.createElement("div",null,"2.\u6BD5\u4E1A\u8981\u6C42\u7684\u8FBE\u6210\u9608\u503C\u6839\u636E\u8BBE\u7F6E\u7684\u8BA1\u7B97\u516C\u5F0F\u4E0E\u6307\u6807\u70B9\u9608\u503C\u81EA\u52A8\u8BA1\u7B97\u3002\u5982\uFF1A"),e.createElement("div",null,"\u8BBE\u7F6E\u7684\u6BD5\u4E1A\u8981\u6C42\u5F97\u5206\u8BA1\u7B97\u516C\u5F0F\u662F\u6309\u6307\u6807\u70B9\u5F97\u5206\u7684\u5E73\u5747\u5206\u8BA1\u7B97\uFF0C\u5219\u6BD5\u4E1A\u8981\u6C42\u8FBE\u6210\u9608\u503C=\u5F53\u524D\u6BD5\u4E1A\u8981\u6C42\u4E0B\u6240\u6709\u6307\u6807\u70B9\u8FBE\u6210\u9608\u503C\u7684\u5E73\u5747\u503C\uFF1B"),e.createElement("div",null,"\u8BBE\u7F6E\u7684\u6BD5\u4E1A\u8981\u6C42\u5F97\u5206\u8BA1\u7B97\u516C\u5F0F\u662F\u6309\u591A\u4E2A\u6307\u6807\u70B9\u5F97\u5206\u7684\u6700\u5C0F\u503C\u8BA1\u7B97\uFF0C\u5219\u6BD5\u4E1A\u8981\u6C42\u8FBE\u6210\u9608\u503C=\u5F53\u524D\u6BD5\u4E1A\u8981\u6C42\u4E0B\u6240\u6709\u6307\u6807\u70B9\u5F97\u5206\u7684\u6700\u5C0F\u503C\u3002")),e.createElement(k.default,w(x({},Ne),{form:v,initialValues:{configure:"all",goal_value:p}}),e.createElement(k.default.Item,{label:"\u914D\u7F6E\u65B9\u5F0F",name:"configure"},e.createElement(T.ZP.Group,{onChange:a=>{d(a.target.value)}},e.createElement(T.ZP,{value:"all"},"\u7EDF\u4E00\u914D\u7F6E"),e.createElement(T.ZP,{value:"each"},"\u5355\u72EC\u914D\u7F6E"))),l==="all"&&e.createElement(_e.Z,null,e.createElement($.Z,{span:7},e.createElement(k.default.Item,{label:"\u8FBE\u6210\u9608\u503C",name:"goal_value",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u9608\u503C"}]},e.createElement(X.Z,{onChange:a=>{v.setFieldsValue({goal_value:a})},placeholder:"\u8BF7\u8F93\u5165\u9608\u503C",style:{width:132},min:0,max:1,step:.1,precision:3}))),e.createElement($.Z,{span:12},e.createElement("span",{style:{fontSize:14,color:"#464f66"}},"\u4E3A\u6240\u6709\u6307\u6807\u70B9\u914D\u7F6E\u4E00\u6837\u7684\u8FBE\u6210\u9608\u503C"))),l==="each"&&e.createElement("div",null,e.createElement(j.default,{rowKey:"id",columns:i,bordered:!1,dataSource:u,expandable:{expandedRowKeys:t,expandIcon:()=>e.createElement(e.Fragment,null)},pagination:!1,scroll:{y:460}}))))))};var Pe=(0,y.connect)(({loading:n,engineeringNormList:u})=>x({loading:n},u))(be),xe=Object.defineProperty,U=Object.getOwnPropertySymbols,Oe=Object.prototype.hasOwnProperty,Ae=Object.prototype.propertyIsEnumerable,q=(n,u,t)=>u in n?xe(n,u,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[u]=t,Le=(n,u)=>{for(var t in u||(u={}))Oe.call(u,t)&&q(n,t,u[t]);if(U)for(var t of U(u))Ae.call(u,t)&&q(n,t,u[t]);return n};const{Option:Te}=S.default,Me=({user:n,actionTabs:u,headerData:t,tabListData:p,loading:_,dispatch:o})=>{var v,l,d;const E=(0,e.useRef)(!0);(0,e.useEffect)(()=>{var a;return(a=n.userInfo)!=null&&a.login&&o({type:"engineeringNormList/getMajorList"}),()=>{o({type:"engineeringNormList/save",payload:{actionTabs:{key:"",params:{}}}}),o({type:"engineeringNormList/setMajorOrYearActive",payload:{key:c.k[0],value:""}}),o({type:"engineeringNormList/setMajorOrYearActive",payload:{key:c.k[1],value:""}})}},[(v=n.userInfo)==null?void 0:v.login]),(0,e.useEffect)(()=>{var a;(a=t.active)!=null&&a[c.k[0]]&&(o({type:"engineeringNormList/getYearList",payload:{id:t.active[c.k[0]],firstEnter:E.current}}),E.current=!1,o({type:"engineeringNormList/setMajorOrYearActive",payload:{key:c.k[1],value:""}}),o({type:"engineeringNormList/setMajorOrYearDataSource",payload:{key:c.k[1],value:[]}}))},[(l=t.active)==null?void 0:l[c.k[0]]]),(0,e.useEffect)(()=>{o({type:"engineeringNormList/getGraduationResults"})},[(d=t.active)==null?void 0:d[c.k[1]]]);const b=(a,m)=>{o({type:"engineeringNormList/setMajorOrYearActive",payload:{key:a,value:m}})},i=()=>{o({type:"engineeringNormList/exportGraduation"})},s=()=>{p.length&&t.active[c.k[1]]&&o({type:"engineeringNormList/compute",payload:{all:!0,ec_year_id:t.active[c.k[1]]}})},C=a=>{o({type:"engineeringNormList/save",payload:{actionTabs:{key:a,params:{id:t.active[c.k[1]]}}}})};return e.createElement("div",{className:F.normContainer},e.createElement(L.p,{title:"\u6307\u6807\u8BC4\u4EF7"}),e.createElement("div",{className:F.header},e.createElement("div",{className:F.select},Object.entries(t.dataSource).map(([a,m])=>e.createElement(L.v,{title:a,key:a},e.createElement(S.default,{style:{width:m.width},value:t.active[a]||void 0,bordered:!1,placeholder:m.placeholder,loading:_.effects[m.loading],onChange:f=>b(a,f)},m.dataList.map(f=>e.createElement(Te,{key:f.value,value:f.value},f.label)))))),e.createElement("div",{className:F.button},e.createElement(h.ZP,{type:"default",icon:e.createElement("i",{className:"iconfont icon-yuzhi"}),disabled:!t.active[c.k[1]],onClick:()=>C("\u914D\u7F6E\u8FBE\u6210\u9608\u503C")},"\u914D\u7F6E\u8FBE\u6210\u9608\u503C"),e.createElement(h.ZP,{type:"default",icon:e.createElement("i",{className:"iconfont icon-jisuangongshi"}),disabled:!t.active[c.k[1]],onClick:()=>C("\u8BBE\u7F6E\u8BA1\u7B97\u516C\u5F0F")},"\u8BBE\u7F6E\u8BA1\u7B97\u516C\u5F0F"),e.createElement(h.ZP,{type:"primary",disabled:!p.length||!t.active[c.k[1]],icon:e.createElement("i",{className:"iconfont icon-jisuan"}),onClick:s},"\u5168\u90E8\u8BA1\u7B97"),e.createElement(h.ZP,{disabled:!p.length||!t.active[c.k[1]],onClick:i,type:"default",icon:e.createElement("i",{className:"iconfont icon-daochubeifen "})},"\u5BFC\u51FA"))),e.createElement("div",{className:F.tips},"\u8BF4\u660E\uFF1A\u6BD5\u4E1A\u8981\u6C42\u4E0B\u6240\u6709\u7684\u6307\u6807\u70B9\u90FD\u8FBE\u6210\u7684\u65F6\u5019\uFF0C\u6BD5\u4E1A\u8981\u6C42\u624D\u7B97\u8FBE\u6210\u3002"),e.createElement(ie,null),u.key==="\u8BBE\u7F6E\u8BA1\u7B97\u516C\u5F0F"&&t.active[c.k[1]]&&e.createElement(fe,null),u.key==="\u914D\u7F6E\u8FBE\u6210\u9608\u503C"&&t.active[c.k[1]]&&e.createElement(Pe,null))};var ke=(0,y.connect)(({user:n,loading:u,engineeringNormList:t})=>Le({user:n,loading:u},t))(Me)},52306:function(te,A,r){r.d(A,{p:function(){return c},v:function(){return h}});var e=r(59301),L={panelTitleContainer:"panelTitleContainer___Ypuh_"},c=({title:B,style:N={}})=>e.createElement("div",{className:L.panelTitleContainer,style:N},e.createElement("div",null,B)),F={selectWrapContainer:"selectWrapContainer___qocIH"},h=({title:B,children:N})=>e.createElement("div",{className:F.selectWrapContainer},e.createElement("span",null,B),N)}}]);