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

1 line
13 KiB

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[45179],{69706:function(e,n,t){t.r(n),t.d(n,{default:function(){return V}});var l=t(7557),i=t.n(l),s=t(82242),a=t.n(s),o=t(41498),r=t.n(o),d=t(79800),c=t.n(d),u=t(39647),m=t.n(u),h=t(59301),p=t(7880),_=t(57809),v=t(78241),f=t(8591),x=t(95237),g=t(43604),b=t(98135),j=t(5112),y=t(3113),Z=t(43418),w="wrap___D0lbV",C="content___RYEUi",I="crumbs___wYb3b",O="title___zdLk8",k="titleWrap___vMR6a",N="btn___SBoeO",S="formWrap___vk03L",P="submitButton___Y1MK8",E="submitButtondiv___swdgC",M="manage___ikeTI",z="modalWrap___SEOyF",F="buttonFixed___QtDpR",$=t(6457),D=t(51136),R=t(37712),H=["user","account","globalSetting","shixunHomeworks","loading","dispatch"],W=_.default.Option,V=(0,p.connect)((function(e){var n=e.user,t=e.account,l=e.loading,i=e.globalSetting,s=e.shixunHomeworks;return{user:n,account:t,globalSetting:i,loading:l.effects,shixunHomeworks:s}}))((function(e){e.user,e.account,e.globalSetting,e.shixunHomeworks,e.loading,e.dispatch,m()(e,H);var n,t,l=v.Z.useForm(),s=c()(l,1)[0],o=(0,h.useState)({}),d=c()(o,2),u=d[0],V=d[1],L=(0,h.useState)([]),B=c()(L,2),T=B[0],Y=B[1],q=(0,h.useState)(!1),A=c()(q,2),U=A[0],X=A[1],G=(0,h.useState)(),J=c()(G,2),K=J[0],Q=J[1],ee=(0,p.useParams)().studentId,ne=function(){var e=r()(i()().mark((function e(){var n,t,l,o,r,d,c,u,m,h,p,_,v,f,x;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,D.ZP)("/api/school_manages/user_basic_info.json",{method:"get",params:{user_id:ee}});case 2:null!=(t=e.sent)&&null!==(n=t.data)&&void 0!==n&&n.user_basic_info&&(x={real_name:null==t||null===(l=t.data)||void 0===l||null===(l=l.user_basic_info)||void 0===l?void 0:l.real_name,nickname:null==t||null===(o=t.data)||void 0===o||null===(o=o.user_basic_info)||void 0===o?void 0:o.nickname,gender:null==t||null===(r=t.data)||void 0===r||null===(r=r.user_basic_info)||void 0===r?void 0:r.gender,identity:"学生",student_id:null==t||null===(d=t.data)||void 0===d||null===(d=d.user_basic_info)||void 0===d?void 0:d.student_id,mail:null==t||null===(c=t.data)||void 0===c||null===(c=c.user_basic_info)||void 0===c?void 0:c.mail,phone:null==t||null===(u=t.data)||void 0===u||null===(u=u.user_basic_info)||void 0===u?void 0:u.phone,school:null==t||null===(m=t.data)||void 0===m||null===(m=m.user_basic_info)||void 0===m||null===(m=m.school)||void 0===m?void 0:m.name,department:null==t||null===(h=t.data)||void 0===h||null===(h=h.user_basic_info)||void 0===h||null===(h=h.department)||void 0===h?void 0:h.name,edu_background:null==t||null===(p=t.data)||void 0===p||null===(p=p.user_basic_info)||void 0===p?void 0:p.edu_background,edu_entry_year:null==t||null===(_=t.data)||void 0===_||null===(_=_.user_basic_info)||void 0===_?void 0:_.edu_entry_year},Q(a()({},null==t||null===(v=t.data)||void 0===v?void 0:v.user_basic_info)),le(null==t||null===(f=t.data)||void 0===f||null===(f=f.user_basic_info)||void 0===f||null===(f=f.school)||void 0===f?void 0:f.id),s.setFieldsValue(x),V(x));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();(0,h.useEffect)((function(){ne()}),[]);var te,le=function(){var e=r()(i()().mark((function e(n){var t,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,D.ZP)("/api/school_manages/departments.json",{method:"get"});case 2:(t=e.sent)&&Y(null==t||null===(l=t.data)||void 0===l?void 0:l.departments);case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),ie=function(){var e=r()(i()().mark((function e(n){var t,l,s,a,o,r,d,c,u,m,h,p,_;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=n.real_name,a=n.nickname,o=n.gender,n.identity,r=n.student_id,d=n.mail,c=n.phone,n.school,u=n.department,m=n.edu_background,h=n.edu_entry_year,p=null===(t=T.find((function(e){return e.name===u})))||void 0===t?void 0:t.id,e.next=4,(0,D.ZP)("/api/school_manages/save_user_basic_info.json",{method:"post",body:{user_id:ee,real_name:s,nickname:a,gender:o,identity:"student",student_id:r,mail:d,phone:c,school_id:null==K||null===(l=K.school)||void 0===l?void 0:l.id,department_id:p,edu_background:m,edu_entry_year:h}});case 4:0==(null==(_=e.sent)?void 0:_.status)&&f.ZP.success("保存成功!");case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),se=function(){var e=r()(i()().mark((function e(){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,D.ZP)("/api/school_manages/reset_password.json",{method:"post",body:{user_id:ee}});case 2:(n=e.sent)&&f.ZP.success(n.message),X(!1);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,R.jsx)("section",{className:w,children:(0,R.jsxs)("div",{className:C,children:[(0,R.jsxs)("div",{className:I,children:[(0,R.jsx)("div",{style:{color:"#C5C5C5",paddingRight:4,cursor:"pointer"},onClick:function(){return p.history.push("/administration/student")},children:"学生管理>"}),(0,R.jsx)("div",{style:{color:"#5F6368"},children:"信息编辑"})]}),(0,R.jsx)("div",{className:k,children:(0,R.jsx)("div",{className:O,children:"基本信息"})}),(0,R.jsxs)(v.Z,{form:s,className:S,layout:"vertical",onValuesChange:function(e){V(a()({},s.getFieldsValue()))},onFinish:ie,scrollToFirstError:!0,children:[(0,R.jsxs)(x.Z,{children:[(0,R.jsx)(g.Z,{style:{marginRight:40,width:466},children:(0,R.jsx)(v.Z.Item,{label:"姓名",name:"real_name",rules:[{required:!0,message:"请输入真实姓名,最大限制".concat(20,"个字符")},{validator:$.HJ}],children:(0,R.jsx)(b.Z,{size:"large",placeholder:"请输入姓名",maxLength:20})})}),(0,R.jsx)(g.Z,{style:{width:467},children:(0,R.jsx)(v.Z.Item,{label:"昵称",name:"nickname",children:(0,R.jsx)(b.Z,{size:"large",placeholder:"请输入昵称",maxLength:20})})})]}),(0,R.jsx)(x.Z,{children:(0,R.jsxs)(g.Z,{style:{height:50,display:"flex",alignItems:"center"},className:"sexCol",children:[(0,R.jsx)("span",{style:{fontSize:14,color:"",display:"inline-block",marginTop:"-28px",paddingLeft:"-2px"},children:"性别"}),(0,R.jsx)(v.Z.Item,{initialValue:u.gender,name:"gender",rules:[{required:!0,message:"请选择性别"}],children:(0,R.jsxs)(j.ZP.Group,{style:{marginLeft:13},defaultValue:u.gender,children:[(0,R.jsx)(j.ZP,{value:0,children:"男"}),(0,R.jsx)(j.ZP,{value:1,style:{marginLeft:40},children:"女"})]})})]})}),(0,R.jsxs)(x.Z,{children:[(0,R.jsx)(g.Z,{style:{marginRight:40,width:466},children:(0,R.jsx)(v.Z.Item,{label:"职业",name:"identity",initialValue:"student",children:(0,R.jsxs)(_.default,{disabled:!0,size:"large",children:[(0,R.jsx)(W,{value:"teacher",children:"教师"}),(0,R.jsx)(W,{value:"student",children:"学生"}),(0,R.jsx)(W,{value:"professional",children:"专业人士"})]})})}),(0,R.jsx)(g.Z,{style:{width:467},children:(0,R.jsx)(v.Z.Item,{label:"学号",name:"student_id",rules:[{required:!0,message:"请输入学号"}],children:(0,R.jsx)(b.Z,{size:"large",placeholder:"请输入学号"})})})]}),(0,R.jsxs)(x.Z,{children:[(0,R.jsx)(g.Z,{style:{marginRight:40,width:466},children:(0,R.jsx)(v.Z.Item,{label:"邮箱地址",name:"mail",children:(0,R.jsx)(b.Z,{size:"large",placeholder:"请输入邮箱地址"})})}),(0,R.jsx)(g.Z,{style:{width:467},children:(0,R.jsx)(v.Z.Item,{label:"手机号",name:"phone",children:(0,R.jsx)(b.Z,{size:"large",placeholder:"请输入手机号"})})})]}),(0,R.jsxs)(x.Z,{children:[(0,R.jsx)(g.Z,{style:{width:466},children:(0,R.jsx)(v.Z.Item,{label:"学校/单位",name:"school",children:(0,R.jsx)(_.default,{disabled:!0,size:"large",children:(0,R.jsx)(W,{value:null==K||null===(n=K.school)||void 0===n?void 0:n.id,children:null==K||null===(t=K.school)||void 0===t?void 0:t.name})})})}),(0,R.jsx)(g.Z,{style:{width:467,marginLeft:40},children:(0,R.jsx)(v.Z.Item,{label:"院系/部门",name:"department",initialValue:null==u?void 0:u.department,rules:[{required:!0,message:"请选择院系/部门"}],children:(0,R.jsx)(_.default,{placeholder:"请选择院系/部门",size:"large",children:T.map((function(e,n){return(0,R.jsx)(W,{value:e.name,children:e.name},n)}))})})})]}),(0,R.jsxs)(x.Z,{children:[(0,R.jsx)(g.Z,{style:{marginRight:40,width:466},className:"last",children:(0,R.jsx)(v.Z.Item,{label:"学历",name:"edu_background",children:(0,R.jsx)(_.default,{placeholder:"请选择最高学历",size:"large",defaultValue:null==u?void 0:u.edu_background,children:$.jh.map((function(e,n){return(0,R.jsx)(W,{value:e.id,children:e.name},n)}))})})}),(0,R.jsx)(g.Z,{style:{width:467},children:(0,R.jsx)(v.Z.Item,{label:"入学年份",name:"edu_entry_year",children:(0,R.jsx)(_.default,{placeholder:"请选择入学年份",size:"large",defaultValue:null==u?void 0:u.edu_entry_year,children:(te=(new Date).getFullYear(),Array(20).fill({}).map((function(e,n){return(0,R.jsx)(W,{value:te-n,children:(0,R.jsx)("span",{children:te-n})},n)})))})})})]}),(0,R.jsx)(x.Z,{className:F,align:"middle",children:(0,R.jsx)(v.Z.Item,{children:(0,R.jsxs)("div",{children:[(0,R.jsx)(y.ZP,{className:E,size:"large",type:"primary",htmlType:"submit",children:"保存"}),(0,R.jsx)(y.ZP,{className:P,size:"large",onClick:function(){return p.history.push("/administration/student")},children:"取消"})]})})})]}),(0,R.jsxs)("div",{style:{height:200},children:[(0,R.jsx)("div",{className:M,children:"管理"}),(0,R.jsx)("a",{className:N,onClick:function(){return X(!0)},children:"重置密码"})]}),(0,R.jsx)(Z.Z,{title:"重置密码",style:{left:20},centered:!0,wrapClassName:z,visible:U,onOk:se,onCancel:function(){return X(!1)},children:(0,R.jsxs)("p",{children:["重置为初始密码后将会推送信息到该学生消息中心,请确定是否重置,初始密码为:",(0,R.jsx)("span",{style:{color:"#3061D0"},children:"12345678"})]})})]})})}))},57809:function(e,n,t){var l=t(92310),i=t.n(l),s=t(77861),a=t(70521),o=t(59301),r=t(53487),d=t(62892),c=t(19080),u=t(36355),m=t(1684),h=t(93891),p=t(19716),_=t(32441),v=t(33234),f=t(14154),x=t(58582),g=t(84443),b=t(66339),j=function(e,n){var t={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&n.indexOf(l)<0&&(t[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(l=Object.getOwnPropertySymbols(e);i<l.length;i++)n.indexOf(l[i])<0&&Object.prototype.propertyIsEnumerable.call(e,l[i])&&(t[l[i]]=e[l[i]])}return t};const y="SECRET_COMBOBOX_MODE_DO_NOT_USE",Z=(e,n)=>{var t,{prefixCls:l,bordered:r=!0,className:Z,rootClassName:w,getPopupContainer:C,popupClassName:I,dropdownClassName:O,listHeight:k=256,placement:N,listItemHeight:S=24,size:P,disabled:E,notFoundContent:M,status:z,builtinPlacements:F,dropdownMatchSelectWidth:$,popupMatchSelectWidth:D,direction:R,style:H,allowClear:W}=e,V=j(e,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear"]);const{getPopupContainer:L,getPrefixCls:B,renderEmpty:T,direction:Y,virtual:q,popupMatchSelectWidth:A,popupOverflow:U,select:X}=o.useContext(u.E_),G=B("select",l),J=B(),K=null!=R?R:Y,{compactSize:Q,compactItemClassnames:ee}=(0,v.ri)(G,K),[ne,te]=(0,f.Z)(G),le=o.useMemo((()=>{const{mode:e}=V;if("combobox"!==e)return e===y?"combobox":e}),[V.mode]),ie="multiple"===le||"tags"===le,se=(0,g.Z)(V.suffixIcon,V.showArrow),ae=null!==(t=null!=D?D:$)&&void 0!==t?t:A,{status:oe,hasFeedback:re,isFormItemInput:de,feedbackIcon:ce}=o.useContext(_.aM),ue=(0,c.F)(oe,z);let me;me=void 0!==M?M:"combobox"===le?null:(null==T?void 0:T("Select"))||o.createElement(h.Z,{componentName:"Select"});const{suffixIcon:he,itemIcon:pe,removeIcon:_e,clearIcon:ve}=(0,b.Z)(Object.assign(Object.assign({},V),{multiple:ie,hasFeedback:re,feedbackIcon:ce,showSuffixIcon:se,prefixCls:G,showArrow:V.showArrow,componentName:"Select"})),fe=!0===W?{clearIcon:ve}:W,xe=(0,a.Z)(V,["suffixIcon","itemIcon"]),ge=i()(I||O,{[`${G}-dropdown-${K}`]:"rtl"===K},w,te),be=(0,p.Z)((e=>{var n;return null!==(n=null!=P?P:Q)&&void 0!==n?n:e})),je=o.useContext(m.Z),ye=null!=E?E:je,Ze=i()({[`${G}-lg`]:"large"===be,[`${G}-sm`]:"small"===be,[`${G}-rtl`]:"rtl"===K,[`${G}-borderless`]:!r,[`${G}-in-form-item`]:de},(0,c.Z)(G,ue,re),ee,null==X?void 0:X.className,Z,w,te),we=o.useMemo((()=>void 0!==N?N:"rtl"===K?"bottomRight":"bottomLeft"),[N,K]),Ce=(0,x.Z)(F,U);return ne(o.createElement(s.ZP,Object.assign({ref:n,virtual:q,showSearch:null==X?void 0:X.showSearch},xe,{style:Object.assign(Object.assign({},null==X?void 0:X.style),H),dropdownMatchSelectWidth:ae,builtinPlacements:Ce,transitionName:(0,d.m)(J,"slide-up",V.transitionName),listHeight:k,listItemHeight:S,mode:le,prefixCls:G,placement:we,direction:K,suffixIcon:he,menuItemSelectedIcon:pe,removeIcon:_e,allowClear:fe,notFoundContent:me,className:Ze,getPopupContainer:C||L,dropdownClassName:ge,disabled:ye})))};const w=o.forwardRef(Z),C=(0,r.Z)(w);w.SECRET_COMBOBOX_MODE_DO_NOT_USE=y,w.Option=s.Wx,w.OptGroup=s.Xo,w._InternalPanelDoNotUseOrYouWillBeFired=C,n.default=w},8378:function(e,n){n.Z=e=>({[e.componentCls]:{[`${e.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${e.motionDurationMid} ${e.motionEaseInOut},\n opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}},[`${e.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${e.motionDurationMid} ${e.motionEaseInOut},\n opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}}})}}]);