|
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[26741],{41894:function(e,n,i){i.r(n),i.d(n,{default:function(){return B}});var t=i(82242),a=i.n(t),r=i(79800),o=i.n(r),l=i(59301),s=i(60768),c=i(49389),d=i(33014),u="normContainer___W8XuE",h="header___b9n4K",f="select___HP7t1",_="button___mqRKo",m="tips___r2hsJ",p=i(57809),g=i(3113),v="normTablistContainer___yLRBP",x="red___hyG5_",j="green___YdwJo",y=i(6848),N=i(81327),k=i(48066),b=i(1710),L=i(37712),C=(0,c.connect)((function(e){var n=e.engineeringNormList,i=e.loading;return a()({loading:i},n)}))((function(e){var n=e.headerData,i=e.tabListData,t=e.loading,a=e.expandedRowKeys,r=e.dispatch,o=[{title:"毕业要求及指标点",key:"content",ellipsis:{showTitle:!1},width:"50%",render:function(e){return(0,L.jsx)(y.Z,{placement:"topLeft",title:e.content,children:e.children?(0,L.jsxs)("span",{children:[e.position,".",e.content]}):(0,L.jsx)("span",{children:e.content})})}},{title:"达成阈值",dataIndex:"goal_value",align:"center"},{title:"达成度实际值",dataIndex:"actual_value",align:"center"},{title:"评价结果",dataIndex:"status",align:"center",render:function(e){return(0,L.jsxs)("div",{className:e?j:x,children:[e?"":"未","达成"]})}},{title:"状态",dataIndex:"compute_status",render:function(e){return(0,L.jsx)("div",{children:e||"--"})}},{title:"计算时间",dataIndex:"compute_time",render:function(e){return(0,L.jsx)("div",{children:e||"--"})}},{title:"操作",width:80,render:function(e){return e.children?(0,L.jsxs)(N.Z,{children:[(0,L.jsx)(k.Z.Link,{onClick:function(){return l(e.id)},children:(0,L.jsx)("i",{className:"iconfont icon-jisuan",style:{color:"#0152D9"}})}),(0,L.jsx)(k.Z.Link,{onClick:function(){c.history.push("/engineering/evaluate/norm/".concat(n.active[d.k[1]],"/").concat(e.id))},children:(0,L.jsx)("i",{className:"iconfont icon-chakansvg",style:{color:"#0152D9"}})})]}):(0,L.jsx)(L.Fragment,{})}}],l=function(e){r({type:"engineeringNormList/compute",payload:{all:!1,ec_year_id:n.active[d.k[1]],id:e}})};return(0,L.jsx)("div",{className:v,children:(0,L.jsx)(b.Z,{loading:t.effects["engineeringNormList/getGraduationResults"]||t.effects["engineeringNormList/compute"],rowKey:"id",columns:o,bordered:!1,dataSource:i,expandable:{expandedRowKeys:a,expandIcon:function(){return(0,L.jsx)(L.Fragment,{})}},pagination:!1})})})),Z=i(85573),w=i.n(Z),T={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"},M=i(99313),P=i(5112),I=i(8591),R=i(43418),Y=M.Z.TabPane,S={formula_one:"指标点达成实际值",formula_two:"指标点评价结果",formula_three:"毕业要求达成实际值"},W=(0,c.connect)((function(e){var n=e.loading,i=e.engineeringNormList;return a()({loading:n},i)}))((function(e){var n=e.actionTabs,i=e.loading,t=e.dispatch,r=(0,l.useState)({}),s=o()(r,2),c=s[0],d=s[1],u=(0,l.useState)({formula_one:[],formula_two:[],formula_three:[]}),h=o()(u,2),f=h[0],_=h[1];(0,l.useEffect)((function(){t({type:"engineeringNormList/getFormulas",callback:function(e){if(e){_(e);var n={};for(var i in e){var t=e[i].find((function(e){return e.checked}));n[i]=t?t.id:void 0}d(n)}}})}),[]);var m=function(e){return[{title:"".concat(S[e],"计算公式"),key:"content",render:function(e){return(0,L.jsxs)("div",{className:T.name,children:[(0,L.jsx)("div",{children:e.checked&&(0,L.jsx)("span",{className:T.tag,children:"默认"})}),(0,L.jsxs)("div",{className:T.content,children:[(0,L.jsx)("div",{children:e.content}),e.explain&&(0,L.jsxs)("div",{className:T.subtitle,children:["说明:",e.explain]})]})]})}},{title:"操作",width:120,render:function(n){return(0,L.jsx)("div",{children:(0,L.jsx)(P.ZP,{checked:c[e]===n.id,onClick:function(){return p(e,n.id)},children:"设置默认公式"})})}}]},p=function(e,n){var i=f[e].map((function(e){return a()(a()({},e),{},{checked:n===e.id})}));d(a()(a()({},c),{},w()({},e,n))),_(a()(a()({},f),{},w()({},e,i)))},g=function(){t({type:"engineeringNormList/save",payload:{actionTabs:{key:"",params:{}}}})};return(0,L.jsx)("div",{className:T.normCalcModalContainer,children:(0,L.jsx)(R.Z,{title:"设置计算公式",open:!0,width:918,wrapClassName:T.normCalcModalWrap,onCancel:g,onOk:function(){t({type:"engineeringNormList/setFormulas",payload:a()({ec_year_id:n.params.id},c),callback:function(e){e&&0===e.status?(I.ZP.success("更新成功"),t({type:"engineeringNormList/getGraduationResults"}),g()):I.ZP.error("更新失败")}})},confirmLoading:i.effects["engineeringNormList/getFormulas"]||i.effects["engineeringNormList/setFormulas"]||!1,children:(0,L.jsx)("div",{className:T.normCalcContent,children:(0,L.jsx)(M.Z,{defaultActiveKey:"1",children:Object.entries(S).map((function(e,n){var i=o()(e,2),t=i[0],a=i[1];return(0,L.jsx)(Y,{tab:a,children:(0,L.jsx)("div",{className:T.tableCotainer,children:(0,L.jsx)(b.Z,{rowKey:"id",columns:m(t),dataSource:f[t],pagination:!1})})},(n+1).toString())}))})})})})})),F=i(7557),K=i.n(F),O=i(41498),E=i.n(O),G={normThresholdsModalWrap:"normThresholdsModalWrap___VJWzM",normThresholdsContent:"normThresholdsContent___ygrNj",tips:"tips___yRoBl",tableCotainer:"tableCotainer____phIu",name:"name___oQNhw",tag:"tag___MmgZg"},D=i(78241),V=i(5871),A=i(95237),z=i(43604),J={wrapperCol:{span:21}},q=(0,c.connect)((function(e){var n=e.loading,i=e.engineeringNormList;return a()({loading:n},i)}))((function(e){var n=e.actionTabs,i=e.tabListData,t=e.expandedRowKeys,r=e.all_goal_value,s=e.loading,c=e.dispatch,d=D.Z.useForm(),u=o()(d,1)[0],h=(0,l.useState)("all"),f=o()(h,2),_=f[0],m=f[1],p=(0,l.useState)({}),g=o()(p,2),v=g[0],x=g[1];(0,l.useEffect)((function(){m("all");var e={};i.forEach((function(n){n.children&&n.children.length>0&&n.children.forEach((function(n){return e[n.id]=void 0!==n.goal_value?n.goal_value:""}))})),x(e)}),[]);var j=[{title:"毕业要求及指标点",key:"content",render:function(e){return(0,L.jsx)(y.Z,{placement:"top",title:e.content,children:e.children?(0,L.jsxs)("span",{children:[e.position,".",e.content]}):(0,L.jsx)("span",{children:e.content})})}},{title:"达成阈值",key:"action",width:100,render:function(e){return(0,L.jsx)("div",{children:e.children?"自动计算":(0,L.jsx)(V.Z,{defaultValue:e.goal_value,onChange:function(n){return x(a()(a()({},v),{},w()({},e.id,n)))},style:{width:64},min:0,max:1,step:.1,precision:3},e.id)})}}],N=function(){var e=E()(K()().mark((function e(){var i,t,r,o,l,s,d;return K()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u.validateFields();case 2:if(i=e.sent,t=i.configure,r=i.goal_value,o=!1,l={ec_year_id:n.params.id,type:t},"all"===t&&(l=a()(a()({},l),{},{goal_value:r})),"each"===t){for(d in s=[],v)""===v[d]&&(o=!0),s.push({id:Number(d),goal_value:v[d]});l=a()(a()({},l),{},{subitems:s})}o&&I.ZP.info("请填写全部的阈值"),["each","all"].includes(t)&&!o&&c({type:"engineeringNormList/putGoalValue",payload:l});case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,L.jsx)("div",{className:G.normThresholdsModalModalContainer,children:(0,L.jsx)(R.Z,{title:"配置达成阈值",open:!0,width:880,wrapClassName:G.normThresholdsModalWrap,onCancel:function(){c({type:"engineeringNormList/save",payload:{actionTabs:{key:"",params:{}}}})},onOk:N,confirmLoading:s.effects["engineeringNormList/putGoalValue"]||!1,children:(0,L.jsxs)("div",{className:G.normThresholdsContent,children:[(0,L.jsxs)("div",{className:G.tips,children:[(0,L.jsx)("div",{children:"说明:"}),(0,L.jsx)("div",{children:"1.指标点的达成阈值设置范围(0,1),保留小数点后三位;"}),(0,L.jsx)("div",{children:"2.毕业要求的达成阈值根据设置的计算公式与指标点阈值自动计算。如:"}),(0,L.jsx)("div",{children:"设置的毕业要求得分计算公式是按指标点得分的平均分计算,则毕业要求达成阈值=当前毕业要求下所有指标点达成阈值的平均值;"}),(0,L.jsx)("div",{children:"设置的毕业要求得分计算公式是按多个指标点得分的最小值计算,则毕业要求达成阈值=当前毕业要求下所有指标点得分的最小值。"})]}),(0,L.jsxs)(D.Z,a()(a()({},J),{},{form:u,initialValues:{configure:"all",goal_value:r},children:[(0,L.jsx)(D.Z.Item,{label:"配置方式",name:"configure",children:(0,L.jsxs)(P.ZP.Group,{onChange:function(e){m(e.target.value)},children:[(0,L.jsx)(P.ZP,{value:"all",children:"统一配置"}),(0,L.jsx)(P.ZP,{value:"each",children:"单独配置"})]})}),"all"===_&&(0,L.jsxs)(A.Z,{children:[(0,L.jsx)(z.Z,{span:7,children:(0,L.jsx)(D.Z.Item,{label:"达成阈值",name:"goal_value",rules:[{required:!0,message:"请输入阈值"}],children:(0,L.jsx)(V.Z,{onChange:function(e){u.setFieldsValue({goal_value:e})},placeholder:"请输入阈值",style:{width:132},min:0,max:1,step:.1,precision:3})})}),(0,L.jsx)(z.Z,{span:12,children:(0,L.jsx)("span",{style:{fontSize:14,color:"#464f66"},children:"为所有指标点配置一样的达成阈值"})})]}),"each"===_&&(0,L.jsx)("div",{children:(0,L.jsx)(b.Z,{rowKey:"id",columns:j,bordered:!1,dataSource:i,expandable:{expandedRowKeys:t,expandIcon:function(){return(0,L.jsx)(L.Fragment,{})}},pagination:!1,scroll:{y:460}})})]}))]})})})})),X=p.default.Option,B=(0,c.connect)((function(e){var n=e.user,i=e.loading,t=e.engineeringNormList;return a()({user:n,loading:i},t)}))((function(e){var n,i,t,a=e.user,r=e.actionTabs,c=e.headerData,v=e.tabListData,x=e.loading,j=e.dispatch,y=(0,l.useRef)(!0);(0,l.useEffect)((function(){var e;return null!==(e=a.userInfo)&&void 0!==e&&e.login&&j({type:"engineeringNormList/getMajorList"}),function(){j({type:"engineeringNormList/save",payload:{actionTabs:{key:"",params:{}}}}),j({type:"engineeringNormList/setMajorOrYearActive",payload:{key:d.k[0],value:""}}),j({type:"engineeringNormList/setMajorOrYearActive",payload:{key:d.k[1],value:""}})}}),[null===(n=a.userInfo)||void 0===n?void 0:n.login]),(0,l.useEffect)((function(){var e;null!==(e=c.active)&&void 0!==e&&e[d.k[0]]&&(j({type:"engineeringNormList/getYearList",payload:{id:c.active[d.k[0]],firstEnter:y.current}}),y.current=!1,j({type:"engineeringNormList/setMajorOrYearActive",payload:{key:d.k[1],value:""}}),j({type:"engineeringNormList/setMajorOrYearDataSource",payload:{key:d.k[1],value:[]}}))}),[null===(i=c.active)||void 0===i?void 0:i[d.k[0]]]),(0,l.useEffect)((function(){j({type:"engineeringNormList/getGraduationResults"})}),[null===(t=c.active)||void 0===t?void 0:t[d.k[1]]]);var N=function(e){j({type:"engineeringNormList/save",payload:{actionTabs:{key:e,params:{id:c.active[d.k[1]]}}}})};return(0,L.jsxs)("div",{className:u,children:[(0,L.jsx)(s.p,{title:"指标评价"}),(0,L.jsxs)("div",{className:h,children:[(0,L.jsx)("div",{className:f,children:Object.entries(c.dataSource).map((function(e){var n=o()(e,2),i=n[0],t=n[1];return(0,L.jsx)(s.v,{title:i,children:(0,L.jsx)(p.default,{style:{width:t.width},value:c.active[i]||void 0,bordered:!1,placeholder:t.placeholder,loading:x.effects[t.loading],onChange:function(e){return function(e,n){j({type:"engineeringNormList/setMajorOrYearActive",payload:{key:e,value:n}})}(i,e)},children:t.dataList.map((function(e){return(0,L.jsx)(X,{value:e.value,children:e.label},e.value)}))})},i)}))}),(0,L.jsxs)("div",{className:_,children:[(0,L.jsx)(g.ZP,{type:"default",icon:(0,L.jsx)("i",{className:"iconfont icon-yuzhi"}),disabled:!c.active[d.k[1]],onClick:function(){return N("配置达成阈值")},children:"配置达成阈值"}),(0,L.jsx)(g.ZP,{type:"default",icon:(0,L.jsx)("i",{className:"iconfont icon-jisuangongshi"}),disabled:!c.active[d.k[1]],onClick:function(){return N("设置计算公式")},children:"设置计算公式"}),(0,L.jsx)(g.ZP,{type:"primary",disabled:!v.length||!c.active[d.k[1]],icon:(0,L.jsx)("i",{className:"iconfont icon-jisuan"}),onClick:function(){v.length&&c.active[d.k[1]]&&j({type:"engineeringNormList/compute",payload:{all:!0,ec_year_id:c.active[d.k[1]]}})},children:"全部计算"}),(0,L.jsx)(g.ZP,{disabled:!v.length||!c.active[d.k[1]],onClick:function(){j({type:"engineeringNormList/exportGraduation"})},type:"default",icon:(0,L.jsx)("i",{className:"iconfont icon-daochubeifen "}),children:"导出"})]})]}),(0,L.jsx)("div",{className:m,children:"说明:毕业要求下所有的指标点都达成的时候,毕业要求才算达成。"}),(0,L.jsx)(C,{}),"设置计算公式"===r.key&&c.active[d.k[1]]&&(0,L.jsx)(W,{}),"配置达成阈值"===r.key&&c.active[d.k[1]]&&(0,L.jsx)(q,{})]})}))},60768:function(e,n,i){i.d(n,{p:function(){return r},v:function(){return l}});i(59301);var t="panelTitleContainer___Ypuh_",a=i(37712),r=function(e){var n=e.title,i=e.style,r=void 0===i?{}:i;return(0,a.jsx)("div",{className:t,style:r,children:(0,a.jsx)("div",{children:n})})},o="selectWrapContainer___qocIH",l=function(e){var n=e.title,i=e.children;return(0,a.jsxs)("div",{className:o,children:[(0,a.jsx)("span",{children:n}),i]})}}}]); |