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__Judge__Index__index.asyn...

1 line
17 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

"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),o=t.n(l),a=t(82242),r=t.n(a),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),_=t(17631),x=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,a=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],E=N[1],F=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)&&E(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(_.Z.API_SERVER,"/api/attachments.json")},c||{}),{},{onRemove:(t=o()(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(){E(null),null==C||C.onChange()};return(0,m.useEffect)((function(){(null==C?void 0:C.value)&&E({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:_.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)(x.Z,{onClick:o()(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()({},F),{},{children:(0,w.jsx)(g.op,r()(r()({style:r()({borderRadius:"2px"},null==a?void 0:a.style)},a),{},{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(82242),s=t.n(i),l=t(7557),o=t.n(l),a=t(41498),r=t.n(a),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),_=t(95237),x=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",E="content___sMnqv",F="shuji_list___FhkLj",P="shuji_list_warp___cIMiD",I="ellipsis___CyQwV",L="shenhe_icon___cRhss",B="shuming___W1km7",T="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),oe=t(37712),ae=["key","name"],re=(0,j.connect)((function(e){return{dispatch:e.dispatch,coreCurriculum:e.coreCurriculum}}))((function(e){var n=e.visible,t=e.bookList,i=e.onOk,l=e.onCancel,a=e.title,c=void 0===a?"":a,u=e.coreCurriculum,d=e.dispatch,p=(u.CoreSubjects,X.Z.useForm()),v=h()(p,1)[0],_=(0,m.useState)(!1),x=h()(_,2),g=x[0],j=x[1],w=(0,m.useState)([]),y=h()(w,2),b=(y[0],y[1]),k=(0,m.useState)(!1),Z=h()(k,2),C=Z[0];Z[1];(0,m.useEffect)((function(){if(d({type:"coreCurriculum/getCoreSubjects",payload:{page:1,limit:12}}),null!=n&&n.id){var e,t,i;v.setFieldsValue(s()(s()({},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 l=[s()(s()({},null==n?void 0:n.attachment),{},{response:{id:null==n||null===(i=n.attachment)||void 0===i?void 0:i.id}})];b(l)}}),[n]);var S=function(){var e=r()(o()().mark((function e(n){var t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:j(!0),t=s()({},n),i(t);case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,oe.jsx)(f.Z,{title:"".concat(null!=n&&n.id?"编辑":"新建").concat(c),visible:n,onOk:function(){v.submit()},centered:!0,onCancel:function(){l()},confirmLoading:g,okButtonProps:{disabled:C},width:720,afterClose:function(){j(!1),b([]),v.resetFields()},okText:"确认",cancelText:"取消",children:(0,oe.jsxs)(X.Z,{form:v,colon:!1,labelCol:{span:3},onFinish:S,className:te,children:[(0,oe.jsx)(X.Z.Item,{label:"姓名",name:"name",rules:[{required:!0,message:"请输入主审专家姓名"},{whitespace:!0,message:"请输入主审专家姓名"},{max:50,message:"只能输入50个字符"}],children:(0,oe.jsx)(K.Z,{maxLength:50,placeholder:"请输入主审专家姓名"})}),(0,oe.jsx)(X.Z.Item,{label:"职称",name:"title",rules:[{required:!0,message:"请输入职称"},{whitespace:!0,message:"请输入职称"},{max:100,message:"只能输入100个字符"}],children:(0,oe.jsx)(K.Z,{maxLength:100,placeholder:"请输入职称"})}),(0,oe.jsx)(X.Z.Item,{label:"简介",name:"profile",rules:[{required:!0,message:"请输入简介"}],children:(0,oe.jsx)(K.Z.TextArea,{rows:4,placeholder:"请输入简介",maxLength:300})}),(0,oe.jsx)(X.Z.Item,{name:"cover_id",label:"照片",rules:[{required:!0,message:"请上传照片"}],children:(0,oe.jsx)(le.Z,{showText:!0,ButtonText:(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)("i",{className:"iconfont icon-shangchuanfujian r5 font14"}),(0,oe.jsx)("span",{className:"ml5",children:"上传照片"})]})})}),(0,oe.jsx)(X.Z.Item,{label:"审核教材",name:"publisher",rules:[{required:!1,message:"请输入简介"}],children:(0,oe.jsx)(X.Z.List,{name:"data",children:function(e,n){var i=n.add,l=n.remove;return(0,oe.jsxs)(oe.Fragment,{children:[e.map((function(e){var n=e.key,o=e.name,a=Q()(e,ae);return(0,oe.jsxs)(Y.Z,{style:{display:"flex",alignItems:"center",marginBottom:8,background:"#F6F7F9",borderRadius:"2px",padding:20,paddingBottom:"5px"},align:"baseline",children:[(0,oe.jsxs)("div",{children:[(0,oe.jsx)(X.Z.Item,s()(s()({},a),{},{name:[o,"name"],label:"教材名称",labelCol:{span:4},rules:[{required:!0,message:"请输入教材名称"}],children:(0,oe.jsx)(K.Z,{placeholder:"请输入教材名称",style:{width:400}})})),(0,oe.jsx)(X.Z.Item,s()(s()({},a),{},{name:[o,"book_id"],label:"关联",labelCol:{span:4},rules:[{required:!1,message:"请选择"}],children:(0,oe.jsx)($.default,{placeholder:"请选择",style:{width:400},getPopupContainer:function(e){return e.parentElement},children:null==t?void 0:t.map((function(e,n){return(0,oe.jsx)($.default.Option,{value:null==e?void 0:e.id,children:null==e?void 0:e.name},n)}))})}))]}),(0,oe.jsxs)("div",{style:{marginLeft:8},children:[(0,oe.jsx)(ie.Z,{onClick:function(){return l(o)},style:{color:"#00B187",marginRight:20}}),(0,oe.jsx)(se.Z,{onClick:function(){return i()},style:{color:"#E30000"}})]})]},n)})),(0,oe.jsx)(X.Z.Item,{children:(0,oe.jsx)(U.op,{style:{borderRadius:"2px",marginLeft:0,marginTop:3},onClick:function(){return i()},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),a=(0,m.useState)([]),c=h()(a,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)(!1),ee=h()($,2),ne=ee[0],te=ee[1],ie=(0,m.useState)({page:1,limit:10,keyword:""}),se=h()(ie,2),le=se[0],ae=se[1],pe=(0,m.useState)(!1),ve=h()(pe,2),fe=(ve[0],ve[1]),_e=(0,m.useState)(0),xe=h()(_e,2),ge=xe[0],je=xe[1],we=(0,m.useState)([]),ye=h()(we,2),be=ye[0],ke=ye[1],Ze=(0,m.useState)(0),Ce=h()(Ze,2),Se=Ce[0],Ne=Ce[1],Re=(0,m.useRef)(null),Ee=(0,m.useState)(""),Fe=h()(Ee,2),Pe=Fe[0],Ie=Fe[1],Le=(0,m.useState)(!1),Be=h()(Le,2),Te=Be[0],Oe=Be[1];(0,m.useEffect)((function(){ze()}),[]),(0,m.useEffect)((function(){Me(!1)}),[le]),(0,m.useEffect)((function(){if(Re.current&&be.length>0){var e=be.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}));ke(u()(e))}}),[Se]);var ze=function(){var e=r()(o()().mark((function e(){var n,t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,V.ZP)("/api/core_materials/list.json",{method:"get"});case 2:-1!==(null==(n=e.sent)?void 0:n.status)&&H(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=r()(o()().mark((function e(){var n,t,i,l,a,r,c=arguments;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=c.length>0&&void 0!==c[0]&&c[0],fe(!0),t=n?{}:s()({},le),e.next=5,(0,V.ZP)("/api/specialist_infos.json",{method:"get",params:s()({},t)});case 5:0==(null==(i=e.sent)?void 0:i.status)&&(Y(null==i?void 0:i.can_edit),Oe(null==i?void 0:i.description_permissionicture),Ie(null==i?void 0:i.description),r=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})),ke(r||[]),Ne(Se+1),je(null==i||null===(a=i.data)||void 0===a?void 0:a.total)),fe(!1);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ge=function(){var e=r()(o()().mark((function e(n){var t,i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==ne||!ne.id){e.next=7;break}return e.next=3,(0,V.ZP)("/api/specialist_infos/".concat(null==ne?void 0:ne.id,".json"),{method:"put",body:s()({},n)});case 3:0==(null==(t=e.sent)?void 0:t.status)&&(p.ZP.success("".concat(null!=ne&&ne.id?"编辑":"添加","成功")),te(!1),Me()),e.next=11;break;case 7:return e.next=9,(0,V.ZP)("/api/specialist_infos.json",{method:"post",body:s()({},n)});case 9:0==(null==(i=e.sent)?void 0:i.status)&&(p.ZP.success("添加成功"),te(!1),Me());case 11:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,oe.jsxs)("section",{style:{paddingBottom:"3rem"},children:[(0,oe.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,oe.jsxs)("div",{className:y,children:[(0,oe.jsxs)("div",{children:[(0,oe.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)}),K&&(0,oe.jsxs)("div",{style:{display:"flex"},children:[(0,oe.jsxs)("div",{className:"".concat(b),style:{width:"1rem"},onClick:function(){return te(!0)},children:[(0,oe.jsx)("i",{className:"iconfont icon-icon_xinyong_xianxing_jijin-249",style:{marginRight:"0.05rem",fontSize:".16rem"}}),"新建"]}),(0,oe.jsxs)("div",{className:"".concat(b),style:{marginLeft:".2rem",width:"1.5rem"},onClick:r()(o()().mark((function e(){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Me(!0);case 2:l({type:"classroomList/setActionTabs",payload:{key:"批量调整顺序",params:{name:"主审专家",data:be}}});case 3:case"end":return e.stop()}}),e)}))),children:[(0,oe.jsx)(me.Z,{style:{marginRight:"0.05rem",fontSize:".16rem"}}),"批量调整顺序"]})]}),Te&&(0,oe.jsxs)("div",{className:"".concat(b),style:{marginLeft:".2rem",width:"1.2rem"},onClick:r()(o()().mark((function e(){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:l({type:"classroomList/setActionTabs",payload:{key:"规划说明",params:{name:"主审专家",content:Pe}}});case 1:case"end":return e.stop()}}),e)}))),children:[(0,oe.jsx)("i",{className:"iconfont icon-icon_xinyong_xianxing_jijin-249",style:{marginRight:"0.05rem",fontSize:".16rem"}}),"规划说明"]})]}),(0,oe.jsx)("div",{children:(0,oe.jsx)(U.t7,{placeholder:"请输入关键字进行搜索",className:k,value:le.keyword,onChange:function(e){ae(s()(s()({},le),{},{keyword:e}))}})})]})}),Pe&&(0,oe.jsx)(de.Z,{style:{width:"12rem",margin:" .2rem auto",paddingBottom:"0.2rem"},value:Pe}),(0,oe.jsx)("div",{ref:Re,children:null==be?void 0:be.map((function(e,n){var t,i,l;return(0,oe.jsxs)("div",{className:Z,children:[(0,oe.jsx)("div",{className:C,style:{width:"12rem",height:"0.2rem"}}),(0,oe.jsxs)("div",{className:S,children:[(0,oe.jsx)("div",{className:N,children:(0,oe.jsx)("img",{src:J.Z.IMG_SERVER+(null==e||null===(t=e.cover)||void 0===t?void 0:t.url),className:R})}),(0,oe.jsxs)("div",{className:E,children:[(0,oe.jsxs)("div",{className:O,children:[(0,oe.jsx)(v.Z,{title:null==e?void 0:e.name,children:(0,oe.jsx)("div",{className:z,children:null==e?void 0:e.name})}),(0,oe.jsx)(v.Z,{title:null==e?void 0:e.title,children:(0,oe.jsx)("div",{className:M,children:null==e?void 0:e.title})}),K&&(null==e?void 0:e.is_creator)&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(v.Z,{title:"编辑",children:(0,oe.jsx)("i",{className:"iconfont icon-bianji-moren ".concat(G),onClick:function(){te(e)}})}),(0,oe.jsx)(v.Z,{title:"删除",children:(0,oe.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()(o()().mark((function n(){var t;return o()().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("删除成功"),Me());case 4:case"end":return n.stop()}}),n)}))),function(){return n.apply(this,arguments)})})}})})]})]}),(0,oe.jsxs)("div",{className:"".concat(T," 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,oe.jsx)("span",{className:A,onClick:function(t){t.stopPropagation(),be[n]=s()(s()({},e),{},{snapshot_showReadFull:!(null!=e&&e.snapshot_showReadFull)}),ke(u()(be))},children:null!=e&&e.snapshot_showReadFull?"展开 ":"收起"})]}),(null==e||null===(i=e.data)||void 0===i?void 0:i.length)>0&&(0,oe.jsxs)("div",{className:F,children:[(0,oe.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,oe.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:B,children:["《",null==e?void 0:e.name,"》"]},n)})),(null==e?void 0:e.books_showEllipsis)&&(0,oe.jsx)("div",{className:I,children:(null==e?void 0:e.books_showEllipsis)&&(0,oe.jsx)("div",{className:D,style:{marginRight:0},onClick:function(t){t.stopPropagation(),be[n]=s()(s()({},e),{},{books_showReadFull:!(null!=e&&e.books_showReadFull)}),ke(u()(be))},children:null!=e&&e.books_showReadFull?"展开 ":"收起"})})]}),(0,oe.jsx)("div",{className:L})]})]})]})]},n)}))}),0==(null==be?void 0:be.length)&&(0,oe.jsx)(W.Z,{}),(null==be?void 0:be.length)>0&&(0,oe.jsxs)(_.Z,{wrap:!1,align:"middle",justify:"space-between",style:{width:"12rem",margin:".2rem auto",padding:"0 .2rem"},children:[(0,oe.jsxs)(x.Z,{children:["共 ",(0,oe.jsx)("span",{style:{color:"#165DFF"},children:ge||0})," 条数据"]}),(0,oe.jsx)(x.Z,{children:(0,oe.jsx)(g.Z,{showSizeChanger:!1,showQuickJumper:!0,current:le.page,pageSize:le.limit,onChange:function(e,n){le.page=e,ae(s()({},le))},total:ge||0})})]}),(0,oe.jsx)(re,{visible:ne,title:"主审专家",onCancel:function(){return te(!1)},onOk:Ge,bookList:d}),(0,oe.jsx)(ue.Z,{getData:Me}),(0,oe.jsx)(he.Z,{getData:Me})]})}))}}]);