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
15 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],{34201:function(e,n,t){t.d(n,{Z:function(){return k}});var i=t(7557),l=t.n(i),s=t(41498),o=t.n(s),a=t(82242),r=t.n(a),c=t(79800),u=t.n(c),d=t(39647),h=t.n(d),p=t(59301),m=t(8591),v=t(59028),f=t(95237),_=t(94334),x=t(58670),g=t(66208),j="tip___bHEXo",b=t(37712),w=["ButtonText","ButtonOptions","uploadProps","showTip"],k=function(e){var n,t,i,s=e.ButtonText,a=e.ButtonOptions,c=e.uploadProps,d=e.showTip,k=h()(e,w),y=(0,p.useState)(null),Z=u()(y,2),C=Z[0],S=Z[1],R=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 m.ZP.error("您上传的不是JPEG/PNG/JPG类型文件"),v.Z.LIST_IGNORE;var n=e.size/1024/1024;return 0!=n||(m.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==k||k.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()(l()().mark((function e(n){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:N(),(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)})}),N=function(){S(null),null==k||k.onChange()};return(0,p.useEffect)((function(){(null==k?void 0:k.value)&&S({response:{id:null==k?void 0:k.value}})}),[null==k?void 0:k.value]),(0,b.jsx)("div",{id:(null==k?void 0:k.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:_.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)(x.Z,{onClick:o()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:N();case 1:case"end":return e.stop()}}),e)}))),style:{fontSize:"16px",color:"red"}})})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(v.Z,r()(r()({},R),{},{children:(0,b.jsx)(g.op,r()(r()({style:r()({borderRadius:"2px"},null==a?void 0:a.style)},a),{},{children:s}))})),d&&(0,b.jsx)("span",{className:j,children:"建议上传尺寸为472*266的图片"})]})})}},50850:function(e,n,t){t.r(n),t.d(n,{default:function(){return ce}});var i=t(82242),l=t.n(i),s=t(7557),o=t.n(s),a=t(41498),r=t.n(a),c=t(37205),u=t.n(c),d=t(79800),h=t.n(d),p=t(59301),m=t(8591),v=t(6848),f=t(43418),_=t(95237),x=t(43604),g=t(27092),j=t(8785),b="BannerStyle___nBur1",w="BannerStyleContent___BWJw0",k="DivDownPlay___UxEQf",y="CustomInputStyle___hlhUc",Z="teacherList___su0_a",C="top_bg_img___cmYFQ",S="techer_content___bgSA5",R="img___LchtM",N="teacher_img___l8Tb6",F="content___sMnqv",E="shuji_list___FhkLj",P="shuji_list_warp___cIMiD",I="ellipsis___CyQwV",B="shenhe_icon___cRhss",L="shuming___W1km7",T="shuji_jianjie___X7_wI",O="teacher_header___MrKe6",q="teacher_name___rAJpd",G="teacher_school___nvAEr",J="iconUpdate___Gab4k",z="iconDetele___xyhpb",M="expansion___zOJvl",A="expansion2___Du6w4",D=t(94334),V=(t(39293),t(92911)),U=t(66208),H=t(16644),Q=t(39647),W=t.n(Q),X=t(78241),K=t(73782),Y=t(81327),$=t(57809),ee=t(61186),ne=t.n(ee),te="form___Fxxn8",ie=(t(58670),t(52103)),le=t(45532),se=t(34201),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,s=e.onCancel,a=e.title,c=void 0===a?"":a,u=e.coreCurriculum,d=e.dispatch,m=(u.CoreSubjects,X.Z.useForm()),v=h()(m,1)[0],_=(0,p.useState)(!1),x=h()(_,2),g=x[0],j=x[1],b=(0,p.useState)([]),w=h()(b,2),k=(w[0],w[1]),y=(0,p.useState)(!1),Z=h()(y,2),C=Z[0];Z[1];(0,p.useEffect)((function(){if(d({type:"coreCurriculum/getCoreSubjects",payload:{page:1,limit:12}}),null!=n&&n.id){var e,t,i;v.setFieldsValue(l()(l()({},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=[l()(l()({},null==n?void 0:n.attachment),{},{response:{id:null==n||null===(i=n.attachment)||void 0===i?void 0:i.id}})];k(s)}}),[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=l()({},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(){s()},confirmLoading:g,okButtonProps:{disabled:C},width:720,afterClose:function(){j(!1),k([]),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)(se.Z,{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,s=n.remove;return(0,oe.jsxs)(oe.Fragment,{children:[e.map((function(e){var n=e.key,o=e.name,a=W()(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,l()(l()({},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,l()(l()({},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 s(o)},style:{color:"#00B187",marginRight:20}}),(0,oe.jsx)(le.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=(0,j.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,p.useState)([])),s=h()(i,2),a=s[0],c=s[1],d=(0,p.useState)(!1),Q=h()(d,2),W=Q[0],X=Q[1],K=(0,p.useState)(!1),Y=h()(K,2),$=Y[0],ee=Y[1],ne=(0,p.useState)({page:1,limit:10,keyword:""}),te=h()(ne,2),ie=te[0],le=te[1],se=(0,p.useState)(!1),ae=h()(se,2),ce=(ae[0],ae[1]),ue=(0,p.useState)(0),de=h()(ue,2),he=de[0],pe=de[1],me=(0,p.useState)([]),ve=h()(me,2),fe=ve[0],_e=ve[1],xe=(0,p.useState)(0),ge=h()(xe,2),je=ge[0],be=ge[1],we=(0,p.useRef)(null);(0,p.useEffect)((function(){ke()}),[]),(0,p.useEffect)((function(){ye(!0)}),[ie]),(0,p.useEffect)((function(){if(we.current&&fe.length>0){var e=fe.map((function(e,n){var t=document.getElementsByClassName("item_books_".concat(n))[0];if(t){var i=t.clientHeight,l=window.getComputedStyle(t).minHeight,s=i>parseFloat(l);e.books_showEllipsis=s,e.books_showReadFull=s}return e}));_e(u()(e))}}),[je]);var ke=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)&&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)}}(),ye=function(){var e=r()(o()().mark((function e(){var n,t,i,s,a=arguments;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a.length>0&&void 0!==a[0]&&a[0],ce(!0),e.next=4,(0,V.ZP)("/api/specialist_infos.json",{method:"get",params:l()({},ie)});case 4:0==(null==(n=e.sent)?void 0:n.status)&&(X(null==n?void 0:n.can_edit),s=null==n||null===(t=n.data)||void 0===t?void 0:t.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})),_e(s||[]),be(je+1),pe(null==n||null===(i=n.data)||void 0===i?void 0:i.total)),ce(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ze=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==$||!$.id){e.next=7;break}return e.next=3,(0,V.ZP)("/api/specialist_infos/".concat(null==$?void 0:$.id,".json"),{method:"put",body:l()({},n)});case 3:0==(null==(t=e.sent)?void 0:t.status)&&(m.ZP.success("".concat(null!=$&&$.id?"编辑":"添加","成功")),ee(!1),ye()),e.next=11;break;case 7:return e.next=9,(0,V.ZP)("/api/specialist_infos.json",{method:"post",body:l()({},n)});case 9:0==(null==(i=e.sent)?void 0:i.status)&&(m.ZP.success("添加成功"),ee(!1),ye());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:b,style:{backgroundImage:"url(".concat(D.Z.IMG_SERVER,"/").concat(null==t||null===(n=t.setting)||void 0===n?void 0:n.news_banner_url,")")},children:(0,oe.jsxs)("div",{className:w,children:[(0,oe.jsxs)("div",{children:[(0,oe.jsx)("div",{style:{color:"#fff",fontSize:".34rem",letterSpacing:".05rem",fontWeight:600},children:"教材主审专家"}),W&&(0,oe.jsxs)("div",{className:"".concat(k),style:{width:"1.6rem"},onClick:function(){ee(!0)},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:y,value:ie.keyword,onChange:function(e){le(l()(l()({},ie),{},{keyword:e}))}})})]})}),(0,oe.jsx)("div",{ref:we,children:null==fe?void 0:fe.map((function(e,n){var t,i,s;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:R,children:(0,oe.jsx)("img",{src:D.Z.IMG_SERVER+(null==e||null===(t=e.cover)||void 0===t?void 0:t.url),className:N})}),(0,oe.jsxs)("div",{className:F,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:q,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:G,children:null==e?void 0:e.title})}),W&&(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(J),onClick:function(){ee(e)}})}),(0,oe.jsx)(v.Z,{title:"删除",children:(0,oe.jsx)("i",{className:"iconfont icon-shanchu13 ".concat(z),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)&&(m.ZP.info("删除成功"),ye());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:M,onClick:function(t){t.stopPropagation(),fe[n]=l()(l()({},e),{},{snapshot_showReadFull:!(null!=e&&e.snapshot_showReadFull)}),_e(u()(fe))},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:E,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===(s=e.data)||void 0===s?void 0:s.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")):m.ZP.warning("该书籍未关联内容")},className:L,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:A,style:{marginRight:0},onClick:function(t){t.stopPropagation(),fe[n]=l()(l()({},e),{},{books_showReadFull:!(null!=e&&e.books_showReadFull)}),_e(u()(fe))},children:null!=e&&e.books_showReadFull?"展开 ":"收起"})})]}),(0,oe.jsx)("div",{className:B})]})]})]})]},n)}))}),0==(null==fe?void 0:fe.length)&&(0,oe.jsx)(H.Z,{}),(null==fe?void 0:fe.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:he||0})," 条数据"]}),(0,oe.jsx)(x.Z,{children:(0,oe.jsx)(g.Z,{showSizeChanger:!1,showQuickJumper:!0,current:ie.page,pageSize:ie.limit,onChange:function(e,n){ie.page=e,le(l()({},ie)),ye()},total:he||0})})]}),(0,oe.jsx)(re,{visible:$,title:"主审专家",onCancel:function(){return ee(!1)},onOk:Ze,bookList:a})]})}))}}]);