|
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[11277],{67147:function(e,n,t){t.d(n,{Z:function(){return o}});var i=t(33614),a=t(59301),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},l=t(1393),s=function(e,n){return a.createElement(l.Z,(0,i.Z)({},e,{ref:n,icon:r}))};var o=a.forwardRef(s)},40684:function(e,n,t){var i=t(7557),a=t.n(i),r=t(41498),l=t.n(r),s=t(79800),o=t.n(s),c=t(39647),d=t.n(c),u=t(59301),h=t(32007),m=t(92832),f=t(78241),p=t(8591),x=t(43418),v=t(51945),j=t(85750),g=t(37712),y=["account","globalSetting","loading","dispatch","schoolName","departmentName","visible","onClose","onSuccess"],b=m.Z.TextArea;n.Z=(0,h.connect)((function(e){var n=e.account,t=e.loading;return{account:n,globalSetting:e.globalSetting,loading:t.effects}}))((function(e){e.account,e.globalSetting,e.loading;var n=e.dispatch,t=e.schoolName,i=e.departmentName,r=e.visible,s=e.onClose,c=void 0===s?function(){}:s,h=e.onSuccess,_=void 0===h?function(){}:h,Z=d()(e,y),k=f.Z.useForm(),w=o()(k,1)[0],I=(0,u.useRef)(),S=(0,u.useState)(!1),N=o()(S,2),C=N[0],F=N[1];(0,u.useEffect)((function(){I.current=Z.schoolId}),[Z.schoolId]),(0,u.useEffect)((function(){w.setFieldsValue({department:i})}),[i]);var V=function(){var e=l()(a()().mark((function e(t){var i,r,s,o,d,u,h,m;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=(i=t||{}).department,s=i.remarks,F(!0),e.next=4,(0,j.ZP)("/api/add_department_applies/inspect.json",{method:"get",params:{name:r,school_id:I.current}});case 4:if(o=e.sent,F(!1),d=function(){var e=l()(a()().mark((function e(){var t;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n({type:"account/appplyDepartment",payload:{school_id:I.current,name:r,remarks:s}});case 2:0===(null==(t=e.sent)?void 0:t.status)&&(p.ZP.success("新增院系/部门成功!"),_(r),c());case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),0!==(null==o?void 0:o.status)){e.next=12;break}if(null==o||null===(u=o.data)||void 0===u||!u.name){e.next=11;break}return x.Z.confirm({centered:!0,icon:null,width:500,okText:"确定",cancelText:"取消",title:"提示",content:(0,g.jsxs)("div",{children:[(0,g.jsx)("div",{className:"mb10",children:"系统检测到您申请新增的部门已存在,请确认是否为该部门?"}),(0,g.jsx)(v.Z,{rowKey:"name",columns:[{title:"院系/部门",dataIndex:"name"},{title:"用户数",dataIndex:"size"}],dataSource:[{name:null==o||null===(h=o.data)||void 0===h?void 0:h.name,size:null==o||null===(m=o.data)||void 0===m?void 0:m.size}],pagination:!1})]}),onOk:function(){_(r),c()}}),e.abrupt("return");case 11:d();case 12:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,g.jsx)(x.Z,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,open:r,title:"申请添加部门名称",width:"600px",onCancel:c,onOk:function(){return w.submit()},confirmLoading:C,children:(0,g.jsxs)(f.Z,{form:w,labelCol:{span:4},wrapperCol:{span:20},onFinish:V,children:[(0,g.jsx)(f.Z.Item,{label:"单位名称:",children:t}),(0,g.jsx)(f.Z.Item,{label:"部门名称:",name:"department",rules:[{required:!0,message:"请输入部门或者学院名称"}],children:(0,g.jsx)(m.Z,{placeholder:"请输入部门或者学院名称"})}),(0,g.jsx)(f.Z.Item,{label:"说明:",name:"remarks",style:{marginBottom:0},children:(0,g.jsx)(b,{placeholder:"再次说明特别情况(选填)"})})]})})}))},59015:function(e,n,t){t.d(n,{Z:function(){return c}});var i=t(79800),a=t.n(i),r=t(59301),l=t(53200),s=t(29502),o=t(37712),c=function(){var e=(0,r.useState)(""),n=a()(e,2),t=n[0],i=n[1],c=(0,r.useState)(0),d=a()(c,2),u=(d[0],d[1]),h=(0,r.useState)(),m=a()(h,2),f=(m[0],m[1]),p=(0,r.useState)(),x=a()(p,2),v=(x[0],x[1]),j=(0,r.useState)(!1),g=a()(j,2),y=(g[0],g[1],(0,r.useRef)(""));function b(e){27==e.keyCode&&y.current&&_()}function _(){document.body.style.overflow="auto",f(void 0),v(void 0),u(0),i("")}(0,r.useEffect)((function(){return l.Z.subscribe("preview-image",(function(e){i(e),console.log(k.current),document.body.style.overflow="hidden"}))}),[]),(0,r.useEffect)((function(){return document.addEventListener("keydown",b),function(){document.removeEventListener("keydown",b)}}),[]),(0,r.useEffect)((function(){y.current=t}),[t]);(0,r.useRef)();var Z=(0,r.useRef)(),k=(0,r.useRef)();return(0,o.jsx)(r.Fragment,{children:t?(0,o.jsx)("div",{children:(0,o.jsx)("div",{className:"preview-wrp-group",ref:Z,children:(0,o.jsx)(s.Z,{className:"image-preview",src:t,style:{display:"none"},preview:{visible:!0,src:t,movable:!1,onVisibleChange:function(e){i("")}},alt:"预览大图"})})}):null})}},11277:function(e,n,t){t.r(n),t.d(n,{default:function(){return le},identityMap:function(){return re}});var i=t(37205),a=t.n(i),r=t(7557),l=t.n(r),s=t(82242),o=t.n(s),c=t(41498),d=t.n(c),u=t(79800),h=t.n(u),m=t(39647),f=t.n(m),p=t(59301),x=t(32007),v=t(57809),j=t(92832),g=t(78241),y=t(8591),b=t(43418),_=t(95237),Z=t(43604),k=t(6848),w=t(88522),I=t(5112),S=t(53326),N=t(3113),C="wrap___UcHlM",F="content___G5KsE",V="hint___WWGVB",A="formWrap___PlK4W",T="schoolHintWrap___BVdvA",P="colorCDCDCD___gbgqi",q="color0152d9___R6uW1",E="submitButton___dSqFa",z="submitButtondiv___qx6r5",L="staffidInput___qFhii",R=t(20453),B=t(40684),O=t(32637),Q=t(66621),H=t(13868),D=t(42857),G=t(67147),M=t(59015),W=t(53200),K=t(85750),U=t(89392),Y=t(29831),J=t(75694),X=t(76391),$=t(20817),ee=t(84783),ne=t(37712),te=["user","account","globalSetting","shixunHomeworks","loading","dispatch"],ie=v.default.Option,ae=j.Z.TextArea,re={teacher:"教师",student:"学生",professional:"专业人士"},le=(0,x.connect)((function(e){var n=e.user,t=e.account,i=e.loading,a=e.globalSetting,r=e.shixunHomeworks;return{user:n,account:t,globalSetting:a,loading:i.effects,shixunHomeworks:r}}))((function(e){var n,t,i,r,s,c=e.user,u=e.account,m=(e.globalSetting,e.shixunHomeworks),re=e.loading,le=e.dispatch,se=(f()(e,te),g.Z.useForm()),oe=h()(se,1)[0],ce=g.Z.useForm(),de=h()(ce,1)[0],ue=(0,p.useState)({}),he=h()(ue,2),me=he[0],fe=he[1],pe=(0,p.useState)(!1),xe=h()(pe,2),ve=xe[0],je=xe[1],ge=(0,p.useState)({}),ye=h()(ge,2),be=ye[0],_e=ye[1],Ze=(0,p.useState)([]),ke=h()(Ze,2),we=ke[0],Ie=ke[1],Se=(0,p.useState)([]),Ne=h()(Se,2),Ce=Ne[0],Fe=Ne[1],Ve=(0,p.useState)([]),Ae=h()(Ve,2),Te=Ae[0],Pe=Ae[1],qe=(0,p.useState)([]),Ee=h()(qe,2),ze=Ee[0],Le=Ee[1],Re=(0,p.useState)([]),Be=h()(Re,2),Oe=Be[0],Qe=Be[1],He=(0,p.useState)([]),De=h()(He,2),Ge=De[0],Me=De[1],We=(0,p.useState)(!0),Ke=h()(We,2),Ue=Ke[0],Ye=Ke[1],Je=(0,p.useState)(!1),Xe=h()(Je,2),$e=Xe[0],en=Xe[1],nn=(0,p.useState)(),tn=h()(nn,2),an=tn[0],rn=tn[1],ln=(0,p.useState)(null),sn=h()(ln,2),on=sn[0],cn=sn[1],dn=(0,p.useState)(!0),un=h()(dn,2),hn=un[0],mn=un[1],fn=(0,p.useState)(),pn=h()(fn,2),xn=(pn[0],pn[1],(0,p.useState)(!1)),vn=h()(xn,2),jn=vn[0],gn=(vn[1],(0,p.useState)([])),yn=h()(gn,2),bn=yn[0],_n=yn[1],Zn=(0,p.useState)(!0),kn=h()(Zn,2),wn=kn[0],In=kn[1],Sn=!0,Nn=(0,p.useState)(""),Cn=h()(Nn,2),Fn=Cn[0],Vn=Cn[1],An=(0,p.useState)(""),Tn=h()(An,2),Pn=Tn[0],qn=Tn[1],En=(0,p.useState)(""),zn=h()(En,2),Ln=zn[0],Rn=zn[1],Bn=(0,p.useRef)((0,U.throttle)((function(e){return Mn(e)}),1200,{leading:!0,trailing:!0})).current,On=u.basicInfo,Qn=void 0===On?{}:On,Hn=Qn&&"certified"==Qn.professional_certification,Dn={visible:!1},Gn=(0,p.useRef)();(0,p.useEffect)((function(){var e;Gn.current=null===(e=location.pathname.split("/"))||void 0===e?void 0:e[2]}),[location.pathname]),(0,p.useEffect)((function(){var e,n;null!==(e=u.basicInfo)&&void 0!==e&&e.school_name&&Mn(null===(n=u.basicInfo)||void 0===n?void 0:n.school_name)}),[null===(n=u.basicInfo)||void 0===n?void 0:n.school_name]),(0,p.useEffect)((function(){wn&&(oe.setFieldsValue({studentNo:be.studentNo}),oe.validateFields(["studentNo"]))}),[be.studentNo]),(0,p.useEffect)((function(){hn||!be.school||we.find((function(e){return e.name===be.school}))?Vn(""):Vn("error")}),[hn,be.school,we]),(0,p.useEffect)((function(){hn||!be.department||Te.find((function(e){return e.name===be.department}))?qn(""):qn("error")}),[hn,be.department,Te]),(0,p.useEffect)((function(){!hn&&be.major_name&&(null==Oe?void 0:Oe.length)>0&&!Oe.find((function(e){return e.name===be.major_name}))&&Rn("error")}),[hn,be.major_name,Oe]);var Mn=function(){var e=d()(l()().mark((function e(n){var t,i,a;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return mn(!0),e.next=3,le({type:"account/getSchoolOption",payload:{keyword:n,limit:10}});case 3:if(t=e.sent,Ie(null==t?void 0:t.schools),!n||""==n){e.next=23;break}if(Fe(null==t||null===(i=t.schools)||void 0===i?void 0:i.filter((function(e){return e.name.includes(n)}))),!((null==t||null===(a=t.schools)||void 0===a?void 0:a.find((function(e){return e.name===n})))||{}).id){e.next=13;break}return e.next=11,Yn(n,null==Qn?void 0:Qn.department_name,null==t?void 0:t.schools);case 11:e.next=21;break;case 13:oe.setFieldsValue({department:"",major_name:""}),_e(o()(o()({},oe.getFieldValue()),{school:n,department:"",major_name:""})),Pe([]),Le([]),Qe([]),Me([]),qn(""),Rn("");case 21:e.next=31;break;case 23:oe.setFieldsValue({department:"",major_name:""}),_e(o()(o()({},oe.getFieldValue()),{department:"",major_name:""})),Pe([]),Le([]),Qe([]),Me([]),qn(""),Rn("");case 31:mn(!1);case 32:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),Wn=function(e){if(e)return le({type:"account/getDepartmentOption",payload:{id:e}})};(0,p.useEffect)((function(){if(u.basicInfo){var e,n,t,i=u.basicInfo,a={nickname:i.nickname,name:i.show_realname?i.name:(0,Q.YA)(i.name),gender:i.gender,city:[i.location,i.location_city],identity:i.identity,school:i.school_name,department:i.department_name,major_name:i.major_name,studentNo:i.student_id,edu_entry_year:i.edu_entry_year,edu_background:(e=i.edu_background,null===Q.jh||void 0===Q.jh||null===(n=Q.jh.find((function(n){return n.name===e})))||void 0===n?void 0:n.id),brief_introduction:i.brief_introduction,jobTitle:"teacher"==i.identity?i.technical_title:"教授",manager:"professional"==i.identity?i.technical_title:"企业管理者",staff_id:i.staff_id};if(null!=i&&i.face_image)_n([{uid:"111",name:"111",url:$.Z.API_SERVER+i.face_image,response:{id:null==i||null===(t=i.face_image)||void 0===t||null===(t=t.split("/"))||void 0===t?void 0:t[3]}}]);rn(i.name),Ye(i.show_realname),cn(i.identity),oe.setFieldsValue(a),_e(a)}}),[u.basicInfo]);var Kn,Un,Yn=function(){var e=d()(l()().mark((function e(n,t,i){var r,s,c,d,u;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=null===(r=(i||we).find((function(e){return e.name===n})))||void 0===r?void 0:r.id,e.next=3,Wn(c);case 3:if(e.t0=e.sent,e.t0){e.next=6;break}e.t0={};case 6:d=e.t0,u=Sn?t:null==d||null===(s=d.departments[0])||void 0===s?void 0:s.name,oe.setFieldsValue({department:u}),_e(o()(o()({},oe.getFieldsValue()),{school:n,department:u})),Pe(a()(null==d?void 0:d.departments)),Le(a()(null==d?void 0:d.departments)),Rn(""),Jn(Sn,a()(null==d?void 0:d.departments),i);case 14:case"end":return e.stop()}}),e)})));return function(n,t,i){return e.apply(this,arguments)}}(),Jn=function(){var e=d()(l()().mark((function e(){var n,t,i,r,s,c,d,u,h,m,f=arguments;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=f.length>0&&void 0!==f[0]&&f[0],r=f.length>1?f[1]:void 0,s=f.length>2?f[2]:void 0,console.log(oe.getFieldsValue()),console.log(be),console.log(we),Sn=!1,c=null===(n=s.find((function(e){return e.name===oe.getFieldValue("school")})))||void 0===n?void 0:n.id,!(d=null===(t=r.find((function(e){return e.name===oe.getFieldValue("department")})))||void 0===t?void 0:t.id)){e.next=14;break}return e.next=12,(0,K.ZP)("/api/schools/".concat(c,"/departments/").concat(d,"/major_option.json"),{method:"get"});case 12:0==(null==(u=e.sent)?void 0:u.status)&&(Qe(a()(null==u?void 0:u.majors)),Me(a()(null==u?void 0:u.majors)),m=i?null==Qn?void 0:Qn.major_name:null==u||null===(h=u.majors[0])||void 0===h?void 0:h.name,oe.setFieldsValue({major_name:m}),_e(o()(o()({},oe.getFieldsValue()),{major_name:m})));case 14:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Xn=function(){var e=d()(l()().mark((function e(){var n,t,i,r,s,c,d;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=null===(n=we.find((function(e){return e.name===oe.getFieldValue("school")})))||void 0===n?void 0:n.id,!(r=null===(t=Te.find((function(e){return e.name===oe.getFieldValue("department")})))||void 0===t?void 0:t.id)){e.next=7;break}return e.next=5,(0,K.ZP)("/api/schools/".concat(i,"/departments/").concat(r,"/major_option.json"),{method:"get"});case 5:0==(null==(s=e.sent)?void 0:s.status)&&(Qe(null==s?void 0:s.majors),Me(a()(null==s?void 0:s.majors)),d=null==s||null===(c=s.majors)||void 0===c||null===(c=c[0])||void 0===c?void 0:c.name,oe.setFieldsValue({major_name:d}),_e(o()(o()({},oe.getFieldsValue()),{major_name:d})));case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),$n=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,Mn();case 2:oe.setFieldsValue({school:n,department:""}),_e(o()(o()({},be),{school:n,department:""}));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),et=function(){var e=d()(l()().mark((function e(n){var t,i,a,r,s,o,h,m,f,p,v,j,g,_,Z,k,w,I,S,N,C,F,V,A,T,P,q;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.nickname,s=n.gender,o=n.identity,h=n.studentNo,m=n.jobTitle,f=n.manager,p=n.school,v=n.department,j=n.edu_background,g=n.edu_entry_year,_=n.brief_introduction,n.face_image,Z=n.staff_id,k=n.major_name,w=null===(t=Te.find((function(e){return e.name===v})))||void 0===t?void 0:t.id,I=null===(i=we.find((function(e){return e.name===p})))||void 0===i?void 0:i.id,S=null===(a=Oe.find((function(e){return e.name===k})))||void 0===a?void 0:a.id,N=u.basicInfo,console.log("B",n,N),C=[],"uncertified"!=N.authentication&&(an!=N.name&&C.push("姓名"),s!=N.gender&&C.push("性别")),F=[],Hn&&(o!=N.identity?F.push("职业"):(be.identity,"teacher"===be.identity&&m!=N.technical_title&&F.push("职业"),"professional"===be.identity&&f!=N.technical_title&&F.push("职业")),p!=N.school_name&&F.push("学校/单位"),v!=N.department_name&&F.push("院系/部门"),k!=N.major_name&&F.push("专业")),I){e.next=13;break}return b.Z.info({title:"联系平台运营",width:400,icon:null,centered:!0,content:(0,ne.jsxs)("div",{style:{textAlign:"center"},children:[(0,ne.jsxs)("div",{style:{textAlign:"left"},children:["请扫码或搜索加入头歌官方交流QQ群:","teacher"===be.identity?"727685969":"816055138",",联系群内的运营进行咨询和申请新增学校名称。"]}),(0,ne.jsx)("img",{src:"teacher"===be.identity?Y:J,style:{width:"170px",height:"170px",marginTop:"20px"}})]}),okText:"我知道了"}),e.abrupt("return");case 13:if(!v||w){e.next=16;break}return b.Z.info({title:"联系平台运营",width:400,icon:null,centered:!0,content:(0,ne.jsxs)("div",{style:{textAlign:"center"},children:[(0,ne.jsxs)("div",{style:{textAlign:"left"},children:["请扫码或搜索加入头歌官方交流QQ群:","teacher"===be.identity?"727685969":"816055138",",联系群内的运营人员申请新增部门或专业名称。"]}),(0,ne.jsx)("img",{src:"teacher"===be.identity?Y:J,style:{width:"170px",height:"170px",marginTop:"20px"}})]}),okText:"我知道了"}),e.abrupt("return");case 16:if(!k||S){e.next=19;break}return b.Z.info({title:"联系平台运营",width:400,icon:null,centered:!0,content:(0,ne.jsxs)("div",{style:{textAlign:"center"},children:[(0,ne.jsxs)("div",{style:{textAlign:"left"},children:["请扫码或搜索加入头歌官方交流QQ群:","teacher"===be.identity?"727685969":"816055138",",联系群内的运营人员申请新增部门或专业名称。"]}),(0,ne.jsx)("img",{src:"teacher"===be.identity?Y:J,style:{width:"170px",height:"170px",marginTop:"20px"}})]}),okText:"我知道了"}),e.abrupt("return");case 19:if(!(C.length>0||F.length>0)){e.next=23;break}b.Z.confirm({centered:!0,icon:null,okText:"确定",cancelText:"取消",title:"提示",content:(0,ne.jsx)("div",{children:"本次修改涉及".concat(C.toString().replaceAll(",","、")).concat(C.length>0&&F.length>0?"、":"").concat(F.toString().replaceAll(",","、"),",需要重新进行").concat(C.length>0?"实名认证":"").concat(C.length>0&&F.length>0?"和":"").concat(F.length>0?"职业认证":"",",请确认是否进行修改")}),onOk:function(){var e=d()(l()().mark((function e(){var n,t,i,a,d,p,v;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(C.length>0)){e.next=3;break}return e.next=3,(0,H.RA)({login:null===(i=c.userInfo)||void 0===i?void 0:i.login});case 3:if(!(F.length>0)){e.next=6;break}return e.next=6,(0,H.kN)({login:null===(a=c.userInfo)||void 0===a?void 0:a.login});case 6:return e.next=8,le({type:"account/updateAccount",payload:{id:null===(n=u.basicInfo)||void 0===n?void 0:n.id,department_id:w,major_id:S,gender:s,identity:o,location:location,name:an,nickname:r,school_id:I,edu_background:j,edu_entry_year:g,show_realname:Ue,brief_introduction:_,student_id:"student"===o?h:null,technical_title:m||f,face_image:null==bn||null===(t=bn[0])||void 0===t||null===(t=t.response)||void 0===t?void 0:t.id}});case 8:if(-1!==(null==(d=e.sent)?void 0:d.status)){e.next=11;break}return e.abrupt("return");case 11:if(!d){e.next=20;break}if(y.ZP.info("保存成功"),null!==(p=u.basicInfo)&&void 0!==p&&p.base_info_completed||le({type:"user/getUserInfo"}),le({type:"account/getBasicInfo",payload:{login:null===(v=c.userInfo)||void 0===v?void 0:v.login}}),o===on||"teacher"!==o){e.next=18;break}return en(!0),e.abrupt("return");case 18:"0"===localStorage.getItem("Noviceguide")||le({type:"shixunHomeworks/setActionTabs",payload:{key:"底部弹窗",type:4,href:"/classrooms",text:(0,ne.jsx)("div",{children:"OK,接下来,让我们开始新建【教学课堂】,请您找到闪光框并点击 “教学课堂”。"})}}),x.history.push("/users/".concat(Gn.current,"/baseInfo"));case 20:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}),e.next=37;break;case 23:return e.next=25,le({type:"account/updateAccount",payload:{id:null===(V=u.basicInfo)||void 0===V?void 0:V.id,department_id:w,major_id:S,gender:s,identity:o,location:location,name:an,nickname:r,school_id:I,edu_background:j,edu_entry_year:g,staff_id:Z,show_realname:Ue,brief_introduction:_,student_id:"student"===o?h:null,technical_title:m||f,face_image:null==bn||null===(A=bn[0])||void 0===A||null===(A=A.response)||void 0===A?void 0:A.id}});case 25:if(-1!==(null==(T=e.sent)?void 0:T.status)){e.next=28;break}return e.abrupt("return");case 28:if(!T){e.next=37;break}if(y.ZP.info("保存成功"),null!==(P=u.basicInfo)&&void 0!==P&&P.base_info_completed||le({type:"user/getUserInfo"}),le({type:"account/getBasicInfo",payload:{login:null===(q=c.userInfo)||void 0===q?void 0:q.login}}),o===on||"teacher"!==o){e.next=35;break}return en(!0),e.abrupt("return");case 35:"0"===localStorage.getItem("Noviceguide")||le({type:"shixunHomeworks/setActionTabs",payload:{key:"底部弹窗",type:4,href:"/classrooms",text:(0,ne.jsx)("div",{children:"OK,接下来,让我们开始新建【教学课堂】,请您找到闪光框并点击 “教学课堂”。"})}}),x.history.push("/users/".concat(Gn.current,"/baseInfo"));case 37:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),nt=(0,ne.jsxs)("div",{children:[jn?(0,ne.jsx)(D.Z,{}):(0,ne.jsx)(G.Z,{}),(0,ne.jsx)("div",{style:{marginTop:8},children:"上传"})]});return(0,ne.jsxs)("section",{className:C,children:[(0,ne.jsx)(X.Z,{active:1}),(0,ne.jsx)("div",{className:F,children:(0,ne.jsxs)(g.Z,{form:oe,className:A,layout:"horizontal",onValuesChange:function(e){var n;_e(o()({},oe.getFieldsValue())),(null==e||null===(n=e.nickname)||void 0===n?void 0:n.length)<=0&&(Ye(!0),oe.setFieldsValue({name:an})),"name"in e&&rn(e.name),"identity"in e&&oe.setFieldsValue({staff_id:""})},onFinish:et,scrollToFirstError:!0,children:[(0,ne.jsx)(g.Z.Item,{label:"姓名",name:"name",rules:[{required:!0,message:"请输入真实姓名,最大限制".concat(20,"个字符")},{validator:Q.HJ}],extra:(0,ne.jsx)("span",{children:be.nickname?Ue?"显示:平台将显示您的真实姓名":"隐藏:平台将显示你的昵称":"填写昵称后可设置姓名进行隐藏(当进行姓名搜索时,会展示您的真实姓名)"}),children:(0,ne.jsx)(j.Z,{style:{height:40},disabled:!!be.nickname&&!Ue,placeholder:"请输入真实姓名,最大限制".concat(20,"个字符"),maxLength:20,suffix:be.nickname?(0,ne.jsx)("i",{style:{lineHeight:"26px"},className:"iconfont ".concat(Ue?"icon-xianshi":"icon-yincang"," font18 ").concat(q),onClick:function(){var e=!Ue;Ye(e);var n=e?an:(0,Q.YA)(an);oe.setFieldsValue({name:n})}}):null})}),(0,ne.jsxs)(_.Z,{gutter:[10,0],children:[(0,ne.jsx)(Z.Z,{children:(0,ne.jsx)(k.Z,o()(o()({placement:"bottom",title:function(){return(0,ne.jsxs)("div",{children:[(0,ne.jsx)("div",{children:"已提交职业认证"}),(0,ne.jsxs)("div",{children:["可在",(0,ne.jsx)("a",{href:"/account/certification",className:"c-blue",children:"认证信息"}),"中通过“重新认证”进行修改"]})]})}},Dn),{},{children:(0,ne.jsx)(g.Z.Item,{label:"职业",name:"identity",rules:[{required:!0,message:"请先选择职业"}],children:(0,ne.jsxs)(v.default,{style:{width:135},size:"large",children:[(0,ne.jsx)(ie,{value:"teacher",children:"教师"}),(0,ne.jsx)(ie,{value:"student",children:"学生"}),(0,ne.jsx)(ie,{value:"professional",children:"专业人士"})]})})}))}),(0,ne.jsxs)(Z.Z,{children:["student"===be.identity&&(0,ne.jsx)(k.Z,o()(o()({placement:"bottom",title:function(){return(0,ne.jsxs)("div",{children:[(0,ne.jsx)("div",{children:"已提交职业认证"}),(0,ne.jsxs)("div",{children:["可在",(0,ne.jsx)("a",{href:"/account/certification",className:"c-blue",children:"认证信息"}),"中通过“重新认证”进行修改"]})]})}},Dn),{},{children:(0,ne.jsx)(g.Z.Item,{initialValue:be.studentNo,name:"studentNo",validateTrigger:"onBlur",rules:[{whitespace:!0,message:"不能全为空"},{required:!0,validator:(Un=d()(l()().mark((function e(n,t){var i,a,r;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return In(!1),e.next=3,(0,K.ZP)("/api/users/accounts/".concat(null==c||null===(i=c.userInfo)||void 0===i?void 0:i.user_id,"/valid_student_id"),{method:"get",params:{school_id:(null==Qn?void 0:Qn.school_id)||(null==we||null===(a=we.find((function(e){return e.name===be.school})))||void 0===a?void 0:a.id),student_id:t}});case 3:return r=e.sent,e.abrupt("return",(null==r?void 0:r.status)<-1?Promise.reject((0,ne.jsxs)("span",{children:["该学号已被使用,如需继续使用该学号,请先",(0,ne.jsx)("a",{onClick:function(){je(!0),fe({check_type:1})},children:"解绑学号"})]})):Promise.resolve());case 5:case"end":return e.stop()}}),e)}))),function(e,n){return Un.apply(this,arguments)})}],children:(0,ne.jsx)(j.Z,{size:"large",style:{width:200},type:"text",placeholder:"请输入学号,最大限制20个字符",showCount:!0,maxLength:20})})})),"teacher"===be.identity&&(0,ne.jsx)(k.Z,o()(o()({placement:"bottom",title:function(){return(0,ne.jsxs)("div",{children:[(0,ne.jsx)("div",{children:"已提交职业认证"}),(0,ne.jsxs)("div",{children:["可在",(0,ne.jsx)("a",{href:"/account/certification",className:"c-blue",children:"认证信息"}),"中通过“重新认证”进行修改"]})]})}},Dn),{},{children:(0,ne.jsx)(g.Z.Item,{initialValue:be.jobTitle,name:"jobTitle",rules:[{required:!0,message:"请先选择职称"}],children:(0,ne.jsxs)(v.default,{style:{width:200},size:"large",children:[(0,ne.jsx)(ie,{value:"教授",children:"教授"}),(0,ne.jsx)(ie,{value:"研究员",children:"研究员"}),(0,ne.jsx)(ie,{value:"副教授",children:"副教授"}),(0,ne.jsx)(ie,{value:"副研究员",children:"副研究员"}),(0,ne.jsx)(ie,{value:"讲师",children:"讲师"}),(0,ne.jsx)(ie,{value:"助理研究员",children:"助理研究员"}),(0,ne.jsx)(ie,{value:"助理教授",children:"助理教授"})]})})})),"professional"===be.identity&&(0,ne.jsx)(k.Z,o()(o()({placement:"bottom",title:function(){return(0,ne.jsxs)("div",{children:[(0,ne.jsx)("div",{children:"已提交职业认证"}),(0,ne.jsxs)("div",{children:["可在",(0,ne.jsx)("a",{href:"/account/certification",className:"c-blue",children:"认证信息"}),"中通过“重新认证”进行修改"]})]})}},Dn),{},{children:(0,ne.jsx)(g.Z.Item,{initialValue:be.manager,name:"manager",rules:[{required:!0,message:"请先选择职称"}],children:(0,ne.jsxs)(v.default,{style:{width:200},size:"large",children:[(0,ne.jsx)(ie,{value:"企业管理者",children:"企业管理者"}),(0,ne.jsx)(ie,{value:"部门管理者",children:"部门管理者"}),(0,ne.jsx)(ie,{value:"高级工程师",children:"高级工程师"}),(0,ne.jsx)(ie,{value:"工程师",children:"工程师"}),(0,ne.jsx)(ie,{value:"助理工程师",children:"助理工程师"})]})})}))]}),("teacher"===be.identity||"professional"===be.identity)&&(0,ne.jsx)(Z.Z,{flex:1,children:(0,ne.jsx)(g.Z.Item,{label:"工号",name:"staff_id",labelCol:{span:4},rules:[{validator:function(e,n){return/[\u4E00-\u9FA5]/g.test(n)?Promise.reject("请勿输入中文字符"):n.length>20?Promise.reject("最大限制20个字符"):Promise.resolve()}}],children:(0,ne.jsx)(j.Z,{className:L,suffix:" ",showCount:!0,maxLength:20,placeholder:"请输入工号,最大限制20个字符"})})})]}),(0,ne.jsx)(k.Z,o()(o()({placement:"bottom",title:function(){return(0,ne.jsxs)("div",{children:[(0,ne.jsx)("div",{children:"已提交职业认证"}),(0,ne.jsxs)("div",{children:["可在",(0,ne.jsx)("a",{href:"/account/certification",className:"c-blue",children:"认证信息"}),"中通过“重新认证”进行修改"]})]})}},Dn),{},{children:(0,ne.jsx)(g.Z.Item,{label:"学校/单位",name:"school",wrapperCol:{span:10},extra:!hn&&be.school&&!(null!=we&&we.find((function(e){return e.name===be.school})))&&(0,ne.jsx)("div",{className:T,children:(0,ne.jsxs)("span",{className:P,children:["未找到包含“",be.school,"”的高校,如有需要,请",(0,ne.jsx)("span",{style:{color:"blue",cursor:"pointer"},onClick:function(){b.Z.info({title:"联系平台运营",width:400,icon:null,centered:!0,content:(0,ne.jsxs)("div",{style:{textAlign:"center"},children:[(0,ne.jsxs)("div",{style:{textAlign:"left"},children:["请扫码或搜索加入头歌官方交流QQ群:","teacher"===be.identity?"727685969":"816055138",",联系群内的运营进行咨询和申请新增学校名称。"]}),(0,ne.jsx)("img",{src:"teacher"===be.identity?Y:J,style:{width:"170px",height:"170px",marginTop:"20px"}})]}),okText:"我知道了"})},children:"联系平台运营"}),"申请新增"]})}),rules:[{required:!0,message:"请先选择学校/单位"},{whitespace:!0,message:"请先选择学校/单位"}],children:(0,ne.jsx)(w.Z,{status:Fn,size:"large",showSearch:!0,onChange:Bn,children:Ce.map((function(e,n){return(0,ne.jsx)(ie,{value:e.name,children:e.name},n)}))})})})),(0,ne.jsx)(k.Z,o()(o()({placement:"bottom",title:function(){return(0,ne.jsxs)("div",{children:[(0,ne.jsx)("div",{children:"已提交职业认证"}),(0,ne.jsxs)("div",{children:["可在",(0,ne.jsx)("a",{href:"/account/certification",className:"c-blue",children:"认证信息"}),"中通过“重新认证”进行修改"]})]})}},Dn),{},{children:(0,ne.jsx)(g.Z.Item,{label:"院系/部门",name:"department",wrapperCol:{span:10},extra:!hn&&be.department&&!(null!=Te&&Te.find((function(e){return e.name===be.department})))&&(0,ne.jsxs)("div",{className:T,children:[(0,ne.jsx)("span",{className:P,children:be.department?"未找到包含“".concat(be.department,"”的高校,"):"未找到院系,"}),(0,ne.jsxs)("span",{className:P,children:["如有需要,请",(0,ne.jsx)("span",{style:{color:"blue",cursor:"pointer"},onClick:function(){b.Z.info({title:"联系平台运营",width:400,icon:null,centered:!0,content:(0,ne.jsxs)("div",{style:{textAlign:"center"},children:[(0,ne.jsxs)("div",{style:{textAlign:"left"},children:["请扫码或搜索加入头歌官方交流QQ群:","teacher"===be.identity?"727685969":"816055138",",联系群内的运营人员申请新增部门或专业名称。"]}),(0,ne.jsx)("img",{src:"teacher"===be.identity?Y:J,style:{width:"170px",height:"170px",marginTop:"20px"}})]}),okText:"我知道了"})},children:"联系平台运营"}),"申请新增"]})]}),children:(0,ne.jsx)(w.Z,{status:Pn,size:"large",onChange:function(e){""==e&&(oe.setFieldsValue({major_name:""}),_e(o()(o()({},oe.getFieldsValue()),{major_name:""})),Qe([]),Me([]),Rn("")),Xn(),Le(Te.filter((function(n){return n.name.includes(e)})))},children:ze.map((function(e,n){return(0,ne.jsxs)(ie,{value:e.name,children:[e.name,0==(null==e?void 0:e.status)&&(0,ne.jsx)("span",{style:{color:"#FF8C29",marginLeft:"5px"},children:"(待审核)"})]},n)}))})})})),(0,ne.jsx)(k.Z,o()(o()({placement:"bottom",title:function(){return(0,ne.jsxs)("div",{children:[(0,ne.jsx)("div",{children:"已提交职业认证"}),(0,ne.jsxs)("div",{children:["可在",(0,ne.jsx)("a",{href:"/account/certification",className:"c-blue",children:"认证信息"}),"中通过“重新认证”进行修改"]})]})}},Dn),{},{children:(0,ne.jsx)(g.Z.Item,{label:"专业",name:"major_name",wrapperCol:{span:10},extra:"error"===Ln&&(0,ne.jsx)("div",{className:T,children:(0,ne.jsxs)("span",{className:P,children:["未找到“",be.major_name,"”专业,如有需要,请",(0,ne.jsx)("span",{style:{color:"blue",cursor:"pointer"},onClick:function(){b.Z.info({title:"联系平台运营",width:400,icon:null,centered:!0,content:(0,ne.jsxs)("div",{style:{textAlign:"center"},children:[(0,ne.jsxs)("div",{style:{textAlign:"left"},children:["请扫码或搜索加入头歌官方交流QQ群:","teacher"===be.identity?"727685969":"816055138",",联系群内的运营人员申请新增部门或专业名称。"]}),(0,ne.jsx)("img",{src:"teacher"===be.identity?Y:J,style:{width:"170px",height:"170px",marginTop:"20px"}})]}),okText:"我知道了"})},children:"联系平台运营"}),"申请新增"]})}),children:(0,ne.jsx)(w.Z,{status:Ln,size:"large",onChange:function(e){Me(Oe.filter((function(n){return n.name.includes(e)}))),e&&0==(null==Oe?void 0:Oe.length)?Rn("error"):""!=e||Rn("")},children:Ge.map((function(e,n){return(0,ne.jsxs)(ie,{value:e.name,children:[e.name,0==(null==e?void 0:e.status)&&(0,ne.jsx)("span",{style:{color:"#FF8C29",marginLeft:"5px"},children:"(待审核)"})]},n)}))})})})),(0,ne.jsx)(g.Z.Item,{label:"昵称",name:"nickname",rules:[{message:"请输入您的昵称"},{validator:Q.G7}],validateTrigger:"onSubmit",children:(0,ne.jsx)(j.Z,{style:{height:40},placeholder:"请输入您的昵称,最大限制".concat(20,"个字符"),maxLength:20,suffix:"".concat((null===(t=be.nickname)||void 0===t?void 0:t.length)||0,"/").concat(20)})}),(0,ne.jsx)(g.Z.Item,{labelCol:{span:3},wrapperCol:{span:4},label:"性别",className:"mb0",children:(0,ne.jsx)(g.Z.Item,{name:"gender",children:(0,ne.jsxs)(I.ZP.Group,{children:[(0,ne.jsx)(I.ZP,{value:0,children:"男"}),(0,ne.jsx)(I.ZP,{value:1,children:"女"})]})})}),(0,ne.jsx)(g.Z.Item,{label:"入学年份",name:"edu_entry_year",wrapperCol:{span:10},children:(0,ne.jsx)(v.default,{placeholder:"请选择入学年份",size:"large",children:(Kn=(new Date).getFullYear(),Array(31).fill({}).map((function(e,n){return(0,ne.jsx)(ie,{value:Kn-n,children:(0,ne.jsx)("span",{children:Kn-n})},n)})))})}),(0,ne.jsx)(g.Z.Item,{label:"最高学历",wrapperCol:{span:10},name:"edu_background",children:(0,ne.jsx)(v.default,{placeholder:"请选择最高学历",size:"large",children:Q.jh.map((function(e,n){return(0,ne.jsx)(ie,{value:e.id,children:e.name},n)}))})}),(0,ne.jsxs)("div",{style:{display:"flex"},children:[(0,ne.jsx)(g.Z.Item,{label:"上传证件照",wrapperCol:{span:10},name:"face_image",children:(0,ne.jsx)(S.Z,{listType:"picture-card",withCredentials:!0,className:"avatar-uploader",fileList:bn,onPreview:function(e){W.Z.publish("preview-image",e.thumbUrl||e.url)},action:"".concat($.Z.API_SERVER,"/api/attachments.json"),beforeUpload:function(e){var n="image/jpeg"===e.type||"image/png"===e.type;if(!n)return y.ZP.error("您上传的不是JPG/PNG类型文件"),Promise.reject();var t=e.size/1024/1024<1;return t?n&&t:(y.ZP.error("文件不能大于1MB"),Promise.reject())},onChange:function(e){_n(a()(e.fileList))},children:(null==bn?void 0:bn.length)>0?null:nt})}),(0,ne.jsxs)("div",{style:{marginLeft:16,color:"#666666",display:"flex",flexDirection:"column",marginTop:5},children:[(0,ne.jsx)("span",{children:"要求:"}),(0,ne.jsx)("span",{children:"1.学生照片必须为高清的人脸照"}),(0,ne.jsx)("span",{children:"2.按照 姓名-学号 的方式来命名照片"}),(0,ne.jsx)("span",{children:"3.图片大小在1MB以内"})]})]}),(0,ne.jsxs)("div",{style:{position:"relative"},children:[(0,ne.jsx)(g.Z.Item,{label:"简介",name:"brief_introduction",rules:[{required:!1}],children:(0,ne.jsx)(ae,{maxLength:500,rows:6})}),(0,ne.jsxs)("div",{style:{position:"absolute",bottom:10,right:10},children:[null===(i=oe.getFieldValue("brief_introduction"))||void 0===i?void 0:i.length,"/500"]})]}),(0,ne.jsxs)(g.Z.Item,{children:[(0,ne.jsx)(N.ZP,{className:"".concat(2===m.actionTabs.type?z:E," ml100"),size:"middle",type:"primary",htmlType:"submit",loading:re["account/updateAccount"],children:"保存"}),(0,ne.jsx)(N.ZP,{className:E,size:"middle",onClick:function(){return x.history.push("/users/".concat(Gn.current,"/baseInfo"))},children:"取消"})]})]})}),(0,ne.jsx)("div",{className:"".concat(V," font14"),children:"* 我们确保你所提供的信息均处于严格保密状态,不会泄露"}),(0,ne.jsx)(R.Z,{visible:"Account-AppplySchool"===u.actionTabs.key,onClose:function(){le({type:"account/setActionTabs",payload:{}})},schoolName:be.school,onSuccess:$n}),(0,ne.jsx)(B.Z,{visible:"Account-AppplyDepartment"===u.actionTabs.key,onClose:function(){le({type:"account/setActionTabs",payload:{}})},schoolId:null===(r=we.find((function(e){return e.name===be.school})))||void 0===r?void 0:r.id,schoolName:be.school,departmentName:be.department,onSuccess:function(e){return Yn(be.school,e)}}),(0,ne.jsx)(ee.Z,{visible:"Account-AppplyProfession"===u.actionTabs.key,onClose:function(){le({type:"account/setActionTabs",payload:{}})},departmentId:null===(s=Te.find((function(e){return e.name===be.department})))||void 0===s?void 0:s.id,departmentName:be.department,majorName:be.major_name,onSuccess:function(e){oe.setFieldsValue({major_name:e}),_e(o()(o()({},oe.getFieldsValue()),{major_name:e})),Xn()}}),(0,ne.jsx)(b.Z,{centered:!0,destroyOnClose:!0,open:$e,title:"头歌教师交流社区",width:560,footer:null,onCancel:function(){en(!1)},children:(0,ne.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,ne.jsx)("aside",{style:{letterSpacing:1},children:"基于您所在院校与平台有深度合作,我们特意为您配备了平台的1对1助教,您可以扫描下方二维码添加助理微信,我们将7*24小时为您答疑解惑。"}),(0,ne.jsx)("img",{className:"mt20 mb20",src:O,width:162,height:162})]})}),(0,ne.jsx)(b.Z,{title:"解绑学号",open:ve,centered:!0,destroyOnClose:!0,onCancel:function(){je(!1)},onOk:function(){de.submit()},children:(0,ne.jsxs)(g.Z,{form:de,initialValues:{check_type:1},size:"large",onValuesChange:function(e,n){fe(n)},onFinish:function(){var e=d()(l()().mark((function e(n){var t,i;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,K.ZP)("/api/users/accounts/".concat(null==c||null===(t=c.userInfo)||void 0===t?void 0:t.user_id,"/unbind_student_id.json"),{method:"post",body:o()({student_id:be.studentNo,school_id:(null==Qn?void 0:Qn.school_id)||(null==we||null===(i=we.find((function(e){return e.name===be.school})))||void 0===i?void 0:i.id)},n)});case 2:0==e.sent.status&&(y.ZP.success("解绑成功"),oe.validateFields(),je(!1));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:[(0,ne.jsxs)("div",{children:["很抱歉,该学号(",be.studentNo,")已被使用,如果需要将该学号绑定在当前账号上,您可以提供原账号(使用该学号的账号)的相关信息进行解绑:"]}),(0,ne.jsxs)("div",{className:"mt20 mb20",style:{background:"#f5f5f5",borderRadius:"5px",padding:"10px"},children:[(0,ne.jsx)("div",{children:"1、原账号绑定的手机号码或者邮箱;"}),(0,ne.jsx)("div",{children:"2、原账号已加入的教学课堂中教师手机号后6位或者课堂邀请码;"}),(0,ne.jsx)("div",{children:"注意:请确保原账号所在单位与已加入的教学课堂所属单位相同。"})]}),(0,ne.jsxs)(_.Z,{gutter:[10,0],children:[(0,ne.jsx)(Z.Z,{span:5,children:(0,ne.jsx)(g.Z.Item,{name:"check_type",children:(0,ne.jsxs)(v.default,{children:[(0,ne.jsx)(ie,{value:1,children:"邀请码"}),(0,ne.jsx)(ie,{value:2,children:"手机号"}),(0,ne.jsx)(ie,{value:3,children:"邮箱"})]})})}),(0,ne.jsxs)(Z.Z,{flex:1,children:[1==(null==me?void 0:me.check_type)&&(0,ne.jsx)(g.Z.Item,{name:"check_value",rules:[{required:!0,message:"请提供所在单位的教学课堂的邀请码"}],children:(0,ne.jsx)(j.Z,{type:"text",placeholder:"请提供所在单位的教学课堂的邀请码",maxLength:10})}),2==(null==me?void 0:me.check_type)&&(0,ne.jsx)(g.Z.Item,{name:"check_value",rules:[{required:!0,message:"请输入手机号码"}],children:(0,ne.jsx)(j.Z,{type:"text",placeholder:"请输入手机号码",maxLength:11})}),3==(null==me?void 0:me.check_type)&&(0,ne.jsx)(g.Z.Item,{name:"check_value",rules:[{required:!0,type:"email",message:"请输入邮箱"}],children:(0,ne.jsx)(j.Z,{type:"text",placeholder:"请输入邮箱"})})]})]})]})}),(0,ne.jsx)(M.Z,{})]})}))},32637:function(e,n,t){e.exports=t.p+"static/AssistantCode3.a8740efb.jpeg"}}]); |