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
16 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 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),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),b=["ButtonText","ButtonOptions","uploadProps","showTip","showText","showListening","imgWidth"],k=function(e){var n,t,i,s=e.ButtonText,a=e.ButtonOptions,c=e.uploadProps,d=e.showTip,k=e.showText,y=e.showListening,Z=e.imgWidth,C=h()(e,b),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()(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(){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()(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,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:s}))})),d&&(0,w.jsx)("span",{className:j,children:"建议上传尺寸为472*266的图片"}),k&&(0,w.jsx)("span",{className:j,style:{width:"4rem"},children:"需上传尺寸为200*268的图片大小不超过2MB"}),y&&(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 ue}});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),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",b="BannerStyleContent___BWJw0",k="DivDownPlay___UxEQf",y="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",B="shenhe_icon___cRhss",T="shuming___W1km7",L="shuji_jianjie___X7_wI",O="teacher_header___MrKe6",M="teacher_name___rAJpd",G="teacher_school___nvAEr",q="iconUpdate___Gab4k",z="iconDetele___xyhpb",J="expansion___zOJvl",A="expansion2___Du6w4",D=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)),le=t(32134),se=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,s=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)([]),b=h()(w,2),k=(b[0],b[1]),y=(0,m.useState)(!1),Z=h()(y,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(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,{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,s=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,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=t(20731),ue=(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,i=e.globalSetting,s=(e.user,e.dispatch,(0,m.useState)([])),a=h()(s,2),c=a[0],d=a[1],H=(0,m.useState)(!1),Q=h()(H,2),X=Q[0],K=Q[1],Y=(0,m.useState)(!1),$=h()(Y,2),ee=$[0],ne=$[1],te=(0,m.useState)({page:1,limit:10,keyword:""}),ie=h()(te,2),le=ie[0],se=ie[1],ae=(0,m.useState)(!1),ue=h()(ae,2),de=(ue[0],ue[1]),he=(0,m.useState)(0),me=h()(he,2),pe=me[0],ve=me[1],fe=(0,m.useState)([]),_e=h()(fe,2),xe=_e[0],ge=_e[1],je=(0,m.useState)(0),we=h()(je,2),be=we[0],ke=we[1],ye=(0,m.useRef)(null);(0,m.useEffect)((function(){Ze()}),[]),(0,m.useEffect)((function(){Ce(!0)}),[le]),(0,m.useEffect)((function(){if(ye.current&&xe.length>0){var e=xe.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}));ge(u()(e))}}),[be]);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)&&d(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)}}(),Ce=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],de(!0),e.next=4,(0,V.ZP)("/api/specialist_infos.json",{method:"get",params:l()({},le)});case 4:0==(null==(n=e.sent)?void 0:n.status)&&(K(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})),ge(s||[]),ke(be+1),ve(null==n||null===(i=n.data)||void 0===i?void 0:i.total)),de(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Se=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==ee||!ee.id){e.next=7;break}return e.next=3,(0,V.ZP)("/api/specialist_infos/".concat(null==ee?void 0:ee.id,".json"),{method:"put",body:l()({},n)});case 3:0==(null==(t=e.sent)?void 0:t.status)&&(p.ZP.success("".concat(null!=ee&&ee.id?"编辑":"添加","成功")),ne(!1),Ce()),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)&&(p.ZP.success("添加成功"),ne(!1),Ce());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(D.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:b,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)}),X&&(0,oe.jsxs)("div",{className:"".concat(k),style:{width:"1rem"},onClick:function(){ne(!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:le.keyword,onChange:function(e){se(l()(l()({},le),{},{keyword:e}))}})})]})}),(0,oe.jsx)("div",{ref:ye,children:null==xe?void 0:xe.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:N,children:(0,oe.jsx)("img",{src:D.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:M,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})}),X&&(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(q),onClick:function(){ne(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)&&(p.ZP.info("删除成功"),Ce());case 4:case"end":return n.stop()}}),n)}))),function(){return n.apply(this,arguments)})})}})})]})]}),(0,oe.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,oe.jsx)("span",{className:J,onClick:function(t){t.stopPropagation(),xe[n]=l()(l()({},e),{},{snapshot_showReadFull:!(null!=e&&e.snapshot_showReadFull)}),ge(u()(xe))},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===(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")):p.ZP.warning("该书籍未关联内容")},className:T,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(),xe[n]=l()(l()({},e),{},{books_showReadFull:!(null!=e&&e.books_showReadFull)}),ge(u()(xe))},children:null!=e&&e.books_showReadFull?"展开 ":"收起"})})]}),(0,oe.jsx)("div",{className:B})]})]})]})]},n)}))}),0==(null==xe?void 0:xe.length)&&(0,oe.jsx)(W.Z,{}),(null==xe?void 0:xe.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:pe||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,se(l()({},le)),Ce()},total:pe||0})})]}),(0,oe.jsx)(re,{visible:ee,title:"主审专家",onCancel:function(){return ne(!1)},onOk:Se,bookList:c})]})}))}}]);