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

1 line
8.8 KiB

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[65191],{80117:function(e,t,n){n.d(t,{Z:function(){return o}});var a=n(74932),i=n(59301),s={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z"}}]},name:"close-circle",theme:"outlined"},r=n(1393),l=function(e,t){return i.createElement(r.Z,(0,a.Z)({},e,{ref:t,icon:s}))};var o=i.forwardRef(l)},86798:function(e,t,n){n.r(t);var a=n(7557),i=n.n(a),s=n(41498),r=n.n(s),l=n(79800),o=n.n(l),c=n(39647),d=n.n(c),u=n(59301),f=n(33936),x=n(31797),p=n(57809),_=n(43418),m=n(51945),h=n(86859),g=(n(52329),n(65022),n(16739)),j=n(67444),y=n(11249),v=n(65850),S=n(5479),b=n(61186),k=n.n(b),w=n(37712),I=["classroomList","globalSetting","loading","user","dispatch"];x.Z.Countdown,p.default.Option;k().locale("ZH-cn");t.default=(0,f.connect)((function(e){var t=e.classroomList,n=e.loading,a=e.globalSetting,i=e.user;return{classroomList:t,globalSetting:a,loading:n.models.classroomList,user:i}}))((function(e){e.classroomList,e.globalSetting,e.loading;var t=e.user,n=(e.dispatch,d()(e,I),(0,f.useSearchParams)()),a=o()(n,1)[0],s=(0,u.useState)(a.get("category")||"manage_certificates"),l=o()(s,2),c=l[0],x=l[1],p=(0,u.useState)(),b=o()(p,2),k=b[0],Z=b[1],z=(0,u.useState)(1),C=o()(z,2),F=C[0],L=C[1],W=(0,u.useState)(15),P=o()(W,2),V=P[0],G=(P[1],(0,u.useState)(!1)),N=o()(G,2),O=N[0],T=N[1],A=(0,u.useState)([]),M=o()(A,2),q=M[0],E=M[1],H=(0,u.useState)(!1),R=o()(H,2),B=R[0],D=R[1],Y=(0,u.useState)(),J=o()(Y,2),K=J[0],Q=J[1];(0,u.useRef)(),(0,f.useParams)();function U(){return U=r()(i()().mark((function e(n){var a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,j.ZP)("/api/users/".concat(null==t||null===(a=t.userInfo)||void 0===a?void 0:a.login,"/subjects/").concat(n,".json"),{method:"get",params:{page:F,limit:V}});case 2:(s=e.sent)&&Z(s);case 4:case"end":return e.stop()}}),e)}))),U.apply(this,arguments)}(0,u.useEffect)((function(){var e;null!=t&&null!==(e=t.userInfo)&&void 0!==e&&e.login&&function(e){U.apply(this,arguments)}(c)}),[c,F,t]);var X=[{title:"序号",dataIndex:"name",align:"left",key:"name",ellipsis:!0,width:50,render:function(e,t,n){return(0,w.jsx)("span",{children:n+1})}},{title:"课程名称",dataIndex:"subject_name",key:"subject_name"},{title:"申请人",dataIndex:"user_name",key:"user_name"},{title:"申请时间",dataIndex:"created_at",key:"created_at"},{title:"证书编号",dataIndex:"code",key:"code"}],$=[{title:"序号",dataIndex:"name",align:"left",key:"name",ellipsis:!0,width:50,render:function(e,t,n){return(0,w.jsx)("span",{style:{color:"#000000",fontSize:14},children:V*(F-1)+n+1})}},{title:"课程名称",dataIndex:"name",key:"name",render:function(e,t,n){return(0,w.jsx)("span",{style:{color:"#000000",fontSize:14,fontWeight:500},children:e||"- -"})}},{title:"开课人",dataIndex:"subject_user_name",key:"subject_user_name",ellipsis:!0,render:function(e,t,n){return(0,w.jsx)("span",{style:{color:"#000000",fontSize:14,fontWeight:400},children:e||"- -"})}},{title:"实训数",dataIndex:"shixuns_count",key:"shixuns_count",render:function(e,t,n){return(0,w.jsx)("span",{style:{color:"#5F6368",fontSize:14,fontWeight:400},children:e||"- -"})}},{title:"申请人数",dataIndex:"certificates_count",key:"certificates_count",render:function(e,t,n){return(0,w.jsx)("span",{style:{color:"#5F6368",fontSize:14,fontWeight:400},children:e||"- -"})}},{title:"申请时间",dataIndex:"created_at",key:"created_at",ellipsis:!0,render:function(e,t,n){return(0,w.jsx)("span",{style:{color:"#5F6368",fontSize:14,fontWeight:400},children:e||"- -"})}},{title:"操作",dataIndex:"remark",key:"remark",ellipsis:!0,render:function(e,n,a){return(0,w.jsx)("span",{onClick:r()(i()().mark((function e(){var a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,j.ZP)("/api/users/".concat(t.userInfo.login,"/subjects/certificate_users.json"),{method:"get",params:{page:1,limit:1e4,subject_id:null==n?void 0:n.id}});case 2:(a=e.sent)&&(E(a),T(!0));case 4:case"end":return e.stop()}}),e)}))),style:{cursor:"pointer",color:"#165DFF"},children:"查看申请人"})}}],ee=[{title:"序号",dataIndex:"name",align:"center",key:"name",ellipsis:!0,width:50,render:function(e,t,n){return(0,w.jsx)("span",{style:{color:"#000000"},children:V*(F-1)+n+1})}},{title:"课程名称",dataIndex:"subject_name",key:"subject_name",ellipsis:!0,render:function(e,t,n){return(0,w.jsx)("span",{style:{color:"#000000",fontSize:14,fontWeight:500},children:e||"- -"})}},{title:"开课人",dataIndex:"subject_user_name",key:"subject_user_name",ellipsis:!0,render:function(e,t,n){return(0,w.jsx)("span",{style:{color:"#000000",fontSize:14,fontWeight:400},children:e||"- -"})}},{title:"实训数",dataIndex:"shixuns_count",key:"shixuns_count",ellipsis:!0,render:function(e,t,n){return(0,w.jsx)("span",{style:{color:"#5F6368",fontSize:14,fontWeight:400},children:e||"- -"})}},{title:"申请时间",dataIndex:"created_at",key:"created_at",ellipsis:!0,render:function(e,t,n){return(0,w.jsx)("span",{style:{color:"#5F6368",fontSize:14,fontWeight:400},children:e||"- -"})}},{title:"申请状态",dataIndex:"state",ellipsis:!0,key:"state",render:function(e,t){return(0,w.jsxs)(w.Fragment,{children:["drafted"===(null==t?void 0:t.state)&&(0,w.jsx)("span",{style:{color:"#000000"},children:"申请中"}),"rejected"===(null==t?void 0:t.state)&&(0,w.jsx)("span",{style:{color:"#000000"},children:"未通过"}),"passed"===(null==t?void 0:t.state)&&(0,w.jsx)("span",{style:{color:"#000000"},children:"通过"})]})}},{title:"操作",dataIndex:"code",key:"code",ellipsis:!0,render:function(e,t,n){return(0,w.jsxs)("div",{style:{display:"flex",justifyContent:"space-evenly"},children:["passed"===(null==t?void 0:t.state)&&(0,w.jsx)("span",{style:{cursor:"pointer",color:"#0152d9"},onClick:function(){Q(t),D(!0)},children:"查看证书"}),"drafted"===(null==t?void 0:t.state)&&(0,w.jsx)("span",{style:{cursor:"not-allowed",color:"#7F7F7F"},children:"查看"}),"rejected"===(null==t?void 0:t.state)&&(0,w.jsx)("span",{onClick:function(){return e=t,void _.Z.info({title:"拒绝原因",icon:null,className:"custom-modal-divider",centered:!0,width:400,content:(0,w.jsx)("div",{children:null==e?void 0:e.content}),okText:"确定"});var e},style:{cursor:"pointer",color:"#0152d9"},children:"查看拒绝理由"})]})}}];return(0,w.jsxs)("div",{style:{marginTop:22,marginLeft:45},children:[(0,w.jsx)(y.YG,{value:c,onChange:function(e){var t;null!==(t=window.location.href.toString())&&void 0!==t&&t.includes("category")?(0,g.jz)("category",e):window.history.replaceState(null,"",window.location.href.indexOf("?")>-1?window.location.href+"&category=".concat(e):"?category=".concat(e)),x(e)},className:"mb25",dataSource:[{id:"manage_certificates",name:"我管理的"},{id:"my_certificates",name:"我获得的"}]}),"manage_certificates"===c&&(0,w.jsxs)("div",{children:[(0,w.jsx)(y.Gi,{children:(0,w.jsx)(m.Z,{columns:$,dataSource:null==k?void 0:k.subjects,pagination:!1})}),(0,w.jsx)(h.Z,{hideOnSinglePage:!0,style:{textAlign:"center",marginTop:"10px"},pageSize:V,current:F,onChange:function(e,t){L(e)},total:null==k?void 0:k.total_count})]}),"my_certificates"===c&&(0,w.jsxs)("div",{children:[(0,w.jsx)(y.Gi,{children:(0,w.jsx)(m.Z,{columns:ee,dataSource:null==k?void 0:k.certificates,pagination:!1})}),(0,w.jsx)(h.Z,{hideOnSinglePage:!0,style:{textAlign:"center",marginTop:"10px"},pageSize:V,current:F,onChange:function(e,t){L(e)},total:null==k?void 0:k.total_count})]}),(0,w.jsx)(_.Z,{title:"查看申请人",open:O,width:800,footer:null,wrapClassName:v.Z.CustomCss,onCancel:function(){return T(!1)},children:(0,w.jsx)(y.Gi,{children:(0,w.jsx)(m.Z,{dataSource:null==q?void 0:q.certificates,pagination:!1,columns:X})})}),(0,w.jsx)(S.Z,{visible:B,onCancel:function(){D(!1)},data:K||{}})]})}))},65850:function(e,t){t.Z={flex_box_center:"flex_box_center___vG4eV",flex_space_between:"flex_space_between___qVVxe",flex_box_vertical_center:"flex_box_vertical_center___P8Z8s",flex_box_center_end:"flex_box_center_end___VMme3",flex_box_column:"flex_box_column___VMHwm",dropdownmenus:"dropdownmenus___oVzoj",popupClassNames:"popupClassNames___OcZq7",selectdown:"selectdown___mmcA8"}},52329:function(){}}]);