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/4954.async.js

1 line
8.3 KiB

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[4954],{4954:function(e,t,n){var r=n(37205),a=n.n(r),l=n(82242),s=n.n(l),i=n(7557),c=n.n(i),o=n(41498),u=n.n(o),d=n(79800),p=n.n(d),f=n(59301),h=n(33936),x=n(78241),m=n(6848),y=n(8591),g=n(43418),v=n(57809),b=n(24650),j=n(88522),w=n(51945),S=n(61186),k=n.n(S),Z=n(53070),C=n(55896),O=n(11249),_=n(37712);t.Z=(0,h.connect)((function(e){return{graduations:e.graduations}}))((function(e){e.graduations.StageSetting;var t=e.onCancel,n=e.OnOk,r=e.open,l=void 0!==r&&r,i=e.title,o=(e.dispatch,(0,h.useParams)()),d=(0,f.useState)([]),S=p()(d,2),I=S[0],N=S[1],E=x.Z.useForm(),L=p()(E,1)[0],F=(0,f.useState)({school:"",search:"",search_type:"name"}),T=p()(F,2),P=T[0],D=T[1],H=(0,f.useState)(!0),Y=p()(H,2),q=Y[0],M=Y[1],R=(0,f.useState)(!1),U=p()(R,2),V=U[0],B=U[1],$=(0,f.useState)(!1),z=p()($,2),K=z[0],G=z[1],W=(0,f.useState)([]),X=p()(W,2),A=X[0],J=X[1],Q=(0,f.useState)(0),ee=p()(Q,2),te=ee[0],ne=ee[1],re=(0,f.useState)(0),ae=p()(re,2),le=ae[0],se=ae[1],ie=(0,f.useState)(1),ce=p()(ie,2),oe=ce[0],ue=ce[1],de=(0,f.useState)([]),pe=p()(de,2),fe=pe[0],he=pe[1],xe=(0,f.useState)(!1),me=p()(xe,2),ye=me[0],ge=me[1],ve=(0,f.useRef)(null);(0,f.useEffect)((function(){switch(i){case"添加学生":se(0);break;case"添加老师":se(1);break;default:se(null)}}),[l]),(0,f.useEffect)((function(){u()(c()().mark((function e(){var t,n;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.xF)({keyword:"",per_page:9999});case 2:n=e.sent,N(null==n||null===(t=n.schools)||void 0===t?void 0:t.map((function(e){return{label:e.name,value:e.id}})));case 4:case"end":return e.stop()}}),e)})))()}),[]);var be=[{title:"姓名",width:100,ellipsis:!0,dataIndex:"name",render:function(e){return(0,_.jsx)(m.Z,{placement:"topLeft",title:e,children:(0,_.jsx)("span",{style:{color:"#000"},children:e||"--"})})}},{title:"学校/单位",dataIndex:"school",ellipsis:!0,render:function(e){return(0,_.jsx)(m.Z,{placement:"topLeft",title:e,children:(0,_.jsx)("span",{style:{color:"#000"},children:e||"--"})})}},{title:"院系/部门",dataIndex:"department",width:130,ellipsis:!0,render:function(e){return(0,_.jsx)(m.Z,{placement:"topLeft",title:e,children:(0,_.jsx)("span",{style:{color:"#000"},children:e||"--"})})}},{title:"学号/工号",width:100,dataIndex:"student_number",ellipsis:!0,render:function(e,t){return(0,_.jsx)(m.Z,{placement:"topLeft",title:t.staff_id||t.student_id,children:(0,_.jsx)("span",{className:"c-grey-666",children:t.staff_id||t.student_id||"--"})})}},{title:"手机",width:110,dataIndex:"phone",ellipsis:!0,render:function(e){return(0,_.jsx)(m.Z,{placement:"topLeft",title:e,children:(0,_.jsx)("span",{className:"c-grey-666",children:e||"--"})})}},{title:"邮箱",dataIndex:"mail",width:120,ellipsis:!0,render:function(e){return(0,_.jsx)(m.Z,{placement:"topLeft",title:e,children:(0,_.jsx)("span",{className:"c-grey-666",children:e||"--"})})}},{title:"实名认证",dataIndex:"authentication",width:80,render:function(e){return e?(0,_.jsx)("span",{style:{color:"#000"},children:"是"}):"否"}},{title:"最后登录时间",dataIndex:"last_login_on",width:140,ellipsis:!0,render:function(e){return(0,_.jsx)(m.Z,{placement:"topLeft",title:e,children:(0,_.jsx)("span",{className:"c-grey-666",children:k()(e).format("YYYY-MM-DD HH:mm")})})}},{title:"状态",dataIndex:"checked",width:80,render:function(e){return e?(0,_.jsx)("span",{className:"c-green",children:"已添加"}):(0,_.jsx)("span",{className:"c-grey-333",children:"未添加"})}}],je=function(){var e=u()(c()().mark((function e(t){var n,r,a;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ve.current&&(null===(n=ve.current)||void 0===n||null===(n=n.querySelector(".ant-table-body"))||void 0===n||n.scrollTo(0,0)),ge(!0),he([]),t.search||t.school){e.next=6;break}return y.ZP.warning("请输入搜索内容"),e.abrupt("return");case 6:if(B(!0),D(t),ue(1),a=s()({id:o.id},t),0!=le){e.next=14;break}return e.next=13,(0,C.l5)(a);case 13:r=e.sent;case 14:if(1!=le){e.next=18;break}return e.next=17,(0,C.bS)(a);case 17:r=e.sent;case 18:0==r.status&&(J(r.data),ne(r.count)),B(!1);case 20:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),we=function(){var e=u()(c()().mark((function e(){var t,n,r,l,i,u,d,p,f,h=arguments;return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h.length>0&&void 0!==h[0]&&h[0],l=null===(t=ve.current)||void 0===t?void 0:t.querySelector(".ant-table-body").scrollHeight,i=null===(n=ve.current)||void 0===n?void 0:n.querySelector(".ant-table-body").scrollTop,u=null===(r=ve.current)||void 0===r?void 0:r.querySelector(".ant-table-body").clientHeight,l!=i+u||!q||V){e.next=18;break}if(B(!0),ue(oe+1),p=s()({page:oe+1,id:o.id},P),0!=le){e.next=12;break}return e.next=11,(0,C.l5)(p);case 11:d=e.sent;case 12:if(1!=le){e.next=16;break}return e.next=15,(0,C.bS)(p);case 15:d=e.sent;case 16:0==d.status&&((null===(f=d)||void 0===f||null===(f=f.data)||void 0===f?void 0:f.length)+A.length==d.count&&M(!1),J([].concat(a()(A),a()(d.data))),ne(d.count)),B(!1);case 18:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Se={selectedRowKeys:fe,onChange:function(e,t){he(e)},getCheckboxProps:function(e){return{disabled:e.checked,name:e.checked}}};return(0,_.jsxs)(g.Z,{destroyOnClose:!0,width:1200,style:{height:"613px"},open:l,confirmLoading:K,title:i,bodyStyle:{padding:"0px 25px"},onOk:u()(c()().mark((function e(){return c()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(fe.length>0)){e.next=11;break}return G(!0),e.next=4,n(fe);case 4:G(!1),L.resetFields(),J([]),ge(!1),he([]),e.next=12;break;case 11:y.ZP.warning("请选择添加人员");case 12:case"end":return e.stop()}}),e)}))),onCancel:function(){t(),L.resetFields(),ge(!1),J([]),he([])},children:[(0,_.jsxs)(x.Z,{layout:"inline",className:"mt10",colon:!1,form:L,initialValues:{school:"",search:"",search_type:"name"},onValuesChange:function(e,t){return D(t)},size:"large",onFinish:je,children:[(0,_.jsx)(x.Z.Item,{name:"search_type",label:"搜索类型",children:(0,_.jsxs)(v.default,{style:{width:160},children:[(0,_.jsx)(v.default.Option,{value:"name",children:"姓名"}),(0,_.jsx)(v.default.Option,{value:"phone",children:"手机号"}),(0,_.jsx)(v.default.Option,{value:"mail",children:"邮箱"})]})}),(0,_.jsx)(x.Z.Item,{name:"search",label:"搜索内容",children:(0,_.jsx)(b.Z,{allowClear:!0,style:{width:320},placeholder:"请输入搜索内容",defaultValue:""})}),(0,_.jsx)(x.Z.Item,{name:"school",label:"单位",children:(0,_.jsx)(j.Z,{options:I,style:{width:380},placeholder:"请输入单位名称",onSelect:function(e,t){console.log(e,t),L.setFieldsValue({school:t.label})},filterOption:function(e,t){return-1!==t.label.toUpperCase().indexOf(e.toUpperCase())}})}),(0,_.jsx)(x.Z.Item,{noStyle:!0,children:(0,_.jsx)(O.op,{onClick:function(){return L.submit()},size:"large",shape:"default",children:"搜索"})})]}),(0,_.jsx)("div",{onScrollCapture:function(){return we()},children:ye?(0,_.jsx)(w.Z,{className:"mt20",loading:V,showHeader:A.length>0,scroll:te>10?{y:450}:{},rowKey:"user_id",rowSelection:Se,locale:{emptyText:(0,_.jsx)(Z.Z,{customText:"未找到符合条件的数据,请重新调整您的筛选条件。"})},pagination:!1,dataSource:A,ref:ve,columns:be}):(0,_.jsx)(Z.Z,{customText:"请搜索要添加的人员"})})]})}))},88522:function(e,t,n){var r=n(92310),a=n.n(r),l=n(75440),s=n(55405),i=n(59301),c=n(53487),o=n(92343),u=n(36355),d=n(57809);const{Option:p}=d.default;function f(e){return e&&e.type&&(e.type.isSelectOption||e.type.isSelectOptGroup)}const h=(e,t)=>{const{prefixCls:n,className:r,popupClassName:c,dropdownClassName:h,children:x,dataSource:m}=e,y=(0,l.Z)(x);let g;1===y.length&&(0,o.l$)(y[0])&&!f(y[0])&&([g]=y);const v=g?()=>g:void 0;let b;b=y.length&&f(y[0])?x:m?m.map((e=>{if((0,o.l$)(e))return e;switch(typeof e){case"string":return i.createElement(p,{key:e,value:e},e);case"object":{const{value:t}=e;return i.createElement(p,{key:t,value:t},e.text)}default:return}})):[];const{getPrefixCls:j}=i.useContext(u.E_),w=j("select",n);return i.createElement(d.default,Object.assign({ref:t,suffixIcon:null},(0,s.Z)(e,["dataSource","dropdownClassName"]),{prefixCls:w,popupClassName:c||h,className:a()(`${w}-auto-complete`,r),mode:d.default.SECRET_COMBOBOX_MODE_DO_NOT_USE},{getInputElement:v}),b)},x=i.forwardRef(h),m=(0,c.Z)(x);x.Option=p,x._InternalPanelDoNotUseOrYouWillBeFired=m,t.Z=x}}]);