|
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[54846],{70997:function(e,n,t){t.d(n,{Z:function(){return Z}});var i=t(7557),l=t.n(i),s=t(41498),a=t.n(s),r=t(82242),o=t.n(r),c=t(79800),u=t.n(c),d=t(39647),h=t.n(d),m=t(59301),p=t(8591),v=t(53326),f=t(95237),x=t(20817),g=t(21884),_=t(89257),j="tip___bHEXo",b=t(37712),y=["ButtonText","ButtonOptions","uploadProps","showTip"],Z=function(e){var n,t,i,s=e.ButtonText,r=e.ButtonOptions,c=e.uploadProps,d=e.showTip,Z=h()(e,y),k=(0,m.useState)(null),w=u()(k,2),C=w[0],S=w[1],N=o()(o()({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)},onChange:function(e){var n;(["uploading","done","removed"].includes(e.file.status)&&S(e.file),"done"==e.file.status)&&(null==Z||Z.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()(l()().mark((function e(n){return l()().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(){S(null),null==Z||Z.onChange()};return(0,m.useEffect)((function(){(null==Z?void 0:Z.value)&&S({response:{id:null==Z?void 0:Z.value}})}),[null==Z?void 0:Z.value]),(0,b.jsx)("div",{id:(null==Z?void 0:Z.scrollId)||"",children:null!=C&&null!==(n=C.response)&&void 0!==n&&n.id?(0,b.jsxs)(f.Z,{align:"middle",justify:"center",style:{position:"relative",width:400,backgroundColor:"#f4f3f4"},children:[(0,b.jsx)("img",{src:x.Z.API_SERVER+"/api/attachments/"+(null==C||null===(i=C.response)||void 0===i?void 0:i.id),alt:"avatar",style:{width:"100%"}}),(0,b.jsx)("div",{style:{position:"absolute",right:"-6px",top:"-6px",cursor:"pointer",width:16,height:16,borderRadius:"50%",backgroundColor:"#fff"},children:(0,b.jsx)(g.Z,{onClick:a()(l()().mark((function e(){return l()().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,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(v.Z,o()(o()({},N),{},{children:(0,b.jsx)(_.op,o()(o()({style:o()({borderRadius:"2px"},null==r?void 0:r.style)},r),{},{children:s}))})),d&&(0,b.jsx)("span",{className:j,children:"(建议上传尺寸为472*266的图片)"})]})})}},35322:function(e,n,t){t.r(n),t.d(n,{default:function(){return te}});var i=t(82242),l=t.n(i),s=t(7557),a=t.n(s),r=t(41498),o=t.n(r),c=t(79800),u=t.n(c),d=t(59301),h=t(8591),m=t(6848),p=t(43418),v=t(95237),f=t(43604),x=t(86859),g=t(75936),_="BannerStyle___nBur1",j="BannerStyleContent___BWJw0",b="DivDownPlay___UxEQf",y="CustomInputStyle___hlhUc",Z="teacherList___su0_a",k="teacher_header___MrKe6",w="teacher_name___rAJpd",C="teacher_school___nvAEr",S="iconUpdate___Gab4k",N="iconDetele___xyhpb",P="techer_content___bgSA5",I="img___LchtM",E="teacher_img___l8Tb6",R="content___sMnqv",B="shuji_list___FhkLj",F="shenhe_icon___cRhss",L="shuming___W1km7",T="shuji_jianjie___X7_wI",O=t(20817),q=(t(60659),t(85750)),G=t(89257),z=t(50883),A=t(39647),M=t.n(A),J=t(78241),U=t(24650),V=t(81327),D=t(57809),W=t(61186),Q=t.n(W),X="form___Fxxn8",H=(t(21884),t(97810)),K=t(65547),Y=t(70997),$=t(37712),ee=["key","name"],ne=(0,g.connect)((function(e){return{dispatch:e.dispatch,coreCurriculum:e.coreCurriculum}}))((function(e){var n=e.visible,t=e.bookList,i=e.onOk,s=e.onCancel,r=e.title,c=void 0===r?"":r,h=e.coreCurriculum,m=e.dispatch,v=(h.CoreSubjects,J.Z.useForm()),f=u()(v,1)[0],x=(0,d.useState)(!1),g=u()(x,2),_=g[0],j=g[1],b=(0,d.useState)([]),y=u()(b,2),Z=(y[0],y[1]),k=(0,d.useState)(!1),w=u()(k,2),C=w[0];w[1];(0,d.useEffect)((function(){if(m({type:"coreCurriculum/getCoreSubjects",payload:{page:1,limit:12}}),null!=n&&n.id){var e,t,i;f.setFieldsValue(l()(l()({},n),{},{attachment_id:null==n||null===(e=n.attachment)||void 0===e?void 0:e.id,publication_time:Q()(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=[l()(l()({},null==n?void 0:n.attachment),{},{response:{id:null==n||null===(i=n.attachment)||void 0===i?void 0:i.id}})];Z(s)}}),[n]);var S=function(){var e=o()(a()().mark((function e(n){var t;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:j(!0),t=l()({},n),i(t);case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,$.jsx)(p.Z,{title:"".concat(null!=n&&n.id?"编辑":"新建").concat(c),visible:n,onOk:function(){f.submit()},centered:!0,onCancel:function(){s()},confirmLoading:_,okButtonProps:{disabled:C},width:720,afterClose:function(){j(!1),Z([]),f.resetFields()},okText:"确认",cancelText:"取消",children:(0,$.jsxs)(J.Z,{form:f,colon:!1,labelCol:{span:3},onFinish:S,className:X,children:[(0,$.jsx)(J.Z.Item,{label:"姓名",name:"name",rules:[{required:!0,message:"请输入主审专家姓名"},{whitespace:!0,message:"请输入主审专家姓名"},{max:50,message:"只能输入50个字符"}],children:(0,$.jsx)(U.Z,{maxLength:50,placeholder:"请输入主审专家姓名"})}),(0,$.jsx)(J.Z.Item,{label:"职称",name:"title",rules:[{required:!0,message:"请输入职称"},{whitespace:!0,message:"请输入职称"},{max:100,message:"只能输入100个字符"}],children:(0,$.jsx)(U.Z,{maxLength:100,placeholder:"请输入职称"})}),(0,$.jsx)(J.Z.Item,{label:"简介",name:"profile",rules:[{required:!0,message:"请输入简介"}],children:(0,$.jsx)(U.Z.TextArea,{rows:4,placeholder:"请输入简介",maxLength:300})}),(0,$.jsx)(J.Z.Item,{name:"cover_id",label:"照片",rules:[{required:!0,message:"请上传照片"}],children:(0,$.jsx)(Y.Z,{ButtonText:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)("i",{className:"iconfont icon-shangchuanfujian r5 font14"}),(0,$.jsx)("span",{className:"ml5",children:"上传照片"})]})})}),(0,$.jsx)(J.Z.Item,{label:"审核教材",name:"publisher",rules:[{required:!1,message:"请输入简介"}],children:(0,$.jsx)(J.Z.List,{name:"data",children:function(e,n){var i=n.add,s=n.remove;return(0,$.jsxs)($.Fragment,{children:[e.map((function(e){var n=e.key,a=e.name,r=M()(e,ee);return(0,$.jsxs)(V.Z,{style:{display:"flex",alignItems:"center",marginBottom:8,background:"#F6F7F9",borderRadius:"2px",padding:20,paddingBottom:"5px"},align:"baseline",children:[(0,$.jsxs)("div",{children:[(0,$.jsx)(J.Z.Item,l()(l()({},r),{},{name:[a,"name"],label:"教材名称",labelCol:{span:4},rules:[{required:!0,message:"请输入教材名称"}],children:(0,$.jsx)(U.Z,{placeholder:"请输入教材名称",style:{width:400}})})),(0,$.jsx)(J.Z.Item,l()(l()({},r),{},{name:[a,"book_id"],label:"关联",labelCol:{span:4},rules:[{required:!1,message:"请选择"}],children:(0,$.jsx)(D.default,{placeholder:"请选择",style:{width:400},getPopupContainer:function(e){return e.parentElement},children:null==t?void 0:t.map((function(e,n){return(0,$.jsx)(D.default.Option,{value:null==e?void 0:e.id,children:null==e?void 0:e.name},n)}))})}))]}),(0,$.jsxs)("div",{style:{marginLeft:8},children:[(0,$.jsx)(H.Z,{onClick:function(){return s(a)},style:{color:"#00B187",marginRight:20}}),(0,$.jsx)(K.Z,{onClick:function(){return i()},style:{color:"#E30000"}})]})]},n)})),(0,$.jsx)(J.Z.Item,{children:(0,$.jsx)(G.op,{style:{borderRadius:"2px",marginLeft:0,marginTop:3},onClick:function(){return i()},children:"增加审核教材"})})]})}})})]})})})),te=(0,g.connect)((function(e){var n=e.homePage,t=e.loading,i=e.globalSetting,l=e.user;return{homePage:n,globalSetting:i,loading:t.models.homePage,user:l}}))((function(e){e.homePage;var n,t=e.globalSetting,i=(e.user,e.dispatch,(0,d.useState)([])),s=u()(i,2),r=s[0],c=s[1],A=(0,d.useState)(!1),M=u()(A,2),J=M[0],U=M[1],V=(0,d.useState)(!1),D=u()(V,2),W=D[0],Q=D[1],X=(0,d.useState)({page:1,limit:10,keyword:""}),H=u()(X,2),K=H[0],Y=H[1],ee=(0,d.useState)(!1),te=u()(ee,2),ie=(te[0],te[1]),le=(0,d.useState)(0),se=u()(le,2),ae=se[0],re=se[1],oe=(0,d.useState)([]),ce=u()(oe,2),ue=ce[0],de=ce[1];(0,d.useEffect)((function(){he()}),[]),(0,d.useEffect)((function(){me(!0)}),[K]);var he=function(){var e=o()(a()().mark((function e(){var n,t;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,q.ZP)("/api/core_materials/list.json",{method:"get"});case 2:-1!==(null==(n=e.sent)?void 0:n.status)&&c(null==n||null===(t=n.data)||void 0===t?void 0:t.list);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),me=function(){var e=o()(a()().mark((function e(){var n,t,i,s=arguments;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.length>0&&void 0!==s[0]&&s[0],ie(!0),e.next=4,(0,q.ZP)("/api/specialist_infos.json",{method:"get",params:l()({},K)});case 4:0==(null==(n=e.sent)?void 0:n.status)&&(U(null==n?void 0:n.can_edit),de((null==n||null===(t=n.data)||void 0===t?void 0:t.list)||[]),re(null==n||null===(i=n.data)||void 0===i?void 0:i.total)),ie(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),pe=function(){var e=o()(a()().mark((function e(n){var t,i;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==W||!W.id){e.next=7;break}return e.next=3,(0,q.ZP)("/api/specialist_infos/".concat(null==W?void 0:W.id,".json"),{method:"put",body:l()({},n)});case 3:0==(null==(t=e.sent)?void 0:t.status)&&(h.ZP.success("".concat(null!=W&&W.id?"编辑":"添加","成功")),Q(!1),me()),e.next=11;break;case 7:return e.next=9,(0,q.ZP)("/api/specialist_infos.json",{method:"post",body:l()({},n)});case 9:0==(null==(i=e.sent)?void 0:i.status)&&(h.ZP.success("添加成功"),Q(!1),me());case 11:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,$.jsxs)("section",{style:{paddingBottom:"3rem"},children:[(0,$.jsx)("div",{className:_,style:{backgroundImage:"url(".concat(O.Z.IMG_SERVER,"/").concat(null==t||null===(n=t.setting)||void 0===n?void 0:n.news_banner_url,")")},children:(0,$.jsxs)("div",{className:j,children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("div",{style:{color:"#fff",fontSize:".34rem",letterSpacing:".05rem",fontWeight:600},children:"教材主审专家"}),J&&(0,$.jsxs)("div",{className:"".concat(b),style:{width:"1.6rem"},onClick:function(){Q(!0)},children:[(0,$.jsx)("i",{className:"iconfont icon-icon_xinyong_xianxing_jijin-249",style:{marginRight:"0.05rem",fontSize:".16rem"}}),"新建主审专家"]})]}),(0,$.jsx)("div",{children:(0,$.jsx)(G.t7,{placeholder:"请输入关键字进行搜索",className:y,value:K.keyword,onChange:function(e){Y(l()(l()({},K),{},{keyword:e}))}})})]})}),null==ue?void 0:ue.map((function(e,n){var t,i,l;return(0,$.jsxs)("div",{className:Z,children:[(0,$.jsx)("div",{className:k,children:(0,$.jsxs)("div",{style:{display:"flex",height:"55px",alignItems:"center",width:"1200px"},children:[(0,$.jsx)(m.Z,{title:null==e?void 0:e.name,children:(0,$.jsx)("div",{className:w,children:null==e?void 0:e.name})}),(0,$.jsx)(m.Z,{title:null==e?void 0:e.title,children:(0,$.jsx)("div",{className:C,children:null==e?void 0:e.title})}),J&&(null==e?void 0:e.is_creator)&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(m.Z,{title:"编辑",children:(0,$.jsx)("i",{className:"iconfont icon-bianji-moren ".concat(S),onClick:function(){Q(e)}})}),(0,$.jsx)(m.Z,{title:"删除",children:(0,$.jsx)("i",{className:"iconfont icon-shanchu13 ".concat(N),onClick:function(){var n;p.Z.confirm({icon:null,title:"提示",centered:!0,content:"请确认是否删除",okText:"确定",cancelText:"取消",onOk:(n=o()(a()().mark((function n(){var t;return a()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,q.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)&&(h.ZP.info("删除成功"),me());case 4:case"end":return n.stop()}}),n)}))),function(){return n.apply(this,arguments)})})}})})]})]})}),(0,$.jsxs)("div",{className:P,children:[(0,$.jsx)("div",{className:I,children:(0,$.jsx)("img",{src:O.Z.IMG_SERVER+(null==e||null===(t=e.cover)||void 0===t?void 0:t.url),className:E})}),(0,$.jsxs)("div",{className:R,children:[(null==e||null===(i=e.data)||void 0===i?void 0:i.length)>0&&(0,$.jsxs)("div",{className:B,children:[null==e||null===(l=e.data)||void 0===l?void 0:l.map((function(e,n){return(0,$.jsx)("div",{onClick:function(){return g.history.push("/textbook/detail/".concat(null==e?void 0:e.book_id,"?backUrl=/judge"))},className:L,children:null==e?void 0:e.name},n)})),(0,$.jsx)("div",{className:F,children:"审核书籍"})]}),(0,$.jsx)("div",{className:T,children:null==e?void 0:e.profile})]})]})]},n)})),0==(null==ue?void 0:ue.length)&&(0,$.jsx)(z.Z,{}),(null==ue?void 0:ue.length)>0&&(0,$.jsxs)(v.Z,{wrap:!1,align:"middle",justify:"space-between",style:{width:"12rem",margin:".2rem auto",padding:"0 .2rem"},children:[(0,$.jsxs)(f.Z,{children:["共 ",(0,$.jsx)("span",{style:{color:"#165DFF"},children:ae||0})," 条数据"]}),(0,$.jsx)(f.Z,{children:(0,$.jsx)(x.Z,{showSizeChanger:!1,showQuickJumper:!0,current:K.page,pageSize:K.limit,onChange:function(e,n){K.page=e,Y(l()({},K)),me()},total:ae||0})})]}),(0,$.jsx)(ne,{visible:W,title:"主审专家",onCancel:function(){return Q(!1)},onOk:pe,bookList:r})]})}))}}]); |