|
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[54846],{3196:function(e,n,t){t.d(n,{Z:function(){return b}});var i=t(7557),s=t.n(i),l=t(41498),a=t.n(l),o=t(82242),r=t.n(o),c=t(79800),u=t.n(c),d=t(39647),h=t.n(d),m=t(59301),p=t(8591),v=t(54580),f=t(95237),x=t(17631),_=t(19248),g=t(46906),j="tip___bHEXo",w=t(37712),y=["ButtonText","ButtonOptions","uploadProps","showTip","showText","showListening","imgWidth"],b=function(e){var n,t,i,l=e.ButtonText,o=e.ButtonOptions,c=e.uploadProps,d=e.showTip,b=e.showText,k=e.showListening,Z=e.imgWidth,C=h()(e,y),S=(0,m.useState)(null),N=u()(S,2),R=N[0],F=N[1],E=r()(r()({maxCount:1,accept:"image/*",withCredentials:!0,beforeUpload:function(e){if(!("image/jpeg"===e.type||"image/png"===e.type||"image/jpg"===e.type))return p.ZP.error("您上传的不是JPEG/PNG/JPG类型文件"),v.Z.LIST_IGNORE;var n=e.size/1024/1024;return 0==n?(p.ZP.error("".concat(e.name," 图片无法上传。").concat(0==n?"文件内容不能为空":"超过图片大小限制(2MB)")),v.Z.LIST_IGNORE):!(n>2)||(p.ZP.error("".concat(e.name," 图片无法上传。超过图片大小限制(2MB)")),v.Z.LIST_IGNORE)},onChange:function(e){var n;(["uploading","done","removed"].includes(e.file.status)&&F(e.file),"done"==e.file.status)&&(null==C||C.onChange(null===(n=e.file)||void 0===n||null===(n=n.response)||void 0===n?void 0:n.id))},action:"".concat(x.Z.API_SERVER,"/api/attachments.json")},c||{}),{},{onRemove:(t=a()(s()().mark((function e(n){return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:P(),(null==c?void 0:c.onRemove)&&(null==c||c.onRemove(n));case 2:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})}),P=function(){F(null),null==C||C.onChange()};return(0,m.useEffect)((function(){(null==C?void 0:C.value)&&F({response:{id:null==C?void 0:C.value}})}),[null==C?void 0:C.value]),(0,w.jsx)("div",{id:(null==C?void 0:C.scrollId)||"",children:null!=R&&null!==(n=R.response)&&void 0!==n&&n.id?(0,w.jsxs)(f.Z,{align:"middle",justify:"center",style:{position:"relative",width:Z||400,backgroundColor:"#f4f3f4"},children:[(0,w.jsx)("img",{src:x.Z.API_SERVER+"/api/attachments/"+(null==R||null===(i=R.response)||void 0===i?void 0:i.id),alt:"avatar",style:{width:"100%",height:Z?"177px":"auto"}}),(0,w.jsx)("div",{style:{position:"absolute",right:"-6px",top:"-6px",cursor:"pointer",width:16,height:16,borderRadius:"50%",backgroundColor:"#fff"},children:(0,w.jsx)(_.Z,{onClick:a()(s()().mark((function e(){return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:P();case 1:case"end":return e.stop()}}),e)}))),style:{fontSize:"16px",color:"red"}})})]}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(v.Z,r()(r()({},E),{},{children:(0,w.jsx)(g.op,r()(r()({style:r()({borderRadius:"2px"},null==o?void 0:o.style)},o),{},{children:l}))})),d&&(0,w.jsx)("span",{className:j,children:"(建议上传尺寸为472*266的图片)"}),b&&(0,w.jsx)("span",{className:j,style:{width:"4rem"},children:"(需上传尺寸为200*268的图片,大小不超过2MB)"}),k&&(0,w.jsx)("span",{className:j,style:{width:"4rem"},children:"(限制上传2MB内的图片,建议上传尺寸为283*177的图片)"})]})})}},81878:function(e,n,t){t.r(n),t.d(n,{default:function(){return pe}});var i=t(7557),s=t.n(i),l=t(82242),a=t.n(l),o=t(41498),r=t.n(o),c=t(37205),u=t.n(c),d=t(79800),h=t.n(d),m=t(59301),p=t(8591),v=t(6848),f=t(43418),x=t(95237),_=t(43604),g=t(58421),j=t(13032),w="BannerStyle___nBur1",y="BannerStyleContent___BWJw0",b="DivDownPlay___UxEQf",k="CustomInputStyle___hlhUc",Z="teacherList___su0_a",C="top_bg_img___cmYFQ",S="techer_content___bgSA5",N="img___LchtM",R="teacher_img___l8Tb6",F="content___sMnqv",E="shuji_list___FhkLj",P="shuji_list_warp___cIMiD",I="ellipsis___CyQwV",B="shenhe_icon___cRhss",T="shuming___W1km7",L="shuji_jianjie___X7_wI",O="teacher_header___MrKe6",z="teacher_name___rAJpd",M="teacher_school___nvAEr",G="iconUpdate___Gab4k",q="iconDetele___xyhpb",A="expansion___zOJvl",D="expansion2___Du6w4",J=t(17631),V=(t(56349),t(58181)),U=t(46906),W=t(72226),H=t(39647),Q=t.n(H),X=t(78241),K=t(10249),Y=t(81327),$=t(57809),ee=t(61186),ne=t.n(ee),te="form___Fxxn8",ie=(t(19248),t(12893)),se=t(32134),le=t(3196),ae=t(37712),oe=["key","name"],re=(0,j.connect)((function(e){return{dispatch:e.dispatch,coreCurriculum:e.coreCurriculum}}))((function(e){var n=e.visible,t=e.onOk,i=e.onCancel,l=e.title,o=void 0===l?"":l,c=e.coreCurriculum,u=e.dispatch,d=(c.CoreSubjects,X.Z.useForm()),p=h()(d,1)[0],v=(0,m.useState)(!1),x=h()(v,2),_=x[0],g=x[1],j=(0,m.useState)([]),w=h()(j,2),y=(w[0],w[1]),b=(0,m.useState)(!1),k=h()(b,2),Z=k[0],C=(k[1],(0,m.useState)([])),S=h()(C,2),N=S[0],R=S[1];(0,m.useEffect)((function(){if(n&&F(),u({type:"coreCurriculum/getCoreSubjects",payload:{page:1,limit:12}}),null!=n&&n.id){var e,t,i;p.setFieldsValue(a()(a()({},n),{},{attachment_id:null==n||null===(e=n.attachment)||void 0===e?void 0:e.id,publication_time:ne()(null==n?void 0:n.publication_time),material_type:null==n||null===(t=n.material_type)||void 0===t?void 0:t.toString()}));var s=[a()(a()({},null==n?void 0:n.attachment),{},{response:{id:null==n||null===(i=n.attachment)||void 0===i?void 0:i.id}})];y(s)}}),[n]);var F=function(){var e=r()(s()().mark((function e(){var n;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,V.ZP)("/api/core_materials/all_books.json",{method:"get"});case 2:0==(null==(n=e.sent)?void 0:n.status)&&R(null==n?void 0:n.data);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),E=function(){var e=r()(s()().mark((function e(n){var i;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:g(!0),i=a()({},n),t(i);case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,ae.jsx)(f.Z,{title:"".concat(null!=n&&n.id?"编辑":"新建").concat(o),visible:n,onOk:function(){p.submit()},centered:!0,onCancel:function(){i()},confirmLoading:_,okButtonProps:{disabled:Z},width:720,afterClose:function(){g(!1),y([]),p.resetFields()},okText:"确认",cancelText:"取消",children:(0,ae.jsxs)(X.Z,{form:p,colon:!1,labelCol:{span:3},onFinish:E,className:te,children:[(0,ae.jsx)(X.Z.Item,{label:"姓名",name:"name",rules:[{required:!0,message:"请输入主审专家姓名"},{whitespace:!0,message:"请输入主审专家姓名"},{max:50,message:"只能输入50个字符"}],children:(0,ae.jsx)(K.Z,{maxLength:50,placeholder:"请输入主审专家姓名"})}),(0,ae.jsx)(X.Z.Item,{label:"职称",name:"title",rules:[{required:!0,message:"请输入职称"},{whitespace:!0,message:"请输入职称"},{max:100,message:"只能输入100个字符"}],children:(0,ae.jsx)(K.Z,{maxLength:100,placeholder:"请输入职称"})}),(0,ae.jsx)(X.Z.Item,{label:"简介",name:"profile",rules:[{required:!0,message:"请输入简介"}],children:(0,ae.jsx)(K.Z.TextArea,{rows:4,placeholder:"请输入简介",maxLength:300})}),(0,ae.jsx)(X.Z.Item,{name:"cover_id",label:"照片",rules:[{required:!0,message:"请上传照片"}],children:(0,ae.jsx)(le.Z,{showText:!0,ButtonText:(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)("i",{className:"iconfont icon-shangchuanfujian r5 font14"}),(0,ae.jsx)("span",{className:"ml5",children:"上传照片"})]})})}),(0,ae.jsx)(X.Z.Item,{label:"审核教材",name:"publisher",rules:[{required:!1,message:"请输入简介"}],children:(0,ae.jsx)(X.Z.List,{name:"data",children:function(e,n){var t=n.add,i=n.remove;return(0,ae.jsxs)(ae.Fragment,{children:[e.map((function(e){var n=e.key,s=e.name,l=Q()(e,oe);return(0,ae.jsxs)(Y.Z,{style:{display:"flex",alignItems:"center",marginBottom:8,background:"#F6F7F9",borderRadius:"2px",padding:20,paddingBottom:"5px"},align:"baseline",children:[(0,ae.jsxs)("div",{children:[(0,ae.jsx)(X.Z.Item,a()(a()({},l),{},{name:[s,"name"],label:"教材名称",labelCol:{span:4},rules:[{required:!0,message:"请输入教材名称"}],children:(0,ae.jsx)(K.Z,{placeholder:"请输入教材名称",style:{width:400}})})),(0,ae.jsx)(X.Z.Item,a()(a()({},l),{},{name:[s,"book_id"],label:"关联",labelCol:{span:4},rules:[{required:!1,message:"请选择"}],children:(0,ae.jsx)($.default,{placeholder:"请选择",style:{width:400},getPopupContainer:function(e){return e.parentElement},children:null==N?void 0:N.map((function(e,n){return(0,ae.jsx)($.default.Option,{value:null==e?void 0:e.id,children:null==e?void 0:e.name},n)}))})}))]}),(0,ae.jsxs)("div",{style:{marginLeft:8},children:[(0,ae.jsx)(ie.Z,{onClick:function(){return i(s)},style:{color:"#00B187",marginRight:20}}),(0,ae.jsx)(se.Z,{onClick:function(){return t()},style:{color:"#E30000"}})]})]},n)})),(0,ae.jsx)(X.Z.Item,{children:(0,ae.jsx)(U.op,{style:{borderRadius:"2px",marginLeft:0,marginTop:3},onClick:function(){return t()},children:"增加审核教材"})})]})}})})]})})})),ce=t(20731),ue=t(68738),de=t(69142),he=t(48815),me=t(5531),pe=(0,j.connect)((function(e){var n=e.homePage,t=e.loading,i=e.globalSetting,s=e.user;return{homePage:n,globalSetting:i,loading:t.models.homePage,user:s}}))((function(e){e.homePage;var n,t,i=e.globalSetting,l=(e.user,e.dispatch),o=(0,m.useState)(!1),c=h()(o,2),d=c[0],H=c[1],Q=(0,m.useState)(!1),X=h()(Q,2),K=X[0],Y=X[1],$=(0,m.useState)({page:1,limit:10,keyword:""}),ee=h()($,2),ne=ee[0],te=ee[1],ie=(0,m.useState)(!1),se=h()(ie,2),le=(se[0],se[1]),oe=(0,m.useState)(0),pe=h()(oe,2),ve=pe[0],fe=pe[1],xe=(0,m.useState)([]),_e=h()(xe,2),ge=_e[0],je=_e[1],we=(0,m.useState)(0),ye=h()(we,2),be=ye[0],ke=ye[1],Ze=(0,m.useRef)(null),Ce=(0,m.useState)(""),Se=h()(Ce,2),Ne=Se[0],Re=Se[1],Fe=(0,m.useState)(!1),Ee=h()(Fe,2),Pe=Ee[0],Ie=Ee[1];(0,m.useEffect)((function(){Be(!1)}),[ne]),(0,m.useEffect)((function(){if(Ze.current&&ge.length>0){var e=ge.map((function(e,n){var t=document.getElementsByClassName("item_books_".concat(n))[0];if(t){var i=t.clientHeight,s=window.getComputedStyle(t).minHeight,l=i>parseFloat(s);e.books_showEllipsis=l,e.books_showReadFull=l}return e}));je(u()(e))}}),[be]);var Be=function(){var e=r()(s()().mark((function e(){var n,t,i,l,o,r,c=arguments;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=c.length>0&&void 0!==c[0]&&c[0],le(!0),t=n?{}:a()({},ne),e.next=5,(0,V.ZP)("/api/specialist_infos.json",{method:"get",params:a()({},t)});case 5:if(0!=(null==(i=e.sent)?void 0:i.status)){e.next=18;break}if(H(null==i?void 0:i.can_edit),Ie(null==i?void 0:i.description_permission),Re(null==i?void 0:i.description),o=null==i||null===(l=i.data)||void 0===l?void 0:l.list.map((function(e,n){var t,i=JSON.parse(JSON.stringify({profile:null==e?void 0:e.profile}));return null!=e&&e.profile&&(null==e||null===(t=e.profile)||void 0===t?void 0:t.length)>85?(e.profileCopy=(null==i?void 0:i.profile.slice(0,85))+"...",e.snapshot_showEllipsis=!0,e.snapshot_showReadFull=!0):(e.snapshot_showEllipsis=!1,e.snapshot_showReadFull=!1),e.books_showEllipsis=!1,e.books_showReadFull=!1,e})),!n){e.next=15;break}return e.abrupt("return",o);case 15:je(o||[]),ke(be+1),fe(null==i||null===(r=i.data)||void 0===r?void 0:r.total);case 18:le(!1);case 19:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Te=function(){var e=r()(s()().mark((function e(n){var t,i;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==K||!K.id){e.next=7;break}return e.next=3,(0,V.ZP)("/api/specialist_infos/".concat(null==K?void 0:K.id,".json"),{method:"put",body:a()({},n)});case 3:0==(null==(t=e.sent)?void 0:t.status)&&(p.ZP.success("".concat(null!=K&&K.id?"编辑":"添加","成功")),Y(!1),Be()),e.next=11;break;case 7:return e.next=9,(0,V.ZP)("/api/specialist_infos.json",{method:"post",body:a()({},n)});case 9:0==(null==(i=e.sent)?void 0:i.status)&&(p.ZP.success("添加成功"),Y(!1),Be());case 11:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,ae.jsxs)("section",{style:{paddingBottom:"3rem"},children:[(0,ae.jsx)("div",{className:w,style:{backgroundImage:"url(".concat(J.Z.IMG_SERVER,"/").concat(null==i||null===(n=i.setting)||void 0===n?void 0:n.news_banner_url,")")},children:(0,ae.jsxs)("div",{className:y,children:[(0,ae.jsxs)("div",{children:[(0,ae.jsx)("div",{style:{color:"#fff",fontSize:".34rem",letterSpacing:".05rem",fontWeight:600},children:(0,ce.Iz)("/judge",null==i||null===(t=i.setting)||void 0===t?void 0:t.navbar)}),(0,ae.jsxs)("div",{style:{display:"flex"},children:[!!d&&(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsxs)("div",{className:"".concat(b),style:{width:"1rem"},onClick:function(){return Y(!0)},children:[(0,ae.jsx)("i",{className:"iconfont icon-icon_xinyong_xianxing_jijin-249",style:{marginRight:"0.05rem",fontSize:".16rem"}}),"新建"]}),(0,ae.jsxs)("div",{className:"".concat(b),style:{marginLeft:".2rem",width:"1.5rem"},onClick:r()(s()().mark((function e(){var n;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Be(!0);case 2:n=e.sent,l({type:"classroomList/setActionTabs",payload:{key:"批量调整顺序",params:{name:"主审专家",data:n}}});case 4:case"end":return e.stop()}}),e)}))),children:[(0,ae.jsx)(me.Z,{style:{marginRight:"0.05rem",fontSize:".16rem"}}),"批量调整顺序"]})]}),!!Pe&&(0,ae.jsxs)("div",{className:"".concat(b),style:{marginLeft:".2rem",width:"1.2rem"},onClick:r()(s()().mark((function e(){return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:l({type:"classroomList/setActionTabs",payload:{key:"规划说明",params:{name:"主审专家",content:Ne}}});case 1:case"end":return e.stop()}}),e)}))),children:[(0,ae.jsx)("i",{className:"iconfont icon-icon_xinyong_xianxing_jijin-249",style:{marginRight:"0.05rem",fontSize:".16rem"}}),"规划说明"]})]})]}),(0,ae.jsx)("div",{children:(0,ae.jsx)(U.t7,{placeholder:"请输入关键字进行搜索",className:k,value:ne.keyword,onChange:function(e){te(a()(a()({},ne),{},{keyword:e}))}})})]})}),Ne&&(0,ae.jsx)(de.Z,{style:{width:"12rem",margin:" .2rem auto",paddingBottom:"0.2rem"},value:Ne}),(0,ae.jsx)("div",{ref:Ze,children:null==ge?void 0:ge.map((function(e,n){var t,i,l;return(0,ae.jsxs)("div",{className:Z,children:[(0,ae.jsx)("div",{className:C,style:{width:"12rem",height:"0.2rem"}}),(0,ae.jsxs)("div",{className:S,children:[(0,ae.jsx)("div",{className:N,children:(0,ae.jsx)("img",{src:J.Z.IMG_SERVER+(null==e||null===(t=e.cover)||void 0===t?void 0:t.url),className:R})}),(0,ae.jsxs)("div",{className:F,children:[(0,ae.jsxs)("div",{className:O,children:[(0,ae.jsx)(v.Z,{title:null==e?void 0:e.name,children:(0,ae.jsx)("div",{className:z,children:null==e?void 0:e.name})}),(0,ae.jsx)(v.Z,{title:null==e?void 0:e.title,children:(0,ae.jsx)("div",{className:M,children:null==e?void 0:e.title})}),d&&(null==e?void 0:e.is_creator)&&(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(v.Z,{title:"编辑",children:(0,ae.jsx)("i",{className:"iconfont icon-bianji-moren ".concat(G),onClick:function(){Y(e)}})}),(0,ae.jsx)(v.Z,{title:"删除",children:(0,ae.jsx)("i",{className:"iconfont icon-shanchu13 ".concat(q),onClick:function(){var n;f.Z.confirm({icon:null,title:"提示",centered:!0,content:"请确认是否删除",okText:"确定",cancelText:"取消",onOk:(n=r()(s()().mark((function n(){var t;return s()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,V.ZP)("/api/specialist_infos/".concat(null==e?void 0:e.id,".json"),{method:"delete"});case 2:0===(null==(t=n.sent)?void 0:t.status)&&(p.ZP.info("删除成功"),Be());case 4:case"end":return n.stop()}}),n)}))),function(){return n.apply(this,arguments)})})}})})]})]}),(0,ae.jsxs)("div",{className:"".concat(L," item_snapshot_").concat(n),children:["简介:",null!=e&&e.snapshot_showReadFull?null==e?void 0:e.profileCopy:null==e?void 0:e.profile,(null==e?void 0:e.snapshot_showEllipsis)&&(0,ae.jsx)("span",{className:A,onClick:function(t){t.stopPropagation(),ge[n]=a()(a()({},e),{},{snapshot_showReadFull:!(null!=e&&e.snapshot_showReadFull)}),je(u()(ge))},children:null!=e&&e.snapshot_showReadFull?"展开 ":"收起"})]}),(null==e||null===(i=e.data)||void 0===i?void 0:i.length)>0&&(0,ae.jsxs)("div",{className:E,children:[(0,ae.jsxs)("div",{className:"".concat(P," item_books_").concat(n),style:{maxHeight:(null==e?void 0:e.books_showReadFull)&&"0.4rem",paddingRight:(null==e?void 0:e.books_showReadFull)&&"0.5rem"},children:[null==e||null===(l=e.data)||void 0===l?void 0:l.map((function(e,n){return(0,ae.jsxs)("div",{onClick:function(){null!=e&&e.book_id?j.history.push("/textbook/detail/".concat(null==e?void 0:e.book_id,"?backUrl=/judge")):p.ZP.warning("该书籍未关联内容")},className:T,children:["《",null==e?void 0:e.name,"》"]},n)})),(null==e?void 0:e.books_showEllipsis)&&(0,ae.jsx)("div",{className:I,children:(null==e?void 0:e.books_showEllipsis)&&(0,ae.jsx)("div",{className:D,style:{marginRight:0},onClick:function(t){t.stopPropagation(),ge[n]=a()(a()({},e),{},{books_showReadFull:!(null!=e&&e.books_showReadFull)}),je(u()(ge))},children:null!=e&&e.books_showReadFull?"展开 ":"收起"})})]}),(0,ae.jsx)("div",{className:B})]})]})]})]},n)}))}),0==(null==ge?void 0:ge.length)&&(0,ae.jsx)(W.Z,{}),(null==ge?void 0:ge.length)>0&&(0,ae.jsxs)(x.Z,{wrap:!1,align:"middle",justify:"space-between",style:{width:"12rem",margin:".2rem auto",padding:"0 .2rem"},children:[(0,ae.jsxs)(_.Z,{children:["共 ",(0,ae.jsx)("span",{style:{color:"#165DFF"},children:ve||0})," 条数据"]}),(0,ae.jsx)(_.Z,{children:(0,ae.jsx)(g.Z,{showSizeChanger:!1,showQuickJumper:!0,current:ne.page,pageSize:ne.limit,onChange:function(e,n){ne.page=e,te(a()({},ne))},total:ve||0})})]}),(0,ae.jsx)(re,{visible:K,title:"主审专家",onCancel:function(){return Y(!1)},onOk:Te}),(0,ae.jsx)(ue.Z,{getData:Be}),(0,ae.jsx)(he.Z,{getData:Be})]})}))}}]); |