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__Graduations__Lists__Pers...

1 line
15 KiB

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[66063],{57732:function(e,n,t){var s=t(26801),i=t.n(s),r=(t(59301),t(93314)),c=t(3113),a=t(37712);n.Z=function(e){var n=e.img,t=e.buttonProps,s=void 0===t?{}:t,l=e.styles,o=void 0===l?{}:l,d=e.customText,u=e.ButtonText,h=e.ButtonClick,p=e.Buttonclass,x=e.ButtonTwo,f=e.imgStyles,m=e.loading,g=void 0!==m&&m;return(0,a.jsxs)("section",{className:"tc animated fadeIn",style:i()(i()({},{color:"#999",margin:"100px auto",visibility:g?"hidden":"visible"}),o),children:[(0,a.jsx)("img",{src:n||r,style:i()({},f)}),(0,a.jsx)("p",{className:"mt20 font14",children:d||"暂时还没有相关数据哦!"}),u&&(0,a.jsx)(c.ZP,i()(i()({className:p,onClick:h},s),{},{children:u})),x&&x]})}},17276:function(e,n,t){t.r(n),t.d(n,{default:function(){return P}});var s=t(26801),i=t.n(s),r=t(93923),c=t.n(r),a=t(10574),l=t.n(a),o=t(39343),d=t.n(o),u=t(11006),h=t.n(u),p=t(59301),x={flex_box_center:"flex_box_center___SU33_",flex_space_between:"flex_space_between___NnGYW",flex_box_vertical_center:"flex_box_vertical_center___lX31d",flex_box_center_end:"flex_box_center_end___KWld3",flex_box_column:"flex_box_column___QHzze",ActvieE3:"ActvieE3___Hv5W0",Actvie00:"Actvie00___xMrRz",body:"body___gECjr",AddBut:"AddBut___iCNdk",selectInfo:"selectInfo___2doF7"},f=t(22211),m=t(78241),g=t(6848),v=t(43418),j=t(81327),_=t(3113),w=t(95237),Z=t(43604),k=t(8591),b=t(59981),N=t(72315),y=t(41867),C=t(1056),S=t(23878),I=t(89392),F=t(17044),O=t(57732),z=t(42121),A=t(58696),L=t(37712),P=(0,f.connect)((function(e){return{graduations:e.graduations,loading:e.loading}}))((function(e){var n,t,s,r,a,o,u,P,T,B,E,G,H=e.graduations,R=e.loading,V=e.dispatch,W=(0,f.useParams)(),K=(0,f.useSearchParams)(),Q=h()(K,1)[0],U=(0,p.useState)("teachers"),q=h()(U,2),J=q[0],X=q[1],Y=(0,p.useState)("processing"),D=h()(Y,2),M=D[0],$=D[1],ee=(0,p.useRef)(""),ne=(0,p.useState)(!1),te=h()(ne,2),se=te[0],ie=te[1],re=m.Z.useForm(),ce=h()(re,1)[0],ae=(0,p.useState)(!1),le=h()(ae,2),oe=le[0],de=le[1],ue=(0,p.useState)({id:W.id,keyword:ee.current,page:1,per_page:20}),he=h()(ue,2),pe=he[0],xe=he[1],fe=(0,p.useState)([]),me=h()(fe,2),ge=me[0],ve=me[1],je=[{title:"教师姓名",width:112,dataIndex:"name",ellipsis:!0,render:function(e){return(0,L.jsx)(g.Z,{placement:"topLeft",title:e,children:(0,L.jsx)("span",{children:e||"- -"})})}},{title:"所属学校",dataIndex:"school",ellipsis:!0,render:function(e){return(0,L.jsx)(g.Z,{placement:"topLeft",title:e,children:(0,L.jsx)("span",{children:e||"- -"})})}},{title:"所属学院",ellipsis:!0,dataIndex:"department",render:function(e){return(0,L.jsx)(g.Z,{placement:"topLeft",title:e,children:(0,L.jsx)("span",{children:e||"- -"})})}},{title:"工号",width:120,dataIndex:"staff_id",ellipsis:!0,render:function(e){return(0,L.jsx)(g.Z,{placement:"topLeft",title:e,children:(0,L.jsx)("span",{children:e||"- -"})})}},{title:"职称",dataIndex:"technical_title",width:80,ellipsis:!0,render:function(e){return(0,L.jsx)(g.Z,{placement:"topLeft",title:e,children:(0,L.jsx)("span",{children:e||"- -"})})}},{title:"操作",align:"right",width:100,dataIndex:"name",render:function(e,n){return(0,L.jsx)(L.Fragment,{children:(0,A.tu)()&&(0,L.jsxs)(L.Fragment,{children:["processing"===M&&(0,L.jsx)("a",{className:x.ActvieE3,onClick:function(){v.Z.confirm({centered:!0,icon:null,title:"删除",content:(0,L.jsx)("div",{className:"",children:'确认要将"'.concat(n.name,'"从该毕业设计中移除吗?移除后该用 户在毕设中提交的文件将被清空')}),onOk:(0,I.throttle)(d()(l()().mark((function e(){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,F.zT)(W.id,{ids:[n.id]});case 2:0===(null==(t=e.sent)?void 0:t.status)&&ke();case 4:case"end":return e.stop()}}),e)}))),2e3)})},children:"删除"}),"processing"!==M&&(0,L.jsx)(L.Fragment,{children:(0,L.jsxs)(j.Z,{children:[(0,L.jsx)("a",{onClick:function(){v.Z.confirm({centered:!0,content:(0,L.jsx)("div",{className:"",children:'是否确认同意"'.concat(n.name,'"的加入?')}),onOk:(0,I.throttle)(d()(l()().mark((function e(){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,F.V1)(W.id,{ids:[n.id]});case 2:0===(null==(t=e.sent)?void 0:t.status)&&ke();case 4:case"end":return e.stop()}}),e)}))),2e3)})},children:"通过"}),(0,L.jsx)("a",{onClick:function(){v.Z.confirm({icon:null,centered:!0,title:'是否确认拒绝"'.concat(n.name,'"的加入?'),onOk:(0,I.throttle)(d()(l()().mark((function e(){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,F.Ib)(W.id,{ids:[n.id]});case 2:0===(null==(t=e.sent)?void 0:t.status)&&ke();case 4:case"end":return e.stop()}}),e)}))),2e3)})},children:"驳回"})]})})]})})}}],_e=[{title:"学生姓名",width:112,dataIndex:"name",ellipsis:!0,render:function(e){return(0,L.jsx)(g.Z,{placement:"topLeft",title:e,children:(0,L.jsx)("span",{children:e})})}},{title:"学号",dataIndex:"student_id",ellipsis:!0,render:function(e){return(0,L.jsx)(g.Z,{placement:"topLeft",title:e,children:(0,L.jsx)("span",{children:e||"- -"})})}},{title:"手机号",width:200,ellipsis:!0,dataIndex:"phone",render:function(e){return(0,L.jsx)(g.Z,{placement:"topLeft",title:e,children:(0,L.jsx)("span",{children:e||"- -"})})}},{title:"专业",width:200,dataIndex:"major",ellipsis:!0,render:function(e){return(0,L.jsx)(g.Z,{placement:"topLeft",title:e,children:(0,L.jsx)("span",{children:e||"- -"})})}},{title:"所属课题",dataIndex:"graduation_tasks",width:136,ellipsis:!0,render:function(e){return(0,L.jsx)(g.Z,{placement:"topLeft",title:e,children:(0,L.jsx)("span",{children:e||"- -"})})}},{title:"操作",align:"right",width:120,dataIndex:"name",render:function(e,n){return(0,L.jsx)(L.Fragment,{children:(0,A.tu)()&&(0,L.jsxs)(L.Fragment,{children:["processing"===M&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)("a",{className:x.Active00,onClick:function(){ce.setFieldsValue(n),de(!0)},children:"编辑"}),(0,L.jsx)("a",{className:"ml20 ".concat(x.ActvieE3),onClick:function(){v.Z.confirm({centered:!0,icon:null,title:"删除",content:'确认要将"'.concat(n.name,'"从该毕业设计中移除吗?移除后该用 户在毕设中提交的文件将被清空'),onOk:(0,I.throttle)(d()(l()().mark((function e(){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,F.rU)(W.id,{ids:[n.id]});case 2:0===(null==(t=e.sent)?void 0:t.status)&&ke();case 4:case"end":return e.stop()}}),e)}))),2e3)})},children:"删除"})]}),"processing"!==M&&(0,L.jsx)(L.Fragment,{children:(0,L.jsxs)(j.Z,{children:[(0,L.jsx)("a",{className:x.Active00,onClick:function(){v.Z.confirm({centered:!0,content:(0,L.jsx)("div",{className:"",children:'是否确认同意"'.concat(n.name,'"的加入?')}),onOk:(0,I.throttle)(d()(l()().mark((function e(){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,F.Fi)(W.id,{ids:[n.id]});case 2:0===(null==(t=e.sent)?void 0:t.status)&&ke();case 4:case"end":return e.stop()}}),e)}))),2e3)})},children:"通过"}),(0,L.jsx)("a",{className:"ml20 ".concat(x.ActvieE3),onClick:function(){v.Z.confirm({icon:null,centered:!0,title:'是否确认拒绝"'.concat(n.name,'"的加入?'),onOk:(0,I.throttle)(d()(l()().mark((function e(){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,F.Zd)(W.id,{ids:[n.id]});case 2:0===(null==(t=e.sent)?void 0:t.status)&&ke();case 4:case"end":return e.stop()}}),e)}))),2e3)})},children:"驳回"})]})})]})})}}],we=[{id:"processing",name:"已审核 ".concat(("teachers"==J?null==H||null===(n=H.teachers)||void 0===n?void 0:n.pass_count:null==H||null===(t=H.students)||void 0===t?void 0:t.pass_count)||0)},{id:"end",name:"未审核 ".concat(("teachers"==J?null==H||null===(s=H.teachers)||void 0===s?void 0:s.not_pass_count:null==H||null===(r=H.students)||void 0===r?void 0:r.not_pass_count)||0)}],Ze={selectedRowKeys:ge,onChange:function(e){console.log("selectedRowKeys changed: ",e),ve(e)}},ke=function(){var e=d()(l()().mark((function e(){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n="graduations/getGraduationsStudents",pe.keyword=ee.current,""===M?delete pe.not_pass:pe.not_pass="processing"!==M,"teachers"===J&&(n="graduations/getGraduationsTeachers"),V({type:n,payload:pe});case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,p.useEffect)((function(){Q.get("state")&&0==Number(Q.get("state"))?$("end"):$("processing"),location.pathname.includes("teachers")?X("teachers"):X("students")}),[]),(0,p.useEffect)((function(){ke()}),[J,M,null==H?void 0:H.updateIndex]),(0,L.jsxs)("section",{className:x.body,children:[(0,L.jsx)(S.YG,{value:J,tabBarExtraContent:(0,L.jsx)(L.Fragment,{children:(0,L.jsx)(j.Z,{children:(0,A.tu)()&&(0,L.jsxs)(L.Fragment,{children:["teachers"!=J&&(0,L.jsx)(_.ZP,{className:x.AddBut,onClick:function(){return ie(!0)},children:"添加学生"}),"teachers"==J&&(0,L.jsx)(_.ZP,{className:x.AddBut,onClick:function(){return ie(!0)},children:"添加教师"})]})})}),dataSource:[{id:"teachers",name:"教师"},{id:"students",name:"学生"}],onChange:function(e){ee.current="",$("processing"),f.history.push("/graduations/".concat(W.id,"/").concat(e)),ve([])}}),(0,L.jsxs)(w.Z,{wrap:!1,align:"middle",justify:"space-between",children:[(0,L.jsx)(Z.Z,{children:(0,L.jsx)(S.qp,{title:"状态",className:"mt20",dataSource:we,titleWidth:28,value:M,onChange:function(e){pe.page=1,xe(pe),$(e),ve([])}})}),(0,L.jsx)(Z.Z,{children:(0,L.jsx)(S.t7,{style:{width:210,height:"38px"},placeholder:"".concat("teachers"===J?"教师姓名/工号":"学生姓名/学号"),value:ee.current,onChange:function(e){pe.page=1,xe(pe),ee.current=e,ke()}})})]}),(null==ge?void 0:ge.length)>0&&(0,A.tu)()&&(0,L.jsxs)("div",{className:x.selectInfo,children:[(0,L.jsxs)("div",{children:["已选择 ",(0,L.jsx)("span",{className:"c-blue",children:null==ge?void 0:ge.length})," 项"]}),(0,L.jsxs)("div",{children:["processing"===M&&(0,L.jsxs)("a",{className:"c-red",onClick:function(){v.Z.confirm({centered:!0,content:(0,L.jsx)("div",{className:"",children:"请确认是否要批量移除吗?"}),onOk:(0,I.throttle)(d()(l()().mark((function e(){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,("teachers"===J?F.zT:F.rU)(W.id,{ids:c()(ge)});case 2:0===(null==(n=e.sent)?void 0:n.status)&&(k.ZP.warning("批量删除操作成功"),pe.page=1,xe(pe),ve([]),ke());case 4:case"end":return e.stop()}}),e)}))),2e3)})},children:[(0,L.jsx)("span",{className:"iconfont icon-shanchu12 mr8"}),"批量删除"]}),"processing"!==M&&(0,L.jsxs)(j.Z,{children:[(0,L.jsxs)("a",{className:"c-green-29b ml20",onClick:function(){v.Z.confirm({centered:!0,content:(0,L.jsx)("div",{className:"",children:"请确认是否要批量通过吗?"}),onOk:(0,I.throttle)(d()(l()().mark((function e(){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,("teachers"===J?F.V1:F.Fi)(W.id,{ids:c()(ge)});case 2:0===(null==(n=e.sent)?void 0:n.status)&&(ve([]),k.ZP.warning("批量通过操作成功"),ke());case 4:case"end":return e.stop()}}),e)}))),2e3)})},children:[(0,L.jsx)("span",{className:"iconfont icon-tongguobeifen mr8 c-green-29b"}),"批量通过"]}),(0,L.jsxs)("a",{className:"c-red ml20",onClick:function(){v.Z.confirm({icon:null,centered:!0,content:(0,L.jsx)("div",{className:"",children:"请确认是否要批量驳回吗?"}),onOk:(0,I.throttle)(d()(l()().mark((function e(){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,("teachers"===J?F.Ib:F.Zd)(W.id,{ids:c()(ge)});case 2:0===(null==(n=e.sent)?void 0:n.status)&&(ve([]),k.ZP.warning("批量驳回操作成功"),ke());case 4:case"end":return e.stop()}}),e)}))),2e3)})},children:[(0,L.jsx)("span",{className:"iconfont icon-bohuibeifen mr8"}),"批量驳回"]})]})]})]}),"teachers"===J&&(0,L.jsxs)(b.Z,{loading:R.effects["graduations/getGraduationsTeachers"],avatar:!0,active:!0,children:[(0,L.jsx)(N.Z,{rowSelection:Ze,style:{minHeight:500},locale:{emptyText:(0,L.jsx)(O.Z,{customText:"暂时还没有相关数据哦!"})},columns:je,dataSource:(null==H||null===(a=H.teachers)||void 0===a?void 0:a.data)||[],pagination:!1}),0!=(null==H||null===(o=H.teachers)||void 0===o?void 0:o.count)&&(0,L.jsxs)(w.Z,{className:"mt20 mb20",wrap:!1,align:"middle",justify:"space-between",children:[(0,L.jsxs)(Z.Z,{children:["共 ",(0,L.jsx)("span",{className:"c-blue",children:null==H||null===(u=H.teachers)||void 0===u?void 0:u.count})," 条数据"]}),(0,L.jsx)(Z.Z,{children:(0,L.jsx)(y.Z,{showQuickJumper:!0,showSizeChanger:!0,onShowSizeChange:function(e,n){pe.per_page=n,xe(i()({},pe)),ke()},current:pe.page,pageSize:pe.per_page,onChange:function(e){pe.page=e,xe(i()({},pe)),ke()},total:null==H||null===(P=H.teachers)||void 0===P?void 0:P.count})})]})]}),"teachers"!==J&&(0,L.jsxs)(b.Z,{loading:R.effects["graduations/getGraduationsStudents"],avatar:!0,active:!0,children:[(0,L.jsx)(N.Z,{rowSelection:Ze,style:{minHeight:500},locale:{emptyText:(0,L.jsx)(O.Z,{customText:"暂时还没有相关数据哦!"})},columns:_e,dataSource:(null==H||null===(T=H.students)||void 0===T?void 0:T.data)||[],pagination:!1}),0!=(null==H||null===(B=H.students)||void 0===B?void 0:B.count)&&(0,L.jsxs)(w.Z,{className:"mt20 mb20",wrap:!1,align:"middle",justify:"space-between",children:[(0,L.jsxs)(Z.Z,{children:["共 ",(0,L.jsx)("span",{className:"c-blue",children:null==H||null===(E=H.students)||void 0===E?void 0:E.count})," 条数据"]}),(0,L.jsx)(Z.Z,{children:(0,L.jsx)(y.Z,{showQuickJumper:!0,showSizeChanger:!0,current:pe.page,pageSize:pe.per_page,onShowSizeChange:function(e,n){pe.per_page=n,pe.page=1,xe(i()({},pe)),ke()},onChange:function(e){pe.page=e,xe(i()({},pe)),ke()},total:null==H||null===(G=H.students)||void 0===G?void 0:G.count})})]})]}),(0,L.jsx)(v.Z,{centered:!0,open:oe,destroyOnClose:!0,title:"编辑学生",onCancel:function(){return de(!1)},onOk:function(){return ce.submit()},children:(0,L.jsxs)(m.Z,{className:"mt10",layout:"vertical",colon:!1,form:ce,initialValues:{},size:"large",onFinish:function(){var e=d()(l()().mark((function e(n){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,F.Ot)(i()({identifier:W.id},n));case 2:0==e.sent.status&&(k.ZP.success("修改成功"),de(!1),ke());case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:[(0,L.jsx)(m.Z.Item,{htmlFor:null,label:(0,L.jsx)("span",{style:{color:"#5F6368"},children:"专业"}),name:"major",rules:[{required:!0,message:"请输入专业"},{type:"string",max:60,message:"输入超限,请缩减字符数"},{type:"string",whitespace:!0,message:"内容不能全为空格"}],children:(0,L.jsx)(C.Z,{showCount:!0,maxLength:60,size:"large"})}),(0,L.jsx)(m.Z.Item,{hidden:!0,name:"id",children:(0,L.jsx)(C.Z,{})})]})}),(0,L.jsx)(z.Z,{open:se,onCancel:function(){return ie(!1)},title:"teachers"===J?"添加老师":"添加学生",OnOk:function(){var e=d()(l()().mark((function e(n){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,("teachers"==J?F.HF:F.NX)({id:W.id,user_ids:n});case 2:0==e.sent.status&&(k.ZP.success("添加成功"),ie(!1),V({type:"graduations/getGraduationsDetails",payload:{id:null==W?void 0:W.id}}),ke());case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()})]})}))}}]);