|
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[72570],{96291:function(e,n,t){t.r(n),t.d(n,{default:function(){return De}});var i=t(82242),l=t.n(i),r=t(7557),a=t.n(r),s=t(41498),o=t.n(s),d=t(79800),u=t.n(d),c=t(39647),p=t.n(c),f=t(59301),v=t(75102),m=t(46587),h=t(63490),x=t(46651),_=t(8591),g=t(43418),y=t(93737),j=t(68446),b=t(37712),Z=x.Z.Dragger,k=(0,v.connect)((function(e){return{user:e.user,classroomList:e.classroomList,shixunsDetail:e.shixunsDetail}}))((function(e){var n=e.user,t=e.dispatch,i=(e.classroomList,e.shixunsDetail),r=e.getResults,s=((0,v.useParams)(),(0,f.useState)()),d=u()(s,2),c=(d[0],d[1],(0,f.useState)([])),p=u()(c,2),m=p[0],h=p[1],x=(0,f.useState)(!1),k=u()(x,2),w=k[0],S=k[1],I={onRemove:function(){h([])},beforeUpload:function(e){if(console.log(e),(null==e?void 0:e.size)>524288e3)return _.ZP.info("文件超过500M,不符合上传要求"),!1;var n=[];return n.push(e),h([].concat(n)),!1},fileList:m};return(0,b.jsx)(g.Z,{title:"提交文件",open:"md-tab"===i.actionTabs.key,confirmLoading:w,onOk:o()(a()().mark((function e(){var l,s,o;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((null==m?void 0:m.length)<=0)){e.next=3;break}return _.ZP.info("请先选择文件"),e.abrupt("return");case 3:return S(!0),e.next=6,(0,j.cT)(m[0],{login:null===(l=n.userInfo)||void 0===l?void 0:l.login,container_type:"Competition",container_id:i.actionTabs.params.id,stage_type:i.actionTabs.params.value,file_name:null===(s=m[0])||void 0===s?void 0:s.name});case 6:0===(null==(o=e.sent)?void 0:o.status)?(_.ZP.info("提交成功"),t({type:"shixunsDetail/setActionTabs",payload:{key:""}}),S(!1),h([]),r(i.actionTabs.params.value)):(S(!1),_.ZP.info("提交失败"));case 8:case"end":return e.stop()}}),e)}))),onCancel:function(){h([]),t({type:"shixunsDetail/setActionTabs",payload:{key:""}})},children:(0,b.jsxs)(Z,l()(l()({},I),{},{children:[(0,b.jsx)("p",{className:"ant-upload-drag-icon",children:(0,b.jsx)(y.Z,{})}),(0,b.jsx)("p",{className:"ant-upload-hint",children:"拖拽文件或者点击上传"})]}))})})),w=t(66104),S=t(71418),I=t(3113),C=t(20834),P=t(28388),R=t(95237),D=t(98135),E=t(22107),N=t(10032),L=t(73759),z=t(57809),T=t(9951),F=t(11407),A=t(88845),H=z.default.Option;var M=function(e){var n=e.rewarddata,t=e.getlistdatas,i=e.is_signed,l=e.dispatch,r=e.userlist,s=(0,f.useRef)(null),d=(0,f.useState)(!1),c=u()(d,2),p=c[0],v=c[1],h=(0,f.useState)(void 0),x=u()(h,2),y=x[0],j=x[1],Z=(0,f.useState)(""),k=u()(Z,2),w=k[0],S=k[1],I=(0,f.useState)(void 0),C=u()(I,2),P=C[0],R=C[1],N=(0,f.useState)(void 0),M=u()(N,2),B=M[0],V=M[1],Y=(0,f.useState)(void 0),q=u()(Y,2),O=q[0],G=q[1];function W(e){return J.apply(this,arguments)}function J(){return(J=o()(a()().mark((function e(n){var r;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n.user_received){e.next=3;break}return window.open(n.click_info),e.abrupt("return");case 3:if((0,L.o1)(l)){e.next=5;break}return e.abrupt("return");case 5:if(!1!==i){e.next=8;break}return _.ZP.info("您尚未报名参赛,请报名参赛后领取"),e.abrupt("return");case 8:if("Pop"!==n.click_event){e.next=14;break}return S(n.id),v(!0),e.abrupt("return");case 14:j(void 0);case 15:return e.next=17,l({type:"competitions/Reward",payload:{competition_module_setting_id:n.id}});case 17:(r=e.sent)&&0===r.status&&(t(),"Link"===n.click_event?(_.ZP.info("领取成功"),window.open(n.click_info)):_.ZP.info(n.click_info));case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function U(){return(U=o()(a()().mark((function e(){var n;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r||r.real_name){e.next=4;break}if(P){e.next=4;break}return _.ZP.info("姓名不能为空"),e.abrupt("return");case 4:if(!r||r.email){e.next=8;break}if(B){e.next=8;break}return _.ZP.info("邮箱不能为空"),e.abrupt("return");case 8:if(!r||r.phone){e.next=12;break}if(O){e.next=12;break}return _.ZP.info("手机号码不能为空"),e.abrupt("return");case 12:if(y){e.next=15;break}return _.ZP.info("请选择你的年级"),e.abrupt("return");case 15:return e.next=17,l({type:"competitions/Reward",payload:{competition_module_setting_id:w,className:y,name:P,mail:B,phone:O}});case 17:(n=e.sent)&&0===n.status&&(v(!1),t(),_.ZP.info("HCIA认证考试代金劵将由Educoder平台统一发放,请及时关注邮箱或站内短信查收"));case 19:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return(0,b.jsxs)("div",{children:[(0,b.jsxs)(g.Z,{open:p,title:"完善信息",onCancel:function(){return v(!1)},onOk:function(){!function(){U.apply(this,arguments)}()},children:[(0,b.jsxs)("p",{children:["您的姓名:",(0,b.jsx)(D.Z,{className:r&&r.real_name?"":m.Z.bkfff,style:{width:"300px",marginLeft:"14px",background:r&&r.phone?"":"#ffffff!important"},value:r&&r.real_name||P,disabled:r&&r.real_name||!1,onChange:function(e){return R(e.target.value)}})]}),(0,b.jsxs)("p",{style:{marginTop:"1em"},children:["您的邮箱:",(0,b.jsx)(D.Z,{className:r&&r.email?"":"bkfff",style:{width:"300px",marginLeft:"14px",background:r&&r.phone?"":"#ffffff!important"},value:r&&r.email||B,disabled:r&&r.email||!1,onChange:function(e){return V(e.target.value)}})]}),(0,b.jsxs)("p",{style:{marginTop:"1em"},children:["您的手机号:",(0,b.jsx)(D.Z,{style:{width:"300px"},className:r&&r.phone?"":"bkfff",value:r&&r.phone||O,disabled:r&&r.phone||!1,onChange:function(e){return G(e.target.value)}})]}),"您的年级:",(0,b.jsxs)(z.default,{style:{width:"300px",marginTop:"1em",marginLeft:"14px"},onChange:function(e){j(e)},children:[(0,b.jsx)(H,{value:"大一",children:"大一"}),(0,b.jsx)(H,{value:"大二",children:"大二"}),(0,b.jsx)(H,{value:"大三",children:"大三"}),(0,b.jsx)(H,{value:"大四",children:"大四"}),(0,b.jsx)(H,{value:"大五",children:"大五"}),(0,b.jsx)(H,{value:"硕一",children:"硕一"}),(0,b.jsx)(H,{value:"硕二",children:"硕二"}),(0,b.jsx)(H,{value:"硕三",children:"硕三"}),(0,b.jsx)(H,{value:"博一",children:"博一"}),(0,b.jsx)(H,{value:"博二",children:"博二"}),(0,b.jsx)(H,{value:"博三",children:"博三"}),(0,b.jsx)(H,{value:"博四",children:"博四"}),(0,b.jsx)(H,{value:"博五",children:"博五"})]}),(0,b.jsx)("p",{style:{marginTop:"1em"},children:"提醒:如无华为云账号,请尽快注册华为云!"})]}),n&&n.length>3?(0,b.jsxs)("div",{style:{position:"relative",marginBottom:"10px",marginTop:"10px"},children:[(0,b.jsx)("span",{className:m.Z.spanprev,onClick:function(){s.current.prev()},children:(0,b.jsx)(F.Z,{style:{color:"#fff",fontSize:"20px",marginLeft:"15px"}})}),(0,b.jsx)(T.Z,{ref:s,className:m.Z.divwidth,slidesToShow:3,slidesToScroll:1,children:n&&n.map((function(e,n){return(0,b.jsxs)("div",{style:{textAlign:"center",position:"relative"},children:[(0,b.jsx)("img",{src:E.Z.IMG_SERVER+"/".concat(e.image_url)}),!1===e.user_received||"Link"===e.click_event?(0,b.jsx)("p",{className:m.Z.receiveclick,onClick:function(){return W(e)},children:"点击领取"}):(0,b.jsx)("p",{className:m.Z.receivealready,children:"已经领取"})]})}))}),(0,b.jsx)("span",{className:m.Z.spannext,onClick:function(){s.current.next()},children:(0,b.jsx)(A.Z,{style:{color:"#fff",fontSize:"20px",marginLeft:"5px"}})})]}):(0,b.jsx)("div",{className:m.Z.divwidth,style:{justifyContent:"space-around",marginBottom:"10px",marginTop:"10px"},children:n&&n.map((function(e,n){return(0,b.jsxs)("div",{style:{textAlign:"center",position:"relative"},children:[(0,b.jsx)("img",{src:E.Z.IMG_SERVER+"/".concat(e.image_url)}),!1===e.user_received||"Link"===e.click_event?(0,b.jsx)("p",{className:m.Z.receiveclick,onClick:function(){return W(e)},children:"点击领取"}):(0,b.jsx)("p",{className:m.Z.receivealready,children:"已经领取"})]})}))})]})},B=function(e,n){var t=e.StaffDetail,i=e.HeaderDetail,r=e.ItemData,s=e.setIssee,d=e.ModelType,c=e.dispatch,p=e.userinfo,m=e.Editable,h=(0,f.useState)(!1),y=u()(h,2),j=y[0],Z=y[1],k=(0,f.useState)([]),w=u()(k,2),S=w[0],C=w[1],z=(0,f.useState)(""),T=u()(z,2),F=T[0],A=T[1],H=(0,f.useState)(""),B=u()(H,2),V=B[0],Y=B[1],q=(0,f.useState)(!1),O=u()(q,2),G=O[0],W=O[1],J=(0,v.useParams)().identifier,U=(0,f.useRef)(null),K=(0,f.useRef)(null);U.current=null==t?void 0:t.enrolled,(0,f.useEffect)((function(){var e;return null===(e=K.current)||void 0===e||e.addEventListener("click",Q),function(){var e;null===(e=K.current)||void 0===e||e.removeEventListener("click",Q)}}),[]);var Q=function(e){var n;if("modal-upload"===(null==e||null===(n=e.target)||void 0===n?void 0:n.id)){if(!(0,L.tJ)(c))return;if(!U.current)return void g.Z.info({title:"提示",centered:!0,okText:"我知道了",content:"请先报名,再提交作品"});Z(!0)}};(0,f.useEffect)((function(){var e,n;null!=i&&i.upload_file&&(C([{name:null==i||null===(e=i.upload_file)||void 0===e?void 0:e.title,status:"done",uid:"123456789"}]),Y(null==i?void 0:i.upload_file_url),A(null==i||null===(n=i.upload_file)||void 0===n||null===(n=n.url)||void 0===n?void 0:n.split("/")[3]))}),[null==i?void 0:i.upload_file]);var X={name:"file",multiple:!1,withCredentials:!0,action:E.Z.API_SERVER+"/api/attachments.json",showUploadList:{showRemoveIcon:!1},fileList:S,onChange:function(e){var n,t=e.file.status,i=[l()({},e.file)];(C(i),"uploading"===e.file.status&&W(!0),"done"===t)&&(A(null===(n=i[0])||void 0===n||null===(n=n.response)||void 0===n?void 0:n.id),W(!1));"error"===t&&(C([]),W(!1))},beforeUpload:function(e){return e.size/1024/1024<1e3?Promise.resolve():(_.ZP.info("文件大小必须小于1000MB"),Promise.reject())}},$=function(){Z(!0)};return(0,f.useImperativeHandle)(n,(function(){return{handleVisible:$}})),(0,b.jsxs)("div",{ref:K,children:["reward"===d?(0,b.jsx)(M,{userlist:p,dispatch:c,rewarddata:r.reward_setting,is_signed:r.is_signed}):null,(0,b.jsx)("div",{style:{textAlign:"right"},children:((null==p?void 0:p.admin)||(null==p?void 0:p.business)||m)&&(0,b.jsx)(I.ZP,{onClick:function(){return s(!1)},children:"编辑"})}),(0,b.jsx)(P.Z,{value:r.md_content||"暂无"}),r&&r.attachments&&r.attachments.map((function(e,n){return(0,b.jsx)("div",{children:(0,b.jsxs)("a",{href:(null===E.Z||void 0===E.Z?void 0:E.Z.API_SERVER)+e.url,target:"_self",download:e.title,children:[(0,b.jsx)("i",{style:{color:"#29BD8B"},className:"font-14 color-green iconfont icon-fujian mr8"}),(0,b.jsx)("span",{style:{color:"#000000"},children:e.title}),(0,b.jsx)("span",{style:{color:"#000000",marginLeft:"10px"},children:e.filesize})]})})})),(0,b.jsx)(g.Z,{centered:!0,title:"上传作品",open:j,okText:"提交作品",cancelText:"取消",confirmLoading:G,onCancel:function(){return Z(!1)},onOk:o()(a()().mark((function e(){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(F||V){e.next=3;break}return Z(!1),e.abrupt("return");case 3:return W(!0),e.next=6,(0,N.ZP)("/api/competitions/".concat(J,"/upload_file.json"),{method:"post",body:{attachment_id:F,upload_file_url:V}});case 6:0===e.sent.status&&(Z(!1),W(!1));case 8:case"end":return e.stop()}}),e)}))),children:(0,b.jsxs)("div",{children:[(0,b.jsxs)(R.Z,{align:"middle",className:"mb20",children:[(0,b.jsx)("span",{children:"作品链接:"}),(0,b.jsx)(D.Z,{style:{width:416},value:V,onChange:function(e){var n;return Y(null===(n=e.target)||void 0===n?void 0:n.value)}})]}),(0,b.jsxs)(R.Z,{align:"top",children:[(0,b.jsx)("span",{style:{lineHeight:"28px"},children:"作品文件:"}),(0,b.jsx)(x.Z,l()(l()({},X),{},{children:(0,b.jsx)(I.ZP,{type:"primary",className:"mb10",children:"上传作品"})}))]})]})})]})},V=(0,f.forwardRef)(B),Y=t(70464),q=t(58899);var O=function(e){var n=e.ItemData,t=e.setIssee,i=e.MenuItem,r=e.dispatch,s=e.identifier,d=e.ModelType,c=e.userinfo,p=e.getrightdatas,v=(0,f.useState)([]),m=u()(v,2),h=m[0],g=m[1],y=(0,f.useState)(n.md_content),j=u()(y,2),Z=j[0],k=j[1];(0,f.useEffect)((function(){var e,t=[];null==n||null===(e=n.attachments)||void 0===e||e.map((function(e){var n={uid:e.id,name:e.title,response:{id:e.id}};t.push(n)})),g(t)}),[null==n?void 0:n.attachments]);var w,S,C={name:"file",multiple:!0,withCredentials:!0,action:E.Z.API_SERVER+"/api/attachments.json",defaultFileList:(S=[],null==n||null===(w=n.attachments)||void 0===w||w.map((function(e){var n={uid:null==e?void 0:e.id,name:e.title,response:{id:e.id}};S.push(n)})),S),onRemove:function(e){(0,q.y8)({id:e.uid})},onChange:function(e){var n=e.file.status;"removed"===n&&g(e.fileList),"done"===n?(g(e.fileList),_.ZP.success("".concat(e.file.name," 文件上传成功"))):"error"===n&&_.ZP.error("".concat(e.file.name," 文件上传失败"))},beforeUpload:function(e){var n=e.size/1024/1024<150;return n||_.ZP.info("文件大小必须小于150MB"),n}};function P(){return(P=o()(a()().mark((function e(){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r({type:"competitions/updateMdContent",payload:{attachment_ids:R(h),competition_module_id:n.id,md_content_id:n.md_id,content:Z,identifier:s}});case 2:e.sent&&(_.ZP.info("提交成功"),t(!0),p(i));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function R(e){var n=[];return e&&e.map((function(e){n.push(e.response.id)})),n}return console.log(C),(0,b.jsxs)("div",{children:["reward"===d?(0,b.jsx)(M,{userlist:c,dispatch:r,rewarddata:n.reward_setting,is_signed:n.is_signed}):null,(0,b.jsx)(Y.Z,{defaultValue:Z,onChange:function(e){return k(e)}}),(0,b.jsxs)(x.Z,l()(l()({},C),{},{children:[(0,b.jsx)(I.ZP,{className:"uploadBtn",children:"上传附件"}),"(单个文件150M以内)"]})),(0,b.jsxs)("p",{style:{marginTop:"10px"},children:[(0,b.jsx)(I.ZP,{style:{width:"90px"},type:"primary",onClick:function(){return function(){return P.apply(this,arguments)}()},children:"提交"}),(0,b.jsx)(I.ZP,{style:{marginLeft:"30px",width:"90px"},onClick:function(){return t(!0)},children:"取消"})]})]})},G=t(99313),W=t(14491);var J=function(){return(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{style:{fontSize:"24px",color:"#05101a"},children:"总排行"}),(0,b.jsxs)("div",{style:{textAlign:"center"},children:[(0,b.jsx)("img",{src:E.Z.IMG_SERVER+"/images/educoder/competitions/trophy.png"}),(0,b.jsx)("p",{children:"要抓住一切机会,向所有人证明自己,证明你能够迎接荣耀"})]})]})},U=t(43604),K=t(18889);var Q=function(e){var n=e.oneItem,t=e.towItem,i=e.threeItem;return(0,b.jsx)("div",{style:{textAlign:"center"},children:(0,b.jsxs)(R.Z,{gutter:16,style:{justifyContent:"center"},children:[(0,b.jsx)(U.Z,{span:6,style:{marginTop:"30px",marginRight:"20px"},children:(0,b.jsxs)(K.Z,{title:(0,b.jsxs)("div",{className:m.Z.towtop,children:[(0,b.jsx)("img",{style:{marginTop:"20px"},src:E.Z.IMG_SERVER+"/images/educoder/huangguan-two.png"}),(0,b.jsx)("p",{style:{marginTop:"10px"},children:(0,b.jsxs)(v.Link,{to:"/users/".concat(null==t?void 0:t.user_login,"/classrooms"),children:[(0,b.jsx)("img",{className:m.Z.imgradius,src:E.Z.IMG_SERVER+"/images/".concat(null==t?void 0:t.user_image)}),(null==t?void 0:t.competition_prize)&&(0,b.jsx)("p",{className:m.Z.prize,children:null==t?void 0:t.competition_prize}),(0,b.jsx)("p",{style:{color:"#05101a",fontSize:"16px",marginTop:"10px"},children:null==t?void 0:t.record_user_name})]})})]}),className:m.Z.towdiv,bordered:!1,children:[(0,b.jsx)("p",{style:{fontSize:"14px"},children:null==t?void 0:t.school_name}),(0,b.jsx)("p",{style:{fontSize:"18px"},children:null==t?void 0:t.spend_time}),(0,b.jsxs)("p",{style:{fontSize:"26px",color:"#a55b29"},children:[parseFloat(null==t?void 0:t.extra_score)+parseFloat(null==t?void 0:t.score),"分"]})]})}),(0,b.jsx)(U.Z,{span:6,children:(0,b.jsxs)(K.Z,{title:(0,b.jsxs)("div",{className:m.Z.onetop,children:[(0,b.jsx)("img",{style:{marginTop:"20px"},src:E.Z.IMG_SERVER+"/images/educoder/huangguan.png"}),(0,b.jsx)("p",{style:{marginTop:"10px"},children:(0,b.jsxs)(v.Link,{to:"/users/".concat(null==n?void 0:n.user_login,"/classrooms"),children:[(0,b.jsx)("img",{className:m.Z.imgradius,src:E.Z.IMG_SERVER+"/images/".concat(null==n?void 0:n.user_image)}),(null==n?void 0:n.competition_prize)&&(0,b.jsx)("p",{className:m.Z.prize,children:null==n?void 0:n.competition_prize}),(0,b.jsx)("p",{style:{color:"#05101a",fontSize:"16px",marginTop:"10px"},children:null==n?void 0:n.record_user_name})]})})]}),className:m.Z.onediv,bordered:!1,children:[(0,b.jsx)("p",{style:{fontSize:"14px"},children:null==n?void 0:n.school_name}),(0,b.jsx)("p",{style:{fontSize:"18px"},children:null==n?void 0:n.spend_time}),(0,b.jsxs)("p",{style:{fontSize:"26px",color:"#a55b29"},children:[parseFloat(null==n?void 0:n.extra_score)+parseFloat(null==n?void 0:n.score),"分"]})]})}),(0,b.jsx)(U.Z,{span:6,style:{marginTop:"40px",marginLeft:"20px"},children:(0,b.jsxs)(K.Z,{title:(0,b.jsxs)("div",{className:m.Z.threetop,children:[(0,b.jsx)("img",{style:{marginTop:"20px"},src:E.Z.IMG_SERVER+"/images/educoder/huangguan-three.png"}),(0,b.jsx)("p",{style:{marginTop:"10px"},children:(0,b.jsxs)(v.Link,{to:"/users/".concat(null==i?void 0:i.user_login,"/classrooms"),children:[(0,b.jsx)("img",{className:m.Z.imgradius,src:E.Z.IMG_SERVER+"/images/".concat(null==i?void 0:i.user_image)}),(null==i?void 0:i.competition_prize)&&(0,b.jsx)("p",{className:m.Z.prize,children:null==i?void 0:i.competition_prize}),(0,b.jsx)("p",{style:{color:"#05101a",fontSize:"16px",marginTop:"10px"},children:null==i?void 0:i.record_user_name})]})})]}),className:m.Z.threediv,bordered:!1,children:[(0,b.jsx)("p",{style:{fontSize:"14px"},children:null==i?void 0:i.school_name}),(0,b.jsx)("p",{style:{fontSize:"18px"},children:null==i?void 0:i.spend_time}),(0,b.jsxs)("p",{style:{fontSize:"26px",color:"#a55b29"},children:[parseFloat(null==i?void 0:i.extra_score)+parseFloat(null==i?void 0:i.score),"分"]})]})})]})})},X=t(6848);var $=function(e){var n,t,i,l,r,a,s,o,d,u,c,p,f,h,x,_,g=e.ItemData;return(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{style:{fontSize:"24px",color:"#05101a"},children:"总排行"}),(0,b.jsx)(Q,{oneItem:null==g?void 0:g.teams[0],towItem:null==g?void 0:g.teams[1],threeItem:null==g?void 0:g.teams[2]}),(null==g||null===(n=g.user_ranks)||void 0===n?void 0:n.length)>0&&(0,b.jsxs)("div",{className:m.Z.myTeam,children:[!1===(null==g||null===(t=g.user_ranks)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.success)?(0,b.jsxs)("span",{style:{marginRight:"70px",padding:"10px"},children:[(0,b.jsxs)("p",{style:{marginBottom:"0px"},children:[" 是否晋级:",(0,b.jsx)("span",{style:{color:!1===(null==g||null===(i=g.user_ranks)||void 0===i||null===(i=i[0])||void 0===i?void 0:i.success)?"red":"green"},children:!1===(null==g||null===(l=g.user_ranks)||void 0===l||null===(l=l[0])||void 0===l?void 0:l.success)?"否":null!=g&&null!==(r=g.user_ranks)&&void 0!==r&&null!==(r=r[0])&&void 0!==r&&r.success?"是":""})]}),(null==g||null===(a=g.user_ranks)||void 0===a||null===(a=a[0])||void 0===a?void 0:a.awards)&&(0,b.jsxs)("p",{style:{marginBottom:"0px"},children:[" 是否获奖:",(0,b.jsx)("span",{children:"percent_20"===(null==g||null===(s=g.user_ranks)||void 0===s||null===(s=s[0])||void 0===s?void 0:s.awards)?"二等奖":"percent_30"===(null==g||null===(o=g.user_ranks)||void 0===o||null===(o=o[0])||void 0===o?void 0:o.awards)?"三等奖":"没有获得奖项"})]})]}):(0,b.jsxs)("span",{style:{marginRight:"70px"},children:["我的排名:",null==g||null===(d=g.user_ranks)||void 0===d||null===(d=d[0])||void 0===d?void 0:d.rank]}),(0,b.jsx)("span",{style:{flex:1},children:(0,b.jsx)(X.Z,{title:"战队名",children:null==g||null===(u=g.user_ranks)||void 0===u||null===(u=u[0])||void 0===u?void 0:u.team_name})}),(0,b.jsx)("span",{style:{flex:1},children:(0,b.jsx)(X.Z,{title:"时间",children:null==g||null===(c=g.user_ranks)||void 0===c||null===(c=c[0])||void 0===c?void 0:c.cost_time})}),(0,b.jsx)("span",{style:{flex:1,textAlign:"center"},children:(0,b.jsx)(X.Z,{title:"赋能赛加分",children:null==g||null===(p=g.user_ranks)||void 0===p||null===(p=p[0])||void 0===p?void 0:p.extra_score})}),(0,b.jsx)("span",{style:{flex:1},children:(0,b.jsx)(X.Z,{title:"比赛成绩",children:null==g||null===(f=g.user_ranks)||void 0===f||null===(f=f[0])||void 0===f?void 0:f.score})}),(0,b.jsx)("span",{children:(0,b.jsx)(X.Z,{title:"总分",children:parseFloat(null==g||null===(h=g.user_ranks)||void 0===h||null===(h=h[0])||void 0===h?void 0:h.extra_score)+parseFloat(null==g||null===(x=g.user_ranks)||void 0===x||null===(x=x[0])||void 0===x?void 0:x.score)||0})})]}),null==g||null===(_=g.teams)||void 0===_?void 0:_.map((function(e,n){return(0,b.jsxs)("div",{className:m.Z.bottomItem,children:[(0,b.jsx)("span",{style:{color:"#0152d9",marginRight:"20px"},children:n+1}),(0,b.jsxs)(v.Link,{to:"/users/".concat(null==e?void 0:e.user_login,"/classrooms"),style:{marginRight:"80px",position:"relative"},children:[(0,b.jsx)("img",{className:m.Z.imgradius,src:E.Z.IMG_SERVER+"/images/".concat(null==e?void 0:e.user_image)}),(null==e?void 0:e.competition_prize)&&(0,b.jsx)("span",{className:m.Z.spanrightradius,children:null==e?void 0:e.competition_prize})]}),(0,b.jsx)("span",{style:{flex:1},children:(0,b.jsx)(X.Z,{title:"战队名",children:null==e?void 0:e.team_name})}),(0,b.jsx)("span",{style:{flex:1},children:(0,b.jsx)(X.Z,{title:"单位/学校名",children:e.school_name})}),(0,b.jsx)("span",{style:{flex:1,textAlign:"center"},children:(0,b.jsx)(X.Z,{title:"赋能赛加分",children:e.extra_score})}),(0,b.jsx)("span",{style:{flex:1},children:(0,b.jsx)(X.Z,{title:"比赛成绩",children:e.score})}),(0,b.jsx)("span",{style:{color:"#0152d9"},children:(0,b.jsx)(X.Z,{title:"总分",children:parseFloat(e.extra_score)+parseFloat(e.score)})})]})}))]})},ee=G.Z.TabPane;var ne=function(e){var n,t,i,l,r,s,d=e.ChartRules,c=e.ItemData,p=e.getCharts,h=e.Selectkey,x=e.getChartRules,g=e.userinfo,y=e.Editable,j=e.HeaderDetail,Z=(0,f.useState)(!1),k=u()(Z,2),w=k[0],S=k[1],C=(0,f.useState)(""),R=u()(C,2),D=R[0],L=R[1],z=(0,f.useState)(!0),T=u()(z,2),F=T[0],A=T[1],H=(0,f.useState)(),M=u()(H,2),B=M[0],V=M[1],q=(0,f.useState)(),O=u()(q,2),U=O[0],K=O[1],Q=(0,v.useParams)().identifier;function X(){return(X=o()(a()().mark((function e(){var n,t,i;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(D){e.next=3;break}return _.ZP.info("内容不能为空"),e.abrupt("return");case 3:if(A(!1),!(n=null==B?void 0:B.id)){e.next=12;break}return e.next=8,(0,N.ZP)("/api/competitions/".concat(Q,"/update_md_content.json"),{method:"post",body:{competition_module_id:h,content:D,md_content_id:null===(t=d.rule_contents)||void 0===t||null===(t=t.filter((function(e){return parseInt(e.competition_stage_id)===parseInt(n)})))||void 0===t||null===(t=t[0])||void 0===t?void 0:t.id,stage_id:null==B?void 0:B.id}});case 8:0===e.sent.status&&(_.ZP.info("更新成功"),S(!1),x()),e.next=16;break;case 12:return e.next=14,(0,N.ZP)("/api/competitions/".concat(Q,"/update_md_content.json"),{method:"post",body:{competition_module_id:h,content:D,md_content_id:null===(i=d.rule_contents)||void 0===i||null===(i=i.filter((function(e){return 0===parseInt(e.competition_stage_id)})))||void 0===i||null===(i=i[0])||void 0===i?void 0:i.id,stage_id:null==B?void 0:B.id}});case 14:0===e.sent.status&&(_.ZP.info("更新成功"),S(!1),x());case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(0,f.useEffect)((function(){if(F){var e,n,t,i=null==d||null===(e=d.stages)||void 0===e?void 0:e[0];if(V(i),null!=i&&i.id)"mAP"!==(null==j?void 0:j.task)&&"dog"!==(null==j?void 0:j.task)||p(null==i?void 0:i.id),L((null===(n=d.rule_contents)||void 0===n||null===(n=n.filter((function(e){return parseInt(e.competition_stage_id)===parseInt(null==i?void 0:i.id)})))||void 0===n||null===(n=n[0])||void 0===n?void 0:n.content)||"");else"mAP"===(null==j?void 0:j.task)||null==j||j.task,L((null===(t=d.rule_contents)||void 0===t||null===(t=t.filter((function(e){return 0===parseInt(e.competition_stage_id)})))||void 0===t||null===(t=t[0])||void 0===t?void 0:t.content)||"")}}),[d]);var ne=[{title:"排名",dataIndex:"name",align:"center",key:"name",render:function(e,n,t){return(0,b.jsx)("span",{children:t+1})}},{title:"头像",dataIndex:"user_image",align:"center",key:"user_image",render:function(e){return(0,b.jsx)("img",{className:m.Z.imgradius,src:E.Z.IMG_SERVER+"/images/".concat(e)})}},{title:"战队名称",dataIndex:"team_name",key:"team_name",render:function(e){return(0,b.jsx)("span",{title:e,children:e&&(null==e?void 0:e.length)>=15?(null==e?void 0:e.substr(0,15))+"...":e||"--"})}},{title:"单位",dataIndex:"school_name",key:"school_name",align:"center",render:function(e){return(0,b.jsx)("span",{children:e||"--"})}},{title:"mAP"===(null==j?void 0:j.task)?"mAP指标":"Jittor-3"===(null==j?void 0:j.task)?"总分":"top1指标",dataIndex:"score",key:"score",render:function(e){return(0,b.jsx)("span",{children:e||"--"})}}];return(0,b.jsxs)("div",{children:[(null==d||null===(n=d.stages)||void 0===n?void 0:n.length)>0?null:(0,b.jsx)(J,{}),(null==d||null===(t=d.stages)||void 0===t?void 0:t.length)>0&&(0,b.jsx)(G.Z,{animated:!0,tabBarExtraContent:((null==g?void 0:g.admin)||(null==g?void 0:g.business)||y)&&(0,b.jsx)(I.ZP,{onClick:function(){S(!0)},children:"编辑"}),onChange:function(e){var n,t,i;S(!1);var l=null==d||null===(n=d.stages)||void 0===n?void 0:n.filter((function(n){return parseInt(e)===parseInt(null==n?void 0:n.id)}))[0];V(l);var r=null==l||null===(t=l.children)||void 0===t?void 0:t[0];K(r),L((null===(i=d.rule_contents)||void 0===i||null===(i=i.filter((function(e){return parseInt(e.competition_stage_id)===parseInt(null==l?void 0:l.id)})))||void 0===i||null===(i=i[0])||void 0===i?void 0:i.content)||""),p((null==r?void 0:r.id)||e)},children:d&&d.stages.map((function(e,n){return(0,b.jsx)(ee,{tab:e.name,children:!1===w&&d&&d.rule_contents.map((function(n,t){return e.id===n.competition_stage_id||null===e.id&&0===n.competition_stage_id?(0,b.jsx)(P.Z,{value:void 0===n.content||null===n.content?"":n.content},t):void 0}))},null===e.id?0:e.id)}))}),(null==B||null===(i=B.children)||void 0===i?void 0:i.length)>0&&(0,b.jsx)(G.Z,{activeKey:(null==U?void 0:U.id)+"",onChange:function(e){var n,t=null==B||null===(n=B.children)||void 0===n?void 0:n.filter((function(n){return parseInt(e)===parseInt(null==n?void 0:n.id)}))[0];K(t),p(e)},children:null==B||null===(l=B.children)||void 0===l?void 0:l.map((function(e,n){return(0,b.jsx)(ee,{tab:e.name},null===e.id?0:e.id)}))}),w&&(0,b.jsxs)("div",{children:[(0,b.jsx)(Y.Z,{defaultValue:D,onChange:function(e){L(e)}}),(0,b.jsxs)("p",{style:{marginTop:"10px"},children:[(0,b.jsx)(I.ZP,{style:{width:"90px"},type:"primary",onClick:function(){return function(){return X.apply(this,arguments)}()},children:"提交"}),(0,b.jsx)(I.ZP,{style:{marginLeft:"30px",width:"90px"},onClick:function(){return S(!1)},children:"取消"})]})]}),(null==c||null===(r=c.teams)||void 0===r?void 0:r.length)>0&&("mAP"===(null==j?void 0:j.task)||"dog"===(null==j?void 0:j.task)||"Jittor-3"===(null==j?void 0:j.task))?(0,b.jsx)(W.Z,{dataSource:null==c?void 0:c.teams,columns:ne,pagination:!1}):(null==c||null===(s=c.teams)||void 0===s?void 0:s.length)>0&&(0,b.jsx)($,{ItemData:c})]})},te=t(78389),ie=t(11298),le=t(95888),re=t(99232),ae=t.n(re),se=G.Z.TabPane;var oe=function(e){var n,t,i,l,r,s,d,c=e.ChartRules,p=e.ItemData,m=e.getCharts,h=e.Selectkey,x=e.HeaderDetail,g=e.getChartRules,y=e.userinfo,j=e.Editable,Z=e.dispatch,k=e.StaffDetail,w=(0,f.useState)(!1),S=u()(w,2),C=S[0],R=S[1],D=(0,f.useState)(""),E=u()(D,2),L=E[0],z=E[1],T=(0,f.useState)(!0),F=u()(T,2),A=F[0],H=F[1],M=(0,f.useState)(),B=u()(M,2),V=B[0],q=B[1],O=(0,f.useState)(),U=u()(O,2),K=U[0],Q=U[1],$=(0,v.useParams)().identifier;function ee(){return(ee=o()(a()().mark((function e(){var n,t,i;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(L){e.next=3;break}return _.ZP.info("内容不能为空"),e.abrupt("return");case 3:if(H(!1),!(n=null==V?void 0:V.id)){e.next=12;break}return e.next=8,(0,N.ZP)("/api/competitions/".concat($,"/update_md_content.json"),{method:"post",body:{competition_module_id:h,content:L,md_content_id:null===(t=c.rule_contents)||void 0===t||null===(t=t.filter((function(e){return parseInt(e.competition_stage_id)===parseInt(n)})))||void 0===t||null===(t=t[0])||void 0===t?void 0:t.id,stage_id:null==V?void 0:V.id}});case 8:0===e.sent.status&&(_.ZP.info("更新成功"),R(!1),g()),e.next=16;break;case 12:return e.next=14,(0,N.ZP)("/api/competitions/".concat($,"/update_md_content.json"),{method:"post",body:{competition_module_id:h,content:L,md_content_id:null===(i=c.rule_contents)||void 0===i||null===(i=i.filter((function(e){return 0===parseInt(e.competition_stage_id)})))||void 0===i||null===(i=i[0])||void 0===i?void 0:i.id,stage_id:null==V?void 0:V.id}});case 14:0===e.sent.status&&(_.ZP.info("更新成功"),R(!1),g());case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(0,f.useEffect)((function(){if(A){var e,n,t=null==c||null===(e=c.stages)||void 0===e?void 0:e[0];q(t);var i,l,r=null==c||null===(n=c.stages)||void 0===n||null===(n=n[0])||void 0===n||null===(n=n.children)||void 0===n?void 0:n[0];if(Q(r),null!=t&&t.id)m(null==t?void 0:t.id),z((null===(i=c.rule_contents)||void 0===i||null===(i=i.filter((function(e){return parseInt(e.competition_stage_id)===parseInt(null==t?void 0:t.id)})))||void 0===i||null===(i=i[0])||void 0===i?void 0:i.content)||"");else m(0),z((null===(l=c.rule_contents)||void 0===l||null===(l=l.filter((function(e){return 0===parseInt(e.competition_stage_id)})))||void 0===l||null===(l=l[0])||void 0===l?void 0:l.content)||"")}}),[c]);var ne=[{title:"request_id",dataIndex:"request_id",width:120,align:"center",key:"name",render:function(e,n,t){return(0,b.jsx)("span",{children:e})}},{title:"附件",dataIndex:"file_name",align:"center",width:150,key:"file_name",render:function(e){return(0,b.jsx)(X.Z,{title:e,children:(0,b.jsx)("span",{title:e,children:e&&(null==e?void 0:e.length)>=10?(null==e?void 0:e.substr(0,10))+"...":e||"--"})})}},{title:"提交人",dataIndex:"user_name",key:"user_name",width:100,render:function(e){return(0,b.jsx)("span",{title:e,children:e&&(null==e?void 0:e.length)>=6?(null==e?void 0:e.substr(0,6))+"...":e||"--"})}},{title:"提交时间",dataIndex:"created_at",key:"created_at",align:"center"},{title:"状态",dataIndex:"status",key:"status",width:50,render:function(e){return(0,b.jsx)("span",{children:1===e?"计算中":2===e?"完成":0===e?"待计算":3===e&&"错误"})}},!(null!=V&&V.display_four_indicators)&&"计图挑战热身赛"===(null==V?void 0:V.name)&&{title:"数据指标1",dataIndex:"data_ranking",key:"data_ranking",align:"center",render:function(e){return(0,b.jsx)("span",{children:e||"--"})}},!(null!=V&&V.display_four_indicators)&&"计图挑战热身赛"===(null==V?void 0:V.name)&&{title:"数据指标2",dataIndex:"data_other",key:"data_other",align:"left",render:function(e){return(null==e?void 0:e.length)>0?null==e?void 0:e.map((function(e,n){return(0,b.jsxs)("span",{children:[null==e?void 0:e.name,":",null==e?void 0:e.value," ",(0,b.jsx)("br",{})]})})):(0,b.jsx)("span",{children:"--"})}},(null==V?void 0:V.display_six_indicators)&&{title:"数据指标",dataIndex:"data_other",key:"data_other",align:"left",render:function(e){return(null==e?void 0:e.length)>0?null==e?void 0:e.map((function(e,n){return(0,b.jsxs)("span",{children:[null==e?void 0:e.name,":",null==e?void 0:e.value," ",(0,b.jsx)("br",{})]})})):(0,b.jsx)("span",{children:"--"})}},(null==V?void 0:V.display_five_indicators)&&{title:"top1指标",dataIndex:"data_indicators",key:"data_indicators",align:"left",render:function(e){var n;return(null==e||null===(n=e[0])||void 0===n?void 0:n.value)||"- -"}},(null==V?void 0:V.display_five_indicators)&&{title:"top5指标",dataIndex:"data_indicators",key:"data_indicators",align:"left",render:function(e){var n;return(null==e||null===(n=e[1])||void 0===n?void 0:n.value)||"- -"}},(null==V?void 0:V.display_four_indicators)&&{title:"mask accuary",dataIndex:"data_ranking",key:"data_ranking",align:"left",render:function(e){return(0,b.jsx)("span",{children:e||"--"})}},(null==V?void 0:V.display_one_indicators)&&{title:"mIoU",dataIndex:"data_other",key:"data_ranking",align:"left",render:function(e){var n;return(0,b.jsx)("span",{children:(null==e||null===(n=e.find((function(e){return"mIoU"===(null==e?void 0:e.name)})))||void 0===n?void 0:n.value)||"--"})}},(null==V?void 0:V.display_four_indicators)&&{title:"美学评分",dataIndex:"data_other",key:"data_other",align:"left",render:function(e){var n;return(0,b.jsx)("span",{children:(null==e||null===(n=e.find((function(e){return"score"===(null==e?void 0:e.name)})))||void 0===n?void 0:n.value)||"--"})}},(null==V?void 0:V.display_four_indicators)&&{title:"FID",dataIndex:"data_other",key:"data_other",align:"left",render:function(e){var n;return(0,b.jsx)("span",{children:(null==e||null===(n=e.find((function(e){return"fid"===(null==e?void 0:e.name)})))||void 0===n?void 0:n.value)||"--"})}},(null==V?void 0:V.display_four_indicators)&&{title:"风格相似度",dataIndex:"data_other",key:"data_other",align:"left",render:function(e){var n;return(0,b.jsx)("span",{children:(null==e||null===(n=e.find((function(e){return"style_similarity"===(null==e?void 0:e.name)})))||void 0===n?void 0:n.value)||"--"})}},(null==V?void 0:V.display_four_indicators)&&{title:"总分",dataIndex:"data_other",key:"data_other",align:"left",render:function(e){var n;return(0,b.jsx)("span",{children:(null==e||null===(n=e.find((function(e){return"total_score"===(null==e?void 0:e.name)})))||void 0===n?void 0:n.value)||"--"})}},!(null!=V&&V.display_four_indicators)&&(null==V?void 0:V.name.includes("可微渲染新视角生成赛题"))&&{title:"Car",dataIndex:"data_ranking",key:"data_ranking",align:"center",render:function(e){return(0,b.jsx)("span",{children:e||"--"})}},!(null!=V&&V.display_four_indicators)&&(null==V?void 0:V.name.includes("可微渲染新视角生成赛题"))&&{title:"Coffee",dataIndex:"data_other",key:"data_other",align:"center",render:function(e){var n;return(0,b.jsx)("span",{children:(null==e||null===(n=e.find((function(e){return"Coffee"===(null==e?void 0:e.name)})))||void 0===n?void 0:n.value)||"--"})}},!(null!=V&&V.display_four_indicators)&&(null==V?void 0:V.name.includes("可微渲染新视角生成赛题"))&&{title:"Easyship",dataIndex:"data_other",key:"data_other",align:"center",render:function(e){var n;return(0,b.jsx)("span",{children:(null==e||null===(n=e.find((function(e){return"Easyship"===(null==e?void 0:e.name)})))||void 0===n?void 0:n.value)||"--"})}},!(null!=V&&V.display_four_indicators)&&(null==V?void 0:V.name.includes("可微渲染新视角生成赛题"))&&{title:"Scar",dataIndex:"data_other",key:"data_other",align:"center",render:function(e){var n;return(0,b.jsx)("span",{children:(null==e||null===(n=e.find((function(e){return"Scar"===(null==e?void 0:e.name)})))||void 0===n?void 0:n.value)||"--"})}},!(null!=V&&V.display_four_indicators)&&(null==V?void 0:V.name.includes("可微渲染新视角生成赛题"))&&{title:"Scarf",dataIndex:"data_other",key:"data_other",align:"center",render:function(e){var n;return(0,b.jsx)("span",{children:(null==e||null===(n=e.find((function(e){return"Scarf"===(null==e?void 0:e.name)})))||void 0===n?void 0:n.value)||"--"})}},!(null!=V&&V.display_four_indicators)&&(null==V?void 0:V.name.includes("可微渲染新视角生成赛题"))&&{title:"总分",dataIndex:"data_other",key:"data_other",align:"center",render:function(e){var n;return(0,b.jsx)("span",{children:(null==e||null===(n=e.find((function(e){return"Total"===(null==e?void 0:e.name)})))||void 0===n?void 0:n.value)||"--"})}},{title:"操作",dataIndex:"result_url",width:50,key:"result_url",render:function(e){return(0,b.jsx)("a",{href:e,target:"_blank",download:"附件",children:"下载"})}}].filter((function(e){return!!e}));return(0,b.jsxs)("div",{children:[(null==c||null===(n=c.stages)||void 0===n?void 0:n.length)>0?null:(0,b.jsx)(J,{}),(null==c||null===(t=c.stages)||void 0===t?void 0:t.length)>0&&(0,b.jsx)(G.Z,{animated:!0,tabBarExtraContent:null!=y&&y.admin||null!=y&&y.business||j?(0,b.jsx)(I.ZP,{onClick:function(){R(!0)},children:"编辑"}):k.enrolled&&(null==V?void 0:V.start_time)&&(null==V?void 0:V.end_time)&&(0,b.jsxs)("span",{children:["提交时间:",ae()(null==V?void 0:V.start_time).format("YYYY-MM-DD HH:mm:ss"),"至",ae()(null==V?void 0:V.end_time).format("YYYY-MM-DD HH:mm:ss"),(0,b.jsx)(I.ZP,{style:{marginLeft:"20px"},disabled:ae()(null==V?void 0:V.start_time).unix()>ae()(ae()().format("YYYY-MM-DD HH:mm:s")).unix()||ae()(ae()().format("YYYY-MM-DD HH:mm:s")).unix()>ae()(null==V?void 0:V.end_time).unix(),onClick:function(){Z({type:"shixunsDetail/setActionTabs",payload:{key:"md-tab",params:{value:(null==K?void 0:K.id)||(null==V?void 0:V.id),id:null==x?void 0:x.id}}})},children:"提交结果"})]}),onChange:function(e){var n,t,i;R(!1);var l=null==c||null===(n=c.stages)||void 0===n?void 0:n.filter((function(n){return parseInt(e)===parseInt(null==n?void 0:n.id)}))[0],r=null==l||null===(t=l.children)||void 0===t?void 0:t[0];Q(r),q(l),z((null===(i=c.rule_contents)||void 0===i||null===(i=i.filter((function(e){return parseInt(e.competition_stage_id)===parseInt(null==l?void 0:l.id)})))||void 0===i||null===(i=i[0])||void 0===i?void 0:i.content)||""),m((null==r?void 0:r.id)||e)},children:c&&c.stages.map((function(e,n){return(0,b.jsx)(se,{tab:e.name,children:!1===C&&c&&c.rule_contents.map((function(n,t){return e.id===n.competition_stage_id||null===e.id&&0===n.competition_stage_id?(0,b.jsx)(P.Z,{value:void 0===n.content||null===n.content?"":n.content},t):void 0}))},null===e.id?0:e.id)}))}),0===(null==V||null===(i=V.children)||void 0===i?void 0:i.length)&&(null==p?void 0:p.total_user_count)>0&&(0,b.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:10},children:[(0,b.jsxs)("div",{style:{width:"33%",height:44,background:"#EEF7FF",color:"#3061D0",textAlign:"center",lineHeight:"44px"},children:["本赛道的战队数量:",null==p?void 0:p.total_team_count]}),(0,b.jsxs)("div",{style:{width:"33%",height:44,background:"#EEF7FF",color:"#3061D0",textAlign:"center",lineHeight:"44px"},children:["参赛人数:",null==p?void 0:p.total_user_count]}),(0,b.jsxs)("div",{style:{width:"33%",height:44,background:"#EEF7FF",color:"#3061D0",textAlign:"center",lineHeight:"44px"},children:["提交评测次数:",null==p?void 0:p.total_count]})]}),(null==V||null===(l=V.children)||void 0===l?void 0:l.length)>0&&(0,b.jsx)(G.Z,{activeKey:(null==K?void 0:K.id)+"",onChange:function(e){var n,t=null==V||null===(n=V.children)||void 0===n?void 0:n.filter((function(n){return parseInt(e)===parseInt(null==n?void 0:n.id)}))[0];Q(t),m(e)},children:null==V||null===(r=V.children)||void 0===r?void 0:r.map((function(e,n){return(0,b.jsx)(se,{tab:e.name},null===e.id?0:e.id)}))}),(null==V||null===(s=V.children)||void 0===s?void 0:s.length)>0&&(null==p?void 0:p.total_user_count)>0&&(0,b.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:10},children:[(0,b.jsxs)("div",{style:{width:"33%",height:44,background:"#EEF7FF",color:"#3061D0",textAlign:"center",lineHeight:"44px"},children:["本赛道的战队数量:",null==p?void 0:p.total_team_count]}),(0,b.jsxs)("div",{style:{width:"33%",height:44,background:"#EEF7FF",color:"#3061D0",textAlign:"center",lineHeight:"44px"},children:["参赛人数:",null==p?void 0:p.total_user_count]}),(0,b.jsxs)("div",{style:{width:"33%",height:44,background:"#EEF7FF",color:"#3061D0",textAlign:"center",lineHeight:"44px"},children:["提交评测次数:",null==p?void 0:p.total_count]})]}),C&&(0,b.jsxs)("div",{children:[(0,b.jsx)(Y.Z,{defaultValue:L,onChange:function(e){z(e)}}),(0,b.jsxs)("p",{style:{marginTop:"10px"},children:[(0,b.jsx)(I.ZP,{style:{width:"90px"},type:"primary",onClick:function(){return function(){return ee.apply(this,arguments)}()},children:"提交"}),(0,b.jsx)(I.ZP,{style:{marginLeft:"30px",width:"90px"},onClick:function(){return R(!1)},children:"取消"})]})]}),(null===(d=x.competition_modules.filter((function(e){return e.id===h})))||void 0===d||null===(d=d[0])||void 0===d?void 0:d.show_leaderboard)&&(0,b.jsx)(W.Z,{dataSource:null==p?void 0:p.results,columns:ne})]})},de=t(53864),ue=G.Z.TabPane;var ce=function(e){var n,t,i,r,s,d,c=e.loading,p=e.ChartRules,m=e.ItemData,h=e.getCharts,x=(e.Selectkey,e.HeaderDetail,e.getChartRules,e.userinfo,e.Editable,e.dispatch,e.StaffDetail,(0,f.useState)(!1)),_=u()(x,2),g=(_[0],_[1]),y=(0,f.useState)(""),j=u()(y,2),Z=(j[0],j[1]),k=(0,f.useState)(!0),w=u()(k,2),I=w[0],C=(w[1],(0,f.useState)()),P=u()(C,2),R=P[0],N=P[1],L=(0,f.useState)(),z=u()(L,2),T=z[0],F=z[1],A=((0,v.useParams)().identifier,(0,f.useState)({page:1,limit:10,sort:"desc"})),H=u()(A,2),M=H[0],B=H[1];(0,f.useEffect)((function(){var e;I&&null!=p&&null!==(e=p.stages)&&void 0!==e&&e[0]&&V()}),[null==p||null===(n=p.stages)||void 0===n?void 0:n[0]]);var V=function(){var e=o()(a()().mark((function e(){var n,t,i,r;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=null==p||null===(n=p.stages)||void 0===n?void 0:n[0],N(i),r=null==p||null===(t=p.stages)||void 0===t||null===(t=t[0])||void 0===t||null===(t=t.children)||void 0===t?void 0:t[0],F(r),M.id=(null==r?void 0:r.id)||(null==i?void 0:i.id),B(l()({},M)),e.next=7,h(l()(l()({},M),{},{stage_id:M.id}));case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,b.jsxs)("div",{children:[(null==p||null===(t=p.stages)||void 0===t?void 0:t.length)>0?null:(0,b.jsx)(J,{}),(null==p||null===(i=p.stages)||void 0===i?void 0:i.length)>0&&(0,b.jsx)(G.Z,{tabBarStyle:{height:65,marginLeft:35,marginRight:30},animated:!0,onChange:function(){var e=o()(a()().mark((function e(n){var t,i,r,s,o;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g(!1),s=null==p||null===(t=p.stages)||void 0===t?void 0:t.filter((function(e){return parseInt(n)===parseInt(null==e?void 0:e.id)}))[0],o=null==s||null===(i=s.children)||void 0===i?void 0:i[0],F(o),N(s),Z((null===(r=p.rule_contents)||void 0===r||null===(r=r.filter((function(e){return parseInt(e.competition_stage_id)===parseInt(null==s?void 0:s.id)})))||void 0===r||null===(r=r[0])||void 0===r?void 0:r.content)||""),M.page=1,M.limit=10,M.id=(null==o?void 0:o.id)||n,B(l()({},M)),e.next=9,h(l()({},M));case 9:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:p&&p.stages.map((function(e,n){return(0,b.jsx)(ue,{tab:e.name},null===e.id?0:e.id)}))}),(null==R||null===(r=R.children)||void 0===r?void 0:r.length)>0&&(0,b.jsx)(G.Z,{activeKey:(null==T?void 0:T.id)+"",onChange: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:return i=null==R||null===(t=R.children)||void 0===t?void 0:t.filter((function(e){return parseInt(n)===parseInt(null==e?void 0:e.id)}))[0],F(i),M.page=1,M.limit=10,M.id=n,B(l()({},M)),e.next=5,h(l()({},M));case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:null==R||null===(s=R.children)||void 0===s?void 0:s.map((function(e,n){return(0,b.jsx)(ue,{tab:e.name},null===e.id?0:e.id)}))}),(0,b.jsx)("div",{style:{height:10,background:"#F5F5F5"}}),(0,b.jsxs)("div",{style:{padding:"20px 30px"},children:[(0,b.jsxs)("span",{style:{cursor:"pointer",marginRight:20},onClick:function(){M.page=1,M.sort="desc"===M.sort?"asc":"desc",B(l()({},M)),h(l()({},M))},children:["按提交时间","asc"===M.sort?"正":"倒","序排序 ",(0,b.jsx)("i",{className:"iconfont font14 ".concat("asc"===M.sort?"icon-jiantou9":"icon-changyongtubiao-xianxingdaochu-zhuanqu-")})]})," ",(0,b.jsx)(D.Z.Search,{onSearch:function(e){M.page=1,M.search=e,B(l()({},M)),h(l()({},M))},style:{width:"82%"},placeholder:"输入人员/战队名称进行搜索"}),(0,b.jsx)(S.Z,{spinning:c,children:null==m||null===(d=m.results)||void 0===d?void 0:d.map((function(e,n){return(0,b.jsxs)("div",{style:{border:"1px solid #E3EFFC",height:100,borderRadius:"2px 2px 0px 0px",marginTop:0===n?14:30},children:[(0,b.jsxs)("div",{style:{height:60,padding:10,display:"flex",alignItems:"center"},children:[(0,b.jsx)("img",{src:E.Z.IMG_SERVER+"/images/"+(null==e?void 0:e.image_url),style:{width:40,height:40,borderRadius:"50%"}}),(0,b.jsxs)("div",{style:{marginLeft:10},children:[(0,b.jsx)("span",{style:{color:"#333333",fontWeight:500,fontSize:"16px"},children:null==e?void 0:e.user_name}),(0,b.jsxs)("span",{style:{color:"#999999",fontWeight:400,fontSize:"14px",marginLeft:60},children:["所属战队",(0,b.jsx)("span",{style:{marginLeft:10,color:"#333"},children:(null==e?void 0:e.team_name)||"- -"})]}),(0,b.jsxs)("span",{style:{color:"#333333",fontWeight:400,fontSize:"14px",marginLeft:40},children:["学校 ",(0,b.jsx)("span",{style:{marginLeft:10,color:"#333"},children:(null==e?void 0:e.school_name)||"- -"})]})]})]}),(0,b.jsxs)("div",{style:{background:"#EEF2F8",height:40,borderRadius:"0px 0px 2px 2px",paddingLeft:60,paddingRight:40,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("span",{style:{color:"#666666",fontSize:"12px"},children:["提交时间:",null==e?void 0:e.created_at]}),(0,b.jsxs)("span",{style:{color:"#666666",fontSize:"12px",margin:"0px 40px"},children:["消耗内存:",(null==e?void 0:e.ts_mem)||"- -","MB"]}),(0,b.jsxs)("span",{style:{color:"#666666",fontSize:"12px"},children:["代码执行时间:",(null==e?void 0:e.ts_time)||"- -","秒"]})]}),(0,b.jsxs)("a",{style:{display:"flex",alignItems:"center"},href:"/tasks/".concat(null==e?void 0:e.game_identifier),target:"_blank",children:[(0,b.jsx)("i",{className:"iconfont icon-chakandaima",style:{marginRight:4}}),(0,b.jsx)("span",{style:{lineHeight:"14px"},children:"查看代码"})]})]})]})}))}),(0,b.jsx)(de.Z,{total:null==m?void 0:m.total_count,pageSize:10,hideOnSinglePage:!0,style:{marginTop:40,textAlign:"center"},showSizeChanger:!1,current:M.page,onChange:function(e,n){M.page=e,B(l()({},M)),h(l()({},M))}})]})]})},pe=t(43971),fe=G.Z.TabPane;var ve=function(e){var n,t,i,r,s,d,c,p=e.loading,m=e.ChartRules,h=e.ItemData,x=e.getCharts,_=(e.Selectkey,e.HeaderDetail),g=(e.getChartRules,e.userinfo,e.Editable,e.dispatch),y=e.StaffDetail,j=(0,f.useState)(!1),Z=u()(j,2),k=(Z[0],Z[1]),w=(0,f.useState)(""),I=u()(w,2),C=(I[0],I[1]),P=(0,f.useState)(!0),R=u()(P,2),D=R[0],E=(R[1],(0,f.useState)()),L=u()(E,2),z=L[0],T=L[1],F=(0,f.useState)(),A=u()(F,2),H=A[0],M=A[1],B=(0,f.useState)([]),V=u()(B,2),Y=V[0],q=V[1],O=(0,v.useParams)().identifier,W=(0,f.useState)({page:1,limit:10}),U=u()(W,2),K=U[0],Q=U[1],X=(0,f.useState)(),$=u()(X,2);$[0],$[1],(0,f.useEffect)((function(){var e;D&&null!=m&&null!==(e=m.stages)&&void 0!==e&&e[0]&&ee()}),[null==m||null===(n=m.stages)||void 0===n?void 0:n[0]]);var ee=function(){var e=o()(a()().mark((function e(){var n,t,i,r;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=null==m||null===(n=m.stages)||void 0===n?void 0:n[0],T(i),r=null==m||null===(t=m.stages)||void 0===t||null===(t=t[0])||void 0===t||null===(t=t.children)||void 0===t?void 0:t[0],M(r),K.id=(null==r?void 0:r.id)||(null==i?void 0:i.id),Q(l()({},K)),e.next=7,x(l()(l()({},K),{},{stage_id:K.id}));case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();function ne(){return(ne=o()(a()().mark((function e(){var n;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,N.ZP)("/api/competitions/".concat(O,"/get_shixun_settings.json"),{method:"get"});case 2:0===(null==(n=e.sent)?void 0:n.status)&&q(n);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return(0,f.useEffect)((function(){null!=_&&_.is_new&&function(){ne.apply(this,arguments)}()}),[_]),(0,b.jsxs)("div",{children:[(null==m||null===(t=m.stages)||void 0===t?void 0:t.length)>0?null:(0,b.jsx)(J,{}),(null==m||null===(i=m.stages)||void 0===i?void 0:i.length)>0&&(0,b.jsx)(G.Z,{tabBarStyle:{height:65,marginLeft:35,marginRight:30},animated:!0,onChange:function(){var e=o()(a()().mark((function e(n){var t,i,r,s,o;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k(!1),s=null==m||null===(t=m.stages)||void 0===t?void 0:t.filter((function(e){return parseInt(n)===parseInt(null==e?void 0:e.id)}))[0],o=null==s||null===(i=s.children)||void 0===i?void 0:i[0],M(o),T(s),C((null===(r=m.rule_contents)||void 0===r||null===(r=r.filter((function(e){return parseInt(e.competition_stage_id)===parseInt(null==s?void 0:s.id)})))||void 0===r||null===(r=r[0])||void 0===r?void 0:r.content)||""),K.page=1,K.limit=10,K.id=(null==o?void 0:o.id)||n,Q(l()({},K)),e.next=9,x(l()({},K));case 9:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:m&&m.stages.map((function(e,n){return(0,b.jsx)(fe,{tab:e.name},null===e.id?0:e.id)}))}),(null==z||null===(r=z.children)||void 0===r?void 0:r.length)>0&&(0,b.jsx)(G.Z,{activeKey:(null==H?void 0:H.id)+"",tabBarStyle:{height:65,marginLeft:35,marginRight:30},onChange: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:return i=null==z||null===(t=z.children)||void 0===t?void 0:t.filter((function(e){return parseInt(n)===parseInt(null==e?void 0:e.id)}))[0],M(i),K.page=1,K.limit=10,K.id=n,Q(l()({},K)),e.next=5,x(l()({},K));case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:null==z||null===(s=z.children)||void 0===s?void 0:s.map((function(e,n){return(0,b.jsx)(fe,{tab:e.name},null===e.id?0:e.id)}))}),(0,b.jsx)("div",{style:{height:10,background:"#F5F5F5"}}),(0,b.jsxs)("div",{style:{padding:"20px 30px"},children:[(0,b.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,b.jsxs)("span",{style:{color:"#9096A3"},children:["作品提交时间",(0,b.jsxs)("span",{style:{color:"#333333",marginLeft:5},children:[null==h?void 0:h.start_time,"~",null==h?void 0:h.end_time]})]}),(0,b.jsxs)("span",{style:{color:"#9096A3"},children:["成绩来源",(0,b.jsx)("span",{style:{color:"#333333",marginLeft:5},children:0===(null==h?void 0:h.score_source)?"经验值":"预测准确率"})," "]})]}),(0,b.jsxs)(S.Z,{spinning:p,children:[!(null!=_&&_.is_new)&&(null==h||null===(d=h.results)||void 0===d?void 0:d.map((function(e,n){return(0,b.jsx)(pe.Z,{dispatch:g,Header:_,StaffDetail:y,item:e,index:n})}))),(null==_?void 0:_.is_new)&&(null==Y||null===(c=Y.data)||void 0===c?void 0:c.map((function(e,n){return(0,b.jsx)(pe.Z,{dispatch:g,Header:_,StaffDetail:y,item:e,index:n})})))]}),(0,b.jsx)(de.Z,{total:null==h?void 0:h.total_count,pageSize:10,hideOnSinglePage:!0,style:{marginTop:40,textAlign:"center"},showSizeChanger:!1,current:K.page,onChange:function(e,n){K.page=e,Q(l()({},K)),x(l()({},K))}})]})]})},me=t(85404),he=t(91929),xe=t(64980),_e=t(70236),ge=t.n(_e),ye=t(91232),je=t.n(ye),be=t(78241),Ze=t(81407),ke={WorkSubmitDesc:"WorkSubmitDesc___zk_Kc",WorkSubmit:"WorkSubmit___BOuVl",span:"span___sGFYr",search:"search___wZWVl",downBut:"downBut___tfNYQ"},we=t(52943),Se=t(67016),Ie=t(86129),Ce=t.n(Ie),Pe=(0,v.connect)((function(e){return ge()(e),{}}))((function(e){var n,t,i,r,s=e.dispatch,d=e.userinfo,c=e.Editable,p=e.ItemData,m=e.TabResults,h=e.HeaderDetail,y=e.StaffDetail,Z=e.getTabResults,k=void 0===Z?function(){}:Z,w=be.Z.useForm(),S=u()(w,1)[0],C=(0,f.useState)(!1),E=u()(C,2),L=E[0],T=E[1],F=(0,f.useState)(!1),A=u()(F,2),H=A[0],M=A[1],B=(0,v.useParams)().identifier,V=(0,f.useState)(1),q=u()(V,2),O=q[0],J=q[1],U=(0,f.useState)(!1),K=u()(U,2),Q=K[0],$=K[1],ee=(0,f.useState)(!1),ne=u()(ee,2),te=ne[0],le=ne[1],re=(0,f.useState)([]),se=u()(re,2),oe=se[0],ue=se[1],ce=(0,f.useState)(!1),pe=u()(ce,2),fe=pe[0],ve=pe[1],me=(0,f.useState)([]),he=u()(me,2),xe=he[0],_e=he[1],ge=(0,f.useState)(!1),ye=u()(ge,2),Ie=ye[0],Pe=ye[1],Re=(0,f.useState)({name:"",url:"",id:null,fileList:[],competition_team_id:""}),De=u()(Re,2),Ee=De[0],Ne=De[1],Le=(0,f.useState)({total_count:0,results:[]}),ze=u()(Le,2),Te=ze[0],Fe=ze[1],Ae=(0,f.useState)(null),He=u()(Ae,2),Me=He[0],Be=He[1],Ve=(0,f.useState)({page:1,per_page:20,keyword:""}),Ye=u()(Ve,2),qe=Ye[0],Oe=Ye[1],Ge=(0,f.useState)(""),We=u()(Ge,2),Je=We[0],Ue=We[1],Ke=(0,f.useState)(new(Ce())),Qe=u()(Ke,2),Xe=Qe[0];Qe[1];function $e(){return($e=o()(a()().mark((function e(){var n,t;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Pe(!0),e.next=3,(0,N.ZP)("/api/competitions/".concat(B,"/my_teams"),{method:"get"});case 3:n=e.sent,Pe(!1),le(!0),0===(null==n?void 0:n.status)&&(_e(null==n?void 0:n.data),S.setFieldsValue({name:"",url:"",id:"",competition_team_id:null==n||null===(t=n.data)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.id}));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function en(){return(en=o()(a()().mark((function e(){var n;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,N.ZP)("/api/competitions/".concat(B,"/my_teams"),{method:"get"});case 2:0===(null==(n=e.sent)?void 0:n.status)&&_e(null==n?void 0:n.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(0,f.useEffect)((function(){$((null==d?void 0:d.admin)||(null==d?void 0:d.business)||c)}),[null==d?void 0:d.admin,null==d?void 0:d.business,c]),(0,f.useEffect)((function(){null!=p&&p.only_file&&J(2)}),[p]),(0,f.useEffect)((function(){var e,n,t,i;m.stages&&(null===(e=m.stages)||void 0===e?void 0:e.length)>0&&((null===(n=m.stages)||void 0===n||null===(n=n[0])||void 0===n||null===(n=n.children)||void 0===n?void 0:n.length)>0?Be((null===(t=m.stages)||void 0===t||null===(t=t[0])||void 0===t||null===(t=t.children)||void 0===t?void 0:t[0])||null):Be((null===(i=m.stages)||void 0===i?void 0:i[0])||null))}),[m.stages]),(0,f.useEffect)((function(){tn(),function(){en.apply(this,arguments)}()}),[null==Me?void 0:Me.id,qe.page]);var nn=[{title:(0,b.jsx)("span",{style:{color:"#5F6368"},children:"队伍名称"}),dataIndex:"team_name",width:"120px",ellipsis:!0,render:function(e){return(0,b.jsx)(X.Z,{placement:"topLeft",title:e,children:e||"- -"})},isShow:[1,2]},{title:(0,b.jsx)("span",{style:{color:"#5F6368"},children:"提交人"}),dataIndex:"user_name",width:"120px",ellipsis:!0,render:function(e){return(0,b.jsx)(X.Z,{placement:"topLeft",title:e,children:e||"- -"})},isShow:[1,2]},{title:(0,b.jsx)("span",{style:{color:"#5F6368"},children:"作品名称"}),dataIndex:"name",ellipsis:!0,render:function(e,n){return e?(0,b.jsx)("a",{href:n.url||"#",target:"_blank",children:(0,b.jsx)(X.Z,{placement:"topLeft",title:e,children:e})}):"--"},isShow:[1]},{title:(0,b.jsx)("span",{style:{color:"#5F6368"},children:"作品文件"}),dataIndex:"file_name",width:1==O?"180px":"",ellipsis:!0,render:function(e){return(0,b.jsx)(X.Z,{placement:"topLeft",title:e,children:e||"- -"})},isShow:[1,2]},{title:(0,b.jsx)("span",{style:{color:"#5F6368"},children:"更新时间"}),dataIndex:"updated_at",width:"180px",render:function(e){return e||"- -"},isShow:[1,2]},{title:(0,b.jsx)("span",{style:{color:"#5F6368"},children:"操作"}),dataIndex:"result_url",ellipsis:!0,width:"200px",align:"center",render:function(e,n){return(0,b.jsxs)(R.Z,{justify:Q?"center":"space-between",children:[!Q&&(0,b.jsx)(I.ZP,{type:"link",onClick:function(){le(!0),Ne({name:n.name,url:n.url,id:n.id,competition_team_id:n.competition_team_id}),S.setFieldsValue({name:n.name,url:n.url,id:n.id,competition_team_id:n.competition_team_id}),n.file_name&&ue([{uid:"-1",name:n.file_name,status:"done",url:n.result_url||""}])},children:"编辑"}),(0,b.jsx)(Se.Z,{type:"link",disabled:!e,onClick:o()(a()().mark((function t(){return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,ie.Nd)(n.file_name,e));case 1:case"end":return t.stop()}}),t)}))),children:Q?"下载文件":"下载"}),!Q&&(0,b.jsx)(I.ZP,{type:"link",onClick:o()(a()().mark((function e(){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:g.Z.confirm({title:"提示",content:"提交作品删除后不可恢复,确认删除该作品",onOk:function(){var e=o()(a()().mark((function e(){var t;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,N.ZP)("/api/competitions/".concat(B,"/delete_result.json"),{method:"Delete",body:{result_id:null==n?void 0:n.id}});case 2:0===(null==(t=e.sent)?void 0:t.status)&&(_.ZP.info("删除成功"),tn());case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()});case 1:case"end":return e.stop()}}),e)}))),children:"删除"})]})},isShow:[1,2]}].filter((function(e){return e.isShow.includes(O)})),tn=function(){var e=o()(a()().mark((function e(){var n;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ve(!0),e.next=3,s({type:"competitions/Results",payload:l()({identifier:B,stage_id:null==Me?void 0:Me.id,module_type:"worksubmit"},qe)});case 3:n=e.sent,Fe(n),ve(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ln=function(){var e=o()(a()().mark((function e(n){var t;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s({type:"competitions/updateMdContent",payload:{identifier:B,stage_id:null==Me?void 0:Me.id,competition_module_id:p.id,content:Je,md_content_id:null==n?void 0:n.id}});case 2:return 0==(t=e.sent).status&&_.ZP.success(t.message),M(!1),e.next=7,k();case 7:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),rn=function(){var e=o()(a()().mark((function e(n){var t,i,l,r,o,u;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(T(!0),2!=O||0!=oe.length){e.next=4;break}return _.ZP.error("请选择文件"),e.abrupt("return");case 4:if(r={login:null==d?void 0:d.login,container_type:"Competition",file_name:null==oe||null===(t=oe[0])||void 0===t?void 0:t.name,stage_type:null==Me?void 0:Me.id,container_id:null==h?void 0:h.id,result_id:null==Ee?void 0:Ee.id,module_type:"worksubmit",competition_team_id:n.competition_team_id},1!=O){e.next=14;break}return e.next=8,(0,N.ZP)("/api/competitions/".concat(B,"/check_result_url.json"),{method:"GET",params:{url:n.url,stage_id:null==Me?void 0:Me.id,result_id:null==Ee?void 0:Ee.id,competition_team_id:n.competition_team_id}});case 8:if(o=e.sent,T(!1),0==(null==o?void 0:o.status)){e.next=12;break}return e.abrupt("return");case 12:r.name=n.name,r.url=n.url;case 14:if(1!=O||0!=oe.length){e.next=20;break}return e.next=17,s({type:"competitions/getWorkSubmitUpdateRes",payload:{identifier:B,result_id:null==Ee?void 0:Ee.id,name:n.name,url:n.url,stage_id:null==Me?void 0:Me.id,result_url:null==Ee?void 0:Ee.result_url,module_type:"worksubmit",competition_team_id:n.competition_team_id}});case 17:l=e.sent,e.next=23;break;case 20:return e.next=22,(0,j.cT)(oe[0],r);case 22:l=e.sent;case 23:0==(null===(i=l)||void 0===i?void 0:i.status)?_.ZP.success("提交成功"):_.ZP.info((null===(u=l)||void 0===u?void 0:u.message)||"提交失败"),T(!1),le(!1),ue([]),tn();case 28:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),an=function(){var e=o()(a()().mark((function e(){var n,t,i,l,r,d,u,c,p,f;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s({type:"competitions/Results",payload:{identifier:B,stage_id:null==Me?void 0:Me.id,page:1,per_page:9999999,keyword:"",module_type:"worksubmit"}});case 2:if(t=e.sent,i=null==t||null===(n=t.results)||void 0===n?void 0:n.filter((function(e){return(null==e?void 0:e.result_url)&&e.file_name})),l=g.Z.info({width:460,title:(0,b.jsxs)("div",{children:["正在导出参赛文件,",(0,b.jsx)("span",{className:"c-red",children:"请勿关闭或操作当前浏览器窗口"})]}),content:(0,b.jsxs)("div",{children:["当前进度: ",(0,b.jsx)("span",{className:"c-blue",children:0}),"/",i.length]}),maskClosable:!1,className:ke.modal,onOk:function(){}}),r=[],d=function(){var e=o()(a()().mark((function e(n,t){var s,o,d;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,s=new(Ce()),e.next=4,fetch(n.result_url,{method:"get"});case 4:return o=e.sent,e.next=7,o.blob();case 7:return d=e.sent,s.file(n.file_name,d),e.next=11,s.generateAsync({type:"blob"}).then((function(e){!function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;0==i&&r.includes(t)||r.includes("".concat(t,"(").concat(i,")"))?n(t,i+1):(r.push(0==i?t:"".concat(t,"(").concat(i,")")),Xe.file(0==i?t+".zip":"".concat(t,"(").concat(i,")")+".zip",e))}("".concat(null==n?void 0:n.team_name,"-").concat(null==n?void 0:n.user_name))}));case 11:l.update({content:(0,b.jsxs)("div",{children:["当前进度: ",(0,b.jsx)("span",{className:"c-blue",children:t}),"/",i.length]})}),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(0),_.ZP.error("".concat(n.file_name,"下载失败"));case 17:case"end":return e.stop()}}),e,null,[[0,14]])})));return function(n,t){return e.apply(this,arguments)}}(),!(i.length>0)){e.next=27;break}u=0,c=je()(i),e.prev=10,c.s();case 12:if((p=c.n()).done){e.next=18;break}return f=p.value,e.next=16,d(f,++u);case 16:e.next=12;break;case 18:e.next=23;break;case 20:e.prev=20,e.t0=e.catch(10),c.e(e.t0);case 23:return e.prev=23,c.f(),e.finish(23);case 26:Xe.generateAsync({type:"blob"}).then((function(e){(0,ie.Nd)(h.name,window.URL.createObjectURL(e))}));case 27:l.destroy();case 28:case"end":return e.stop()}}),e,null,[[10,20,23,26]])})));return function(){return e.apply(this,arguments)}}(),sn={maxCount:1,withCredentials:!0,fileList:oe,onRemove:function(){ue([])},beforeUpload:function(e){var n=e.size/1024/1024;e.name.split(".").slice(-1)[0].toLowerCase();return 1==O&&n>150||2==O&&n/1024>1||0==n?(_.ZP.error("".concat(e.name," 文件无法上传。").concat(0==n?"文件内容不能为空":"超过文件大小限制(".concat(1==O?"150MB":"1G",")"))),Promise.reject()):(ue([e]),!1)}};return(0,b.jsxs)("div",{className:ke.WorkSubmit,children:[Me?(0,b.jsx)(G.Z,{defaultActiveKey:(null===(n=m.stages)||void 0===n||null===(n=n[0])||void 0===n?void 0:n.id)||1,destroyInactiveTabPane:!0,tabBarExtraContent:(0,b.jsxs)(R.Z,{style:{marginBottom:"10px"},children:[!Q&&y.enrolled&&(0,b.jsx)(I.ZP,{type:"primary",onClick:function(){return le(!0)},children:"作品提交"}),Q&&!H&&(0,b.jsx)(I.ZP,{style:{marginLeft:"10px"},type:"primary",onClick:function(){return M(!0)},children:"编辑"})]}),onChange:function(e){var n=m.stages.find((function(n){return n.id==e}));n.children.length>0?Be(n.children[0]):Be(n)},children:null===(t=m.stages)||void 0===t?void 0:t.map((function(e,n){var t,i,l,r,s;return(0,b.jsxs)(G.Z.TabPane,{tab:(0,b.jsx)("div",{style:{marginBottom:"20px"},children:e.name}),children:[H?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(Y.Z,{defaultValue:(null===(t=m.rule_contents[n])||void 0===t?void 0:t.content)||"",onChange:function(e){return Ue(e)}}),(0,b.jsxs)(R.Z,{children:[(0,b.jsx)(Se.Z,{type:"primary",onClick:function(){return ln(m.rule_contents[n])},children:"提交"}),(0,b.jsx)(I.ZP,{style:{marginLeft:"10px"},onClick:o()(a()().mark((function e(){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",M(!1));case 1:case"end":return e.stop()}}),e)}))),children:"取消"})]})]}):(0,b.jsx)(P.Z,{style:{marginTop:"10px"},value:(null===(i=m.rule_contents[n])||void 0===i?void 0:i.content)||""}),(null===(l=e.children)||void 0===l?void 0:l.length)>0&&(0,b.jsx)(G.Z,{defaultActiveKey:null===(r=e.children)||void 0===r||null===(r=r[0])||void 0===r?void 0:r.id,destroyInactiveTabPane:!0,onChange:function(n){var t;Be(null===(t=e.children)||void 0===t?void 0:t.find((function(e){return e.id==n})))},children:null===(s=e.children)||void 0===s?void 0:s.map((function(e){return(0,b.jsx)(G.Z.TabPane,{tab:e.name},e.id)}))})]},e.id)}))}):(0,b.jsxs)("div",{children:[(y.enrolled||Q)&&(0,b.jsxs)(R.Z,{style:{marginBottom:"10px",paddingBottom:"10px",borderBottom:"1px solid #eee"},children:[!Q&&y.enrolled&&(0,b.jsx)(I.ZP,{style:{marginLeft:"auto"},loading:Ie,type:"primary",onClick:function(){!function(){$e.apply(this,arguments)}()},children:"作品提交"}),Q&&!H&&(0,b.jsx)(I.ZP,{style:{marginLeft:!Q&&y.enrolled?"10px":"auto"},type:"primary",onClick:function(){return M(!0)},children:"编辑"})]}),H?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(Y.Z,{defaultValue:(null===(i=m.rule_contents)||void 0===i||null===(i=i[0])||void 0===i?void 0:i.content)||"",onChange:function(e){return Ue(e)}}),(0,b.jsxs)(R.Z,{children:[(0,b.jsx)(Se.Z,{type:"primary",onClick:function(){var e;return ln(null===(e=m.rule_contents)||void 0===e?void 0:e[0])},children:"提交"}),(0,b.jsx)(I.ZP,{style:{marginLeft:"10px"},onClick:o()(a()().mark((function e(){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",M(!1));case 1:case"end":return e.stop()}}),e)}))),children:"取消"})]})]}):(0,b.jsx)(P.Z,{style:{marginTop:"10px"},value:(null===(r=m.rule_contents)||void 0===r||null===(r=r[0])||void 0===r?void 0:r.content)||""})]}),(0,b.jsxs)(R.Z,{align:"middle",justify:"space-between",style:{marginTop:"21px"},children:[(0,b.jsxs)(R.Z,{align:"middle",children:[(0,b.jsx)(D.Z,{className:ke.search,placeholder:"请输入队伍名称或提交人姓名搜索",suffix:(0,b.jsx)("i",{className:"iconfont icon-sousuo9",onClick:tn,style:{color:"#000",cursor:"pointer",fontSize:"14px"}}),onChange:function(e){qe.keyword=e.target.value,qe.search=e.target.value,Oe(qe)},style:{background:"#F6F7F9"},bordered:!1,onPressEnter:tn}),(0,b.jsxs)("div",{style:{color:"#9B9B9B",fontSize:"14px",marginLeft:"20px"},children:["当前共计作品",(0,b.jsx)("span",{style:{color:"#165DFF"},children:Te.total_count}),"个"]})]}),Q&&(0,b.jsxs)(R.Z,{align:"middle",children:[1==O&&(0,b.jsx)(I.ZP,{style:{lineHeight:"32px"},target:"_blank",href:"/api/competitions/".concat(B,"/results.xlsx?identifier=").concat(B,"&stage_id=").concat((null==Me?void 0:Me.id)||"","&module_type=worksubmit"),icon:(0,b.jsx)("i",{className:"iconfont icon-lianjie3",style:{fontSize:"16px",color:"#44D7B6"}}),className:ke.downBut,children:"下载作品链接"}),(0,b.jsx)(Se.Z,{icon:(0,b.jsx)("i",{className:"iconfont icon-wenjian4",style:{fontSize:"16px",color:"#F6C555"}}),className:ke.downBut,style:{marginLeft:"20px"},onClick:an,children:"下载所有文件"})]})]}),(0,b.jsx)(W.Z,{style:{marginTop:"17px"},loading:fe,columns:nn,dataSource:Te.results,locale:{emptyText:(0,b.jsx)(we.Z,{})},pagination:!1}),(0,b.jsxs)(R.Z,{style:{marginTop:"20px"},align:"middle",justify:"space-between",children:[((null==Me?void 0:Me.end_time)&&(null==Me?void 0:Me.start_time)||h.start_time&&h.end_time)&&(0,b.jsxs)("span",{className:ke.span,children:["提交时间:",(0,b.jsx)("span",{children:ae()((null==Me?void 0:Me.start_time)||h.start_time).format("YYYY-MM-DD HH:mm:ss")})," 至 ",(0,b.jsx)("span",{children:ae()((null==Me?void 0:Me.end_time)||h.end_time).format("YYYY-MM-DD HH:mm:ss")})]}),(0,b.jsx)(de.Z,{showQuickJumper:!0,hideOnSinglePage:!0,current:qe.page,pageSize:qe.per_page,onChange:function(e){return Oe(l()(l()({},qe),{},{page:e}))},onShowSizeChange:function(e,n){return Oe(l()(l()({},qe),{},{page:1,per_page:n}))},total:Te.total_count||0})]}),(0,b.jsxs)(g.Z,{centered:!0,destroyOnClose:!0,title:(0,b.jsx)("div",{style:{fontWeight:"500",color:"#000000",marginTop:"10px"},children:"作品提交"}),open:te,bodyStyle:{padding:" 0px 25px 10px 25px"},onOk:function(){return S.submit()},confirmLoading:L,onCancel:function(){le(!1),ue([]),Ne(null)},children:[(0,b.jsx)("div",{className:ke.WorkSubmitDesc,children:"说明:大赛进行中上传后的作品如需修改,可在【作品提交】列表点击“编辑”进行修改。"}),(0,b.jsxs)(be.Z,{form:S,colon:!1,onFinish:rn,children:[1==O&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(be.Z.Item,{label:"作品名称",name:"name",rules:[{required:!0,message:"请填写作品名称"}],children:(0,b.jsx)(D.Z,{showCount:!0,maxLength:60,placeholder:"请输入作品名称"})}),(0,b.jsx)(be.Z.Item,{label:"作品链接",name:"url",rules:[{required:!0,message:"请填写作品链接"}],children:(0,b.jsx)(D.Z,{placeholder:"请输入作品链接"})})]}),(0,b.jsx)(be.Z.Item,{label:"提交战队",name:"competition_team_id",rules:[{required:!0,message:"请选择战队"}],children:(0,b.jsx)(z.default,{children:null==xe?void 0:xe.map((function(e){return(0,b.jsx)(z.default.Option,{value:null==e?void 0:e.id,children:null==e?void 0:e.name},null==e?void 0:e.id)}))})}),(0,b.jsxs)(be.Z.Item,{name:"fileList",style:{paddingLeft:1==O?"76px":"0"},valuePropName:"fileList",getValueFromEvent:function(e){return Array.isArray(e)?e:null==e?void 0:e.fileList},children:[1==O&&(0,b.jsx)(x.Z,l()(l()({},sn),{},{children:(0,b.jsxs)(R.Z,{align:"middle",children:[(0,b.jsx)(I.ZP,{type:"primary",ghost:!0,icon:(0,b.jsx)(Ze.Z,{}),children:oe.length>0?"更换文件":"文件上传"}),(0,b.jsx)(X.Z,{placement:"right",overlayStyle:{maxWidth:600},title:(0,b.jsxs)("div",{onClick:function(e){e.preventDefault(),e.stopPropagation()},children:[(0,b.jsx)("p",{children:"提示:"}),(0,b.jsx)("p",{children:"1. 一次最多上传1个文件。"}),(0,b.jsx)("p",{children:"2. 单个文件大小请勿超过150M。"})]}),children:(0,b.jsx)("i",{onClick:function(e){e.preventDefault(),e.stopPropagation()},className:"iconfont icon-tishixiaowenhao ml5",style:{cursor:"pointer",color:"#C5C5C5"}})})]})})),2==O&&(0,b.jsxs)(x.Z.Dragger,l()(l()({className:ke.fileList,style:{background:"#fff",padding:"31px 0px"}},sn),{},{children:[(0,b.jsx)("p",{className:"ant-upload-drag-icon",children:(0,b.jsx)("i",{className:"iconfont icon-shangchuan4",style:{fontSize:"32px",color:"#165DFF"}})}),(0,b.jsx)("p",{className:"ant-upload-text",children:"拖拽文件或者点击上传"})]}))]})]})]})]})})),Re=["globalSetting","loading","dispatch","user"],De=(0,v.connect)((function(e){var n=e.loading;return{globalSetting:e.globalSetting,loading:n,user:e.user}}))((function(e){e.globalSetting;var n,t,i,r,s,d,c,x,y,j=e.loading,Z=e.dispatch,P=e.user,R=(p()(e,Re),(0,f.useState)({avatar_url:""})),D=u()(R,2),E=D[0],N=D[1],z=(0,f.useState)([]),T=u()(z,2),F=T[0],A=T[1],H=(0,v.useParams)().identifier,M=(0,f.useState)([]),B=u()(M,2),Y=B[0],q=B[1],G=(0,f.useState)(!0),W=u()(G,2),J=W[0],U=W[1],K=(0,f.useState)([]),Q=u()(K,2),X=Q[0],$=Q[1],ee=(0,f.useState)([]),re=u()(ee,2),ae=re[0],se=re[1],de=(0,f.useState)(!1),ue=u()(de,2),pe=ue[0],fe=ue[1],_e=(0,f.useState)(!1),ge=u()(_e,2),ye=ge[0],je=ge[1],be=(0,f.useState)(!1),Ze=u()(be,2),ke=Ze[0],we=Ze[1],Se=(0,f.useState)([]),Ie=u()(Se,2),Ce=Ie[0],De=Ie[1],Ee=(0,f.useState)([]),Ne=u()(Ee,2),Le=Ne[0],ze=Ne[1],Te=(0,f.useState)([]),Fe=u()(Te,2),Ae=Fe[0],He=Fe[1],Me=(0,f.useState)(!1),Be=u()(Me,2),Ve=Be[0],Ye=Be[1],qe=(0,f.useState)([]),Oe=u()(qe,2),Ge=Oe[0],We=Oe[1],Je=(0,f.useState)(),Ue=u()(Je,2),Ke=Ue[0],Qe=Ue[1],Xe=(0,f.useState)(!0),$e=u()(Xe,2),en=$e[0],nn=$e[1],tn=(0,f.useState)(!1),ln=u()(tn,2),rn=ln[0],an=ln[1],sn=(0,f.useState)(!1),on=u()(sn,2),dn=on[0],un=on[1],cn=(0,f.useState)(!1),pn=u()(cn,2),fn=pn[0],vn=pn[1],mn=(0,f.useState)(!1),hn=u()(mn,2),xn=hn[0],_n=hn[1],gn=(0,f.useState)(!1),yn=u()(gn,2),jn=yn[0],bn=yn[1],Zn=(0,f.useState)(!0),kn=u()(Zn,2),wn=kn[0],Sn=kn[1],In=(0,f.useState)(!1),Cn=u()(In,2),Pn=Cn[0],Rn=Cn[1],Dn=(0,f.useState)(!1),En=u()(Dn,2),Nn=En[0],Ln=En[1],zn=(0,f.useState)(""),Tn=u()(zn,2),Fn=Tn[0],An=Tn[1],Hn=(0,v.useLocation)(),Mn=(0,f.useRef)(null),Bn=(0,f.useState)(!1),Vn=u()(Bn,2),Yn=Vn[0],qn=Vn[1];function On(){return Gn.apply(this,arguments)}function Gn(){return(Gn=o()(a()().mark((function e(){var n;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=A,e.next=3,Z({type:"competitions/getStaff",payload:{identifier:H}});case 3:return e.t1=e.sent,(0,e.t0)(e.t1),e.next=7,Z({type:"competitions/getHeader",payload:{identifier:H}});case 7:n=e.sent,N(n),(0,ie.Dk)((null==n?void 0:n.name)||"竞赛");case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Wn(e){return Jn.apply(this,arguments)}function Jn(){return(Jn=o()(a()().mark((function e(n){var t;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(He(n.id),Ae=n.id,$(n),"entrance"!==n.module_type){e.next=9;break}return e.next=6,Z({type:"competitions/getItem",payload:{url:n.module_url,module_type:"entrance"}});case 6:t=e.sent,e.next=12;break;case 9:return e.next=11,Z({type:"competitions/getItem",payload:{url:n.module_url}});case 11:t=e.sent;case 12:fe(!1),we(!1),Ye(!1),q(t),an(!1),un(!1),qn(!1),se(n.module_type),"worksubmit"===n.module_type?(U(!1),qn(!0),lt()):"chart"===n.module_type?(fe(!0),U(!1),Qn()):"certificate"===n.module_type?(we(!0),fe(!1),U(!1),at()):"md_tab"===n.module_type?(Ye(!0),U(!1),localStorage.setItem("issee","2"),fe(!1),we(!1),lt()):"md_shixun"===n.module_type?(an(!0),U(!1),lt()):"entrance"===n.module_type?(un(!0),U(!1),lt()):(U(!0),localStorage.setItem("issee","1"));case 21:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Un(e,n,t){return Kn.apply(this,arguments)}function Kn(){return(Kn=o()(a()().mark((function e(n,t,i){var l;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.stopPropagation(),!E.teacher_need_phone&&!E.member_need_phone){e.next=4;break}return Rn(!0),e.abrupt("return");case 4:if((0,L.tJ)(Z)){e.next=6;break}return e.abrupt("return");case 6:if(null==E||!E.is_authentication||null!=P&&null!==(l=P.userInfo)&&void 0!==l&&l.authentication){e.next=9;break}return Z({type:"shixunsDetail/setActionTabs",payload:{key:"Banner-Auth"}}),e.abrupt("return");case 9:if(null==E||!E.enroll_url){e.next=12;break}return(0,ie.xg)(null==E?void 0:E.enroll_url),e.abrupt("return");case 12:if("ismodel"!==i){e.next=29;break}if(t.invite_code){e.next=16;break}return _.ZP.info("本竞赛只面向部分学校/单位开放,你暂时没有参赛资格"),e.abrupt("return");case 16:if(!0!==t.member_of_course){e.next=20;break}(0,ie.xg)("/classrooms/".concat(t.course_id)),e.next=27;break;case 20:if(t.invite_code){e.next=23;break}return _.ZP.info("本竞赛只面向部分学校/单位开放,你暂时没有参赛资格"),e.abrupt("return");case 23:return e.next=25,Z({type:"competitions/addApplytojoincourse",payload:{invite_code:t.invite_code,student:1}});case 25:0===e.sent.status&&(0,ie.xg)("/classrooms/".concat(t.course_id));case 27:e.next=33;break;case 29:if(!0!==F.enrolled){e.next=32;break}return(0,ie.xg)(i),e.abrupt("return");case 32:vn(!0);case 33:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Qn(){return Xn.apply(this,arguments)}function Xn(){return(Xn=o()(a()().mark((function e(){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=je,e.next=3,Z({type:"competitions/ChartRules",payload:{identifier:H}});case 3:return e.t1=e.sent,e.next=6,(0,e.t0)(e.t1);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $n(){return($n=o()(a()().mark((function e(n){var t;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Z({type:"competitions/Charts",payload:{identifier:H,stage_id:n}});case 2:t=e.sent,q(t);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function et(){return(et=o()(a()().mark((function e(n){var t;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return nn(!0),e.next=3,Z({type:"competitions/Results",payload:l()({identifier:H,stage_id:null==n?void 0:n.id},n)});case 3:t=e.sent,q(t),nn(!1);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function nt(){return(nt=o()(a()().mark((function e(n){var t;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return nn(!0),e.next=3,Z({type:"competitions/Results",payload:l()({identifier:H,stage_id:null==n?void 0:n.id,module_type:"entrance"},n)});case 3:t=e.sent,q(t),nn(!1);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function tt(e){return it.apply(this,arguments)}function it(){return(it=o()(a()().mark((function e(n){var t;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Z({type:"competitions/Results",payload:{identifier:H,stage_id:n}});case 2:if(t=e.sent,"1"!==localStorage.getItem("issee")){e.next=5;break}return e.abrupt("return");case 5:q(t);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function lt(){return rt.apply(this,arguments)}function rt(){return(rt=o()(a()().mark((function e(){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=We,e.next=3,Z({type:"competitions/TabResults",payload:{identifier:H,competition_module_id:Ae}});case 3:e.t1=e.sent,(0,e.t0)(e.t1);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function at(){return st.apply(this,arguments)}function st(){return(st=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,Z({type:"competitions/Prize",payload:{identifier:H,user_id:null==P||null===(n=P.userInfo)||void 0===n?void 0:n.user_id}});case 2:t=e.sent,De(t);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ot(){return(ot=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,Z({type:"competitions/Accounts",payload:{id:null==P||null===(n=P.userInfo)||void 0===n?void 0:n.user_id}});case 2:t=e.sent,ze(t);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function dt(){return(dt=o()(a()().mark((function e(n){var t;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(wn){e.next=2;break}return e.abrupt("return");case 2:if(Sn(!1),!ut()){e.next=5;break}return e.abrupt("return");case 5:return e.next=7,Z({type:"competitions/AddTeam",payload:l()(l()({},n),{},{identifier:H})});case 7:(t=e.sent)&&0===t.status?(An(t),Ln(!0),On(),_n(!1)):Sn(!0);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ut(){var e,n,t,i,l,r;if(null!=P&&null!==(e=P.userInfo)&&void 0!==e&&e.is_teacher){if((null!=F&&null!==(t=F.all_staff)&&void 0!==t&&t.mutiple_limited||null!=F&&null!==(i=F.teacher_staff)&&void 0!==i&&i.mutiple_limited)&&null!=F&&F.enrolled)return _.ZP.info("你已经报名,不能重复报名"),Sn(!0),!0}else if((null!=F&&null!==(l=F.all_staff)&&void 0!==l&&l.mutiple_limited||null!=F&&null!==(r=F.member_staff)&&void 0!==r&&r.mutiple_limited)&&null!=F&&F.enrolled)return _.ZP.info("你已经报名,不能重复报名"),Sn(!0),!0;if(null!=F&&F.enroll_ended)return _.ZP.info("报名已截止,无需报名"),Sn(!0),!0;if(null!=F&&F.all_staff)return!1;if(null!=P&&null!==(n=P.userInfo)&&void 0!==n&&n.is_teacher){if(!F.teacher_staff)return _.ZP.info("已禁止老师报名"),Sn(!0),!0}else if(null==F||!F.member_staff)return _.ZP.info("已禁止学生报名"),Sn(!0),!0}function ct(){return(ct=o()(a()().mark((function e(n){var t;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(wn){e.next=2;break}return e.abrupt("return");case 2:if(!ut()){e.next=4;break}return e.abrupt("return");case 4:return Sn(!1),e.next=7,Z({type:"competitions/JoinTeam",payload:{identifier:H,invite_code:n}});case 7:(t=e.sent)&&0===t.status?(Ln(!0),An(t),bn(!1),Sn(!0),On()):Sn(!0);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return(0,f.useEffect)((function(){console.log("++++++++++++++++++++++++++++++++++++",H),H&&On(),(0,ie.Dk)("竞赛")}),[H]),(0,f.useEffect)((function(){var e;Qe(1===parseInt(null==Hn||null===(e=Hn.query)||void 0===e?void 0:e.type))}),[Hn]),(0,f.useEffect)((function(){var e;if((null==E||null===(e=E.competition_modules)||void 0===e?void 0:e.length)>0){var n,t;if("赛题发布"===(null==Hn||null===(n=Hn.query)||void 0===n?void 0:n.active)){var i,l=null==E||null===(i=E.competition_modules)||void 0===i?void 0:i.find((function(e){return"赛题发布"===e.name}));if(l)return void Wn(l)}Wn(null==E||null===(t=E.competition_modules)||void 0===t?void 0:t[0])}null!=E&&E.id&&Z({type:"globalSetting/setShareData",payload:{title:null==E?void 0:E.name,desc:null==E?void 0:E.description,imgUrl:"".concat(null==E?void 0:E.image,"?x-oss-process=image/resize,h_200,w_200,m_pad")}})}),[E]),(0,b.jsxs)("div",{className:"edu-container minH500",children:[(0,b.jsxs)(w.Z,{className:"mt10",separator:">",children:[(0,b.jsx)(w.Z.Item,{children:(0,b.jsx)(v.Link,{to:"/competitions/index",children:"在线竞赛"})}),(0,b.jsxs)(w.Z.Item,{children:[E.name,E.sub_title?"-"+E.sub_title:null]})]}),(0,b.jsxs)("div",{className:"mt10",style:{display:"flex",background:"#fff",position:"relative",padding:"20px 12px"},children:[(0,b.jsx)(S.Z,{spinning:j.effects["competitions/getHeader"],children:(0,b.jsxs)("div",{style:{height:"355px",width:"800px"},children:[(null==E?void 0:E.avatar_url)&&null!==(null==E?void 0:E.avatar_url)&&(0,b.jsx)("img",{style:{height:"355px",width:"800px"},src:null==E?void 0:E.avatar_url}),!(null!=E&&E.avatar_url)&&null==(null==E?void 0:E.avatar_url)&&(0,b.jsx)("img",{style:{height:"355px",width:"800px"},src:"/images/educoder/competitions/mainbanner.jpg"})]})}),(0,b.jsxs)("div",{style:{marginLeft:"20px",width:"400px"},children:[(0,b.jsxs)("p",{className:"".concat(m.Z.titlesize),children:[E.name,E.sub_title?"-"+E.sub_title:null]}),(0,b.jsxs)("p",{style:{display:"flex",justifyContent:"space-between",marginRight:18},children:[(0,b.jsxs)("span",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,b.jsx)("span",{children:"奖金"}),null!=E&&E.bonus?(0,b.jsxs)("span",{style:{fontSize:"24px"},children:["¥",parseInt(E&&E.bonus).toLocaleString()]}):(0,b.jsx)("span",{style:{fontSize:"24px"},children:"暂无"})]}),(0,b.jsxs)("span",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,b.jsx)("span",{children:"浏览"}),(0,b.jsx)("span",{style:{fontSize:"24px"},children:parseInt(E&&E.visits_count).toLocaleString()})]}),(0,b.jsxs)("span",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,b.jsx)("span",{children:"报名"}),(0,b.jsx)("span",{style:{fontSize:"24px"},children:parseInt(E&&E.member_count).toLocaleString()})]})]}),(0,b.jsxs)("p",{className:m.Z.timesize,style:{marginTop:30},children:[(0,b.jsx)("span",{style:{color:"#9b9b9b",marginTop:"30px"},children:"竞赛时间:"}),E.start_time,"~",E.end_time]}),(0,b.jsxs)("p",{className:m.Z.timesize,children:[(0,b.jsx)("span",{style:{color:"#9b9b9b"},children:"报名截止:"}),E.enroll_end_time]}),"ended"===E.competition_status?(0,b.jsxs)("p",{className:m.Z.timesize,children:[(0,b.jsx)("span",{style:{color:"#9b9b9b"},children:"竞赛状态:"}),"已结束"]}):null,"nearly_published"===E.competition_status?(0,b.jsxs)("p",{className:m.Z.timesize,children:[(0,b.jsx)("span",{style:{color:"#9b9b9b"},children:"竞赛状态:"}),"未发布"]}):null,"progressing"===E.competition_status?(0,b.jsxs)("p",{className:m.Z.timesize,children:[(0,b.jsx)("span",{style:{color:"#9b9b9b"},children:"竞赛状态:"}),"进行中"]}):null,(0,b.jsxs)("div",{style:{display:"flex",justifyContent:"center"},children:[(null==E?void 0:E.mode)<=2&&F.enrolled&&(0,b.jsxs)(I.ZP,{onClick:function(e){var n;1===(null==E?void 0:E.mode)||3===(null==E?void 0:E.mode)?Wn(null===(n=E.competition_modules)||void 0===n?void 0:n.find((function(e){return"entrance"===e.module_type}))):Un(e,E,"ismodel")},style:{background:"#07C160",color:"#fff",border:"1px solid #07C160",marginRight:20,display:2===(null==E?void 0:E.mode)||1===(null==E?void 0:E.mode)&&(null===(n=E.competition_modules)||void 0===n||null===(n=n.filter((function(e){return"entrance"===e.module_type})))||void 0===n?void 0:n.length)>0?"":"none"},className:m.Z.buttonsize,children:[1===(null==E?void 0:E.mode)&&"赛题入口",2===(null==E?void 0:E.mode)&&"进入课堂",3===(null==E?void 0:E.mode)&&"赛题入口"]}),"ended"===E.competition_status?(0,b.jsx)(I.ZP,{type:"primary",className:m.Z.buttonsize,disabled:!0,children:"已结束"}):null,"nearly_published"===E.competition_status?(0,b.jsx)(I.ZP,{type:"primary",className:m.Z.buttonsize,disabled:!0,children:"未发布"}):null,"nearly_published"!==E.competition_status&&E.enroll_end&&"ended"!==E.competition_status?(0,b.jsx)(I.ZP,{type:"primary",className:m.Z.buttonsize,disabled:!0,children:"报名截止"}):null,"progressing"===E.competition_status&&1!=E.enroll_end&&E.enroll_end_time?(0,b.jsx)(I.ZP,{type:"primary",disabled:F.enrolled&&!E.need_attachment,className:m.Z.buttonsize,onClick:function(e){var n;F.enrolled&&E.need_attachment?null===(n=Mn.current)||void 0===n||n.handleVisible():Un(e,E,2===E.mode?"ismodel":E.personal?"personal":"/competitions/".concat(E.identifier,"/detail/enroll"))},children:F.enrolled?E.need_attachment?"上传作品":"已报名":null!=E&&E.enroll_url?"前往大赛官网报名":"立即报名"}):null]}),null!=E&&null!==(t=E.permission)&&void 0!==t&&t.editable?(0,b.jsx)("span",{onClick:function(){return(0,ie.xg)("/competitions/".concat(E.identifier,"/detail/enroll"))},className:m.Z.myteam,children:"我的战队>>"}):(0,b.jsx)(b.Fragment,{children:"游客"!=P.userInfo.real_name&&!(null!=E&&E.enroll_url)&&E.enroll_end_time&&(0,b.jsx)("span",{onClick:function(e){return Un(e,E,2===E.mode?"ismodel":E.personal?"personal":"/competitions/".concat(E.identifier,"/detail/enroll"))},className:m.Z.myteam,children:(0,le.j5)()?"参赛战队>>":"我的战队>>"})})]})]}),(0,b.jsxs)("div",{className:m.Z.bootmdetail,children:[(0,b.jsx)("div",{className:m.Z.flex1,children:(0,b.jsx)(C.Z,{selectedKeys:["".concat(Ae)],children:E&&E.competition_modules&&E.competition_modules.map((function(e,n){if("enroll"!=e.module_type)return(0,b.jsx)(C.Z.Item,{className:m.Z.menuItem,onClick:function(){if(null!=e&&e.is_authentication){if(!(0,L.tJ)(Z))return;_.ZP.info("加入战队才能查看")}else Wn(e)},children:e.name},e.id)}))})}),(0,b.jsxs)("div",{className:m.Z.flex6,style:{padding:(rn||dn)&&0},children:[ke?(0,b.jsx)(te.Z,{dispatch:Z,userid:null==P||null===(i=P.userInfo)||void 0===i?void 0:i.user_id,Prize:Ce,Accounts:Le,getAccounts:function(){return ot.apply(this,arguments)}}):null,pe?(0,b.jsx)(ne,{HeaderDetail:E,userinfo:P.userInfo,Editable:null==E||null===(r=E.permission)||void 0===r?void 0:r.editable,getCharts:function(e){return $n.apply(this,arguments)},getChartRules:Qn,Selectkey:Ae,ChartRules:ye,ItemData:Y}):null,J?(0,b.jsx)(V,{ref:Mn,StaffDetail:F,HeaderDetail:E,userinfo:P.userInfo,Editable:null==E||null===(s=E.permission)||void 0===s?void 0:s.editable,ItemData:Y,setIssee:U,ModelType:ae,dispatch:Z}):null,J||rn||dn||pe||ke||Ve||Yn?null:(0,b.jsx)(O,{userinfo:P.userInfo,ModelType:ae,getrightdatas:Wn,dispatch:Z,MenuItem:X,setIssee:U,identifier:H,ItemData:Y}),Ve&&(0,b.jsx)(oe,{dispatch:Z,StaffDetail:F,userinfo:P.userInfo,HeaderDetail:E,Editable:null==E||null===(d=E.permission)||void 0===d?void 0:d.editable,getCharts:tt,getChartRules:lt,Selectkey:Ae,ChartRules:Ge,ItemData:Y}),rn&&(0,b.jsx)(ce,{loading:en,dispatch:Z,StaffDetail:F,userinfo:P.userInfo,HeaderDetail:E,Editable:null==E||null===(c=E.permission)||void 0===c?void 0:c.editable,getCharts:function(e){return et.apply(this,arguments)},getChartRules:lt,Selectkey:Ae,ChartRules:Ge,ItemData:Y}),dn&&(0,b.jsx)(ve,{loading:en,dispatch:Z,StaffDetail:F,userinfo:P.userInfo,HeaderDetail:E,Editable:null==E||null===(x=E.permission)||void 0===x?void 0:x.editable,getCharts:function(e){return nt.apply(this,arguments)},getChartRules:lt,Selectkey:Ae,ChartRules:Ge,ItemData:Y}),Yn&&(0,b.jsx)(Pe,{HeaderDetail:E,userinfo:P.userInfo,StaffDetail:F,Editable:null==E||null===(y=E.permission)||void 0===y?void 0:y.editable,ItemData:X,TabResults:Ge,getTabResults:lt})]})]}),(0,b.jsx)(h.Z,{}),(0,b.jsx)(k,{getResults:tt}),(0,b.jsx)(g.Z,{open:Ke,footer:null,width:720,title:"提示",centered:!0,onCancel:function(){return Qe(!1)},children:(0,b.jsxs)("div",{className:m.Z.modal,children:[(0,b.jsx)("div",{children:"华为模型王者挑战赛黄金赛正式开启啦"}),(0,b.jsxs)("div",{children:["本赛段总奖金高达",(0,b.jsx)("span",{style:{color:"#FF8C29"},children:"300,000"}),"元"]}),(0,b.jsx)("div",{children:"1、符合赛题要求的队伍(共25支)可获得奖金:12000RMB/队 ;"}),(0,b.jsx)("div",{children:"2、参与获得“荣耀殿堂”榜主的队伍,可获得由中国软件开源创新大赛组委会颁发的黄金宝箱;"}),(0,b.jsx)("div",{children:"3、各赛题精度最高的队伍,可获得由中国软件开源创新大赛组委会颁发的黄金宝箱+荣誉证书;"}),(0,b.jsx)("div",{children:"心动吧,那就快点击下方按钮报名参赛"}),(0,b.jsx)(I.ZP,{type:"primary",onClick:function(){return(0,ie.xg)("https://competition.huaweicloud.com/information/1000041485/introduction")},children:"前往报名参赛"})]})}),(0,b.jsx)(g.Z,{title:"选择参赛方式",open:fn,onCancel:function(){vn(!1)},footer:!1,children:(0,b.jsxs)("div",{style:{display:"flex",justifyContent:"space-around",height:100,alignItems:"center"},children:[(0,b.jsx)(I.ZP,{type:"primary",style:{height:40},onClick:function(){bn(!0),vn(!1)},children:"加入战队参赛"}),(0,b.jsx)(I.ZP,{style:{height:40},onClick:function(){_n(!0),vn(!1)},children:"去创建战队参赛"})]})}),jn?(0,b.jsx)(me.Z,{isjoin:jn,setJoin:bn,JoinTeams:function(e){return ct.apply(this,arguments)}}):null,xn?(0,b.jsx)(he.Z,{isAddmodle:xn,setIsAdd:_n,createTeam:function(e){return dt.apply(this,arguments)}}):null,(0,b.jsx)(xe.Z,{datas:Fn,isopen:Nn,setisopen:Ln,isShowPhone:Pn,setIsShowPhone:Rn,user:P,dispatch:Z,onOK:o()(a()().mark((function e(){var n;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Z({type:"competitions/getHeader",payload:{identifier:H}});case 2:n=e.sent,N(n);case 4:case"end":return e.stop()}}),e)})))})]})}))},91929:function(e,n,t){var i=t(82242),l=t.n(i),r=t(7557),a=t.n(r),s=t(41498),o=t.n(s),d=t(79800),u=t.n(d),c=t(57809),p=t(78241),f=t(43418),v=t(8591),m=t(98135),h=t(5112),x=t(88522),_=t(14834),g=t(89392),y=t(59301),j=t(37712),b=c.default.Option;n.Z=function(e){var n,t,i,r,s,d,Z,k,w,S,I,C,P,R,D,E,N,L,z,T,F,A,H,M,B=e.isAddmodle,V=e.setIsAdd,Y=e.createTeam,q=e.Data,O=e.user,G=void 0===O?{}:O,W=e.dispatch,J=p.Z.useForm(),U=u()(J,1)[0];console.log("---",G);var K,Q=(0,y.useState)([]),X=u()(Q,2),$=X[0],ee=X[1],ne=(0,y.useRef)((0,g.throttle)((function(e){return ae(e)}),1200,{leading:!0,trailing:!0})).current,te=(0,y.useState)([]),ie=u()(te,2),le=ie[0],re=ie[1],ae=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:return e.next=2,W({type:"account/getSchoolOption",payload:{keyword:n,limit:10}});case 2:t=e.sent,ee(null==t?void 0:t.schools),n&&""!=n&&re(null==t||null===(i=t.schools)||void 0===i?void 0:i.filter((function(e){return e.name.includes(n)})));case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,y.useEffect)((function(){var e;ae(null==G||null===(e=G.userInfo)||void 0===e?void 0:e.school_name)}),[(null==q||null===(n=q.need_apply_info)||void 0===n?void 0:n.need_apply_name)||(null==q||null===(t=q.need_apply_info)||void 0===t?void 0:t.need_apply_student_id)||(null==q||null===(i=q.need_apply_info)||void 0===i?void 0:i.need_apply_sex)||(null==q||null===(r=q.need_apply_info)||void 0===r?void 0:r.need_apply_phone)||(null==q||null===(s=q.need_apply_info)||void 0===s?void 0:s.need_apply_grade)||(null==q||null===(d=q.need_apply_info)||void 0===d?void 0:d.need_apply_teacher_name)||(null==q||null===(Z=q.need_apply_info)||void 0===Z?void 0:Z.need_apply_school)]),(0,j.jsx)(f.Z,{className:"modal_styles",centered:!0,title:(0,j.jsxs)("div",{style:{alignItems:"center",display:"flex"},children:[(0,j.jsx)("div",{style:{textAlign:"left",flex:"1"},children:"创建战队"}),(0,j.jsx)(_.Z,{onClick:function(){return V(!1)},style:{cursor:"porint"}})]}),open:B,closable:!1,width:650,destroyOnClose:!0,onOk:function(){U.submit()},onCancel:function(){return V(!1)},children:(0,j.jsxs)(p.Z,{form:U,initialValues:l()(l()({},G.userInfo),{},{sex:null==G||null===(k=G.userInfo)||void 0===k?void 0:k.gender,grade:null==G||null===(w=G.userInfo)||void 0===w?void 0:w.edu_entry_year,school:null==G||null===(S=G.userInfo)||void 0===S?void 0:S.school_name}),labelCol:{span:5},size:"large",onFinish:function(){var e=o()(a()().mark((function e(n){var t,i,r;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=null===(t=$.find((function(e){return e.name===(null==n?void 0:n.school)})))||void 0===t?void 0:t.id)||null==q||null===(i=q.need_apply_info)||void 0===i||!i.need_apply_school){e.next=4;break}return v.ZP.info("请选择正确的学校"),e.abrupt("return");case 4:Y(l()(l()({},n),{},{school_id:r}));case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:[((null==q||null===(I=q.need_apply_info)||void 0===I?void 0:I.need_apply_name)||(null==q||null===(C=q.need_apply_info)||void 0===C?void 0:C.need_apply_student_id)||(null==q||null===(P=q.need_apply_info)||void 0===P?void 0:P.need_apply_sex)||(null==q||null===(R=q.need_apply_info)||void 0===R?void 0:R.need_apply_phone)||(null==q||null===(D=q.need_apply_info)||void 0===D?void 0:D.need_apply_grade)||(null==q||null===(E=q.need_apply_info)||void 0===E?void 0:E.need_apply_teacher_name)||(null==q||null===(N=q.need_apply_info)||void 0===N?void 0:N.need_apply_school))&&(0,j.jsx)("div",{className:"mb20",children:"根据竞赛官方的规定,参赛人员需填写必填信息才可完成报名,请确保填写的信息准确完整。"}),(0,j.jsx)(p.Z.Item,{label:"队伍名称",name:"name",rules:[{required:!0,validator:function(e,n){var t;return(null==n||null===(t=n.replaceAll(" ",""))||void 0===t?void 0:t.length)>0?Promise.resolve():Promise.reject("请填写队伍名称")}}],children:(0,j.jsx)(m.Z,{maxLength:60,showCount:!0,placeholder:"请输入队伍名称"})}),(null==q||null===(L=q.need_apply_info)||void 0===L?void 0:L.need_apply_name)&&(0,j.jsx)(p.Z.Item,{label:"参赛人员姓名",name:"real_name",rules:[{required:!0,message:"请输入参赛人员姓名"},{whitespace:!0,message:"姓名不能为空"}],children:(0,j.jsx)(m.Z,{placeholder:"请输入参赛人员姓名",showCount:!0,maxLength:60})}),(null==q||null===(z=q.need_apply_info)||void 0===z?void 0:z.need_apply_sex)&&(0,j.jsx)(p.Z.Item,{label:"性别",name:"sex",rules:[{required:!0,message:"请选择参赛人员性别"}],children:(0,j.jsxs)(h.ZP.Group,{children:[(0,j.jsx)(h.ZP,{value:0,children:"男"}),(0,j.jsx)(h.ZP,{value:1,children:"女"})]})}),(null==q||null===(T=q.need_apply_info)||void 0===T?void 0:T.need_apply_student_id)&&(0,j.jsx)(p.Z.Item,{label:"学号",name:"student_id",rules:[{required:!0,message:"请输入参赛人员学号"},{whitespace:!0,message:"学号不能为空"}],children:(0,j.jsx)(m.Z,{placeholder:"请输入参赛人员学号",showCount:!0,maxLength:60})}),(null==q||null===(F=q.need_apply_info)||void 0===F?void 0:F.need_apply_phone)&&(0,j.jsx)(p.Z.Item,{label:"电话",name:"phone",rules:[{required:!0,message:"请输入参赛人员电话"},{whitespace:!0,message:"电话不能为空"}],children:(0,j.jsx)(m.Z,{placeholder:"请输入参赛人员电话",showCount:!0,maxLength:60})}),(null==q||null===(A=q.need_apply_info)||void 0===A?void 0:A.need_apply_grade)&&(0,j.jsx)(p.Z.Item,{label:"年级",name:"grade",rules:[{required:!0,message:"请选择参赛人员年级"}],children:(0,j.jsx)(c.default,{placeholder:"请选择参赛人员年级",size:"large",children:(K=(new Date).getFullYear(),Array(31).fill({}).map((function(e,n){return(0,j.jsx)(b,{value:K-n,children:(0,j.jsx)("span",{children:K-n})},n)})))})}),(null==q||null===(H=q.need_apply_info)||void 0===H?void 0:H.need_apply_teacher_name)&&(0,j.jsx)(p.Z.Item,{label:"指导老师姓名",name:"teacher_name",rules:[{required:!0,message:"请输入指导老师姓名"},{whitespace:!0,message:"指导老师姓名不能为空"}],children:(0,j.jsx)(m.Z,{placeholder:"请输入指导老师姓名",showCount:!0,maxLength:60})}),(null==q||null===(M=q.need_apply_info)||void 0===M?void 0:M.need_apply_school)&&(0,j.jsx)(p.Z.Item,{label:"学校/单位",name:"school",rules:[{required:!0,message:"请选择学校/单位"}],children:(0,j.jsx)(x.Z,{size:"large",showSearch:!0,onChange:ne,children:le.map((function(e,n){return(0,j.jsx)(b,{value:e.name,children:e.name},n)}))})})]})})}},85404:function(e,n,t){var i=t(82242),l=t.n(i),r=t(7557),a=t.n(r),s=t(41498),o=t.n(s),d=t(79800),u=t.n(d),c=t(59301),p=t(57809),f=t(78241),v=t(43418),m=t(8591),h=t(98135),x=t(5112),_=t(88522),g=t(14834),y=t(89392),j=t(37712),b=p.default.Option;n.Z=function(e){var n,t,i,r,s,d,Z,k,w,S,I,C,P,R,D,E,N,L,z,T,F,A,H,M,B=e.isjoin,V=e.setJoin,Y=e.JoinTeams,q=e.user,O=void 0===q?{}:q,G=e.dispatch,W=e.Data,J=void 0===W?{}:W,U=(0,c.useState)(""),K=u()(U,2),Q=(K[0],K[1],(0,c.useState)([])),X=u()(Q,2),$=X[0],ee=X[1],ne=f.Z.useForm(),te=u()(ne,1)[0],ie=(0,c.useRef)((0,y.throttle)((function(e){return de(e)}),1200,{leading:!0,trailing:!0})).current,le=(0,c.useState)([]),re=u()(le,2),ae=re[0],se=re[1];(0,c.useEffect)((function(){var e;de(null==O||null===(e=O.userInfo)||void 0===e?void 0:e.school_name)}),[(null==J||null===(n=J.need_apply_info)||void 0===n?void 0:n.need_apply_name)||(null==J||null===(t=J.need_apply_info)||void 0===t?void 0:t.need_apply_student_id)||(null==J||null===(i=J.need_apply_info)||void 0===i?void 0:i.need_apply_sex)||(null==J||null===(r=J.need_apply_info)||void 0===r?void 0:r.need_apply_phone)||(null==J||null===(s=J.need_apply_info)||void 0===s?void 0:s.need_apply_grade)||(null==J||null===(d=J.need_apply_info)||void 0===d?void 0:d.need_apply_teacher_name)||(null==J||null===(Z=J.need_apply_info)||void 0===Z?void 0:Z.need_apply_school)]);var oe,de=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:return e.next=2,G({type:"account/getSchoolOption",payload:{keyword:n,limit:10}});case 2:t=e.sent,ee(null==t?void 0:t.schools),n&&""!=n&&se(null==t||null===(i=t.schools)||void 0===i?void 0:i.filter((function(e){return e.name.includes(n)})));case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,j.jsx)(v.Z,{className:"modal_styles",centered:!0,title:(0,j.jsxs)("div",{style:{alignItems:"center",display:"flex"},children:[(0,j.jsx)("div",{style:{textAlign:"left",flex:"1"},children:"加入战队"}),(0,j.jsx)(g.Z,{onClick:function(){return V(!1)},style:{cursor:"porint"}})]}),open:B,width:650,closable:!1,destroyOnClose:!0,onOk:function(){te.submit()},onCancel:function(){return V(!1)},children:(0,j.jsxs)(f.Z,{form:te,size:"large",labelCol:{span:4},initialValues:l()(l()({},O.userInfo),{},{sex:null==O||null===(k=O.userInfo)||void 0===k?void 0:k.gender,grade:null==O||null===(w=O.userInfo)||void 0===w?void 0:w.edu_entry_year,school:null==O||null===(S=O.userInfo)||void 0===S?void 0:S.school_name}),onFinish:function(){var e=o()(a()().mark((function e(n){var t,i,r;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=null===(t=$.find((function(e){return e.name===(null==n?void 0:n.school)})))||void 0===t?void 0:t.id)||null==J||null===(i=J.need_apply_info)||void 0===i||!i.need_apply_school){e.next=4;break}return m.ZP.info("请选择正确的学校"),e.abrupt("return");case 4:Y(l()(l()({},n),{},{school_id:r}));case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:[((null==J||null===(I=J.need_apply_info)||void 0===I?void 0:I.need_apply_name)||(null==J||null===(C=J.need_apply_info)||void 0===C?void 0:C.need_apply_student_id)||(null==J||null===(P=J.need_apply_info)||void 0===P?void 0:P.need_apply_sex)||(null==J||null===(R=J.need_apply_info)||void 0===R?void 0:R.need_apply_phone)||(null==J||null===(D=J.need_apply_info)||void 0===D?void 0:D.need_apply_grade)||(null==J||null===(E=J.need_apply_info)||void 0===E?void 0:E.need_apply_teacher_name)||(null==J||null===(N=J.need_apply_info)||void 0===N?void 0:N.need_apply_school))&&(0,j.jsx)("div",{className:"mb20",children:"根据竞赛官方的规定,参赛人员需填写必填信息才可完成报名,请确保填写的信息准确完整。"}),(0,j.jsx)(f.Z.Item,{label:"邀请码",name:"invite_code",rules:[{required:!0,validator:function(e,n){var t;return(null==n||null===(t=n.replaceAll(" ",""))||void 0===t?void 0:t.length)>0?Promise.resolve():Promise.reject("请输入邀请码")}}],children:(0,j.jsx)(h.Z,{maxLength:60,showCount:!0,placeholder:"请输入邀请码"})}),(null==J||null===(L=J.need_apply_info)||void 0===L?void 0:L.need_apply_name)&&(0,j.jsx)(f.Z.Item,{label:"参赛人员姓名",name:"real_name",rules:[{required:!0,message:"请输入参赛人员姓名"},{whitespace:!0,message:"姓名不能为空"}],children:(0,j.jsx)(h.Z,{placeholder:"请输入参赛人员姓名",showCount:!0,maxLength:60})}),(null==J||null===(z=J.need_apply_info)||void 0===z?void 0:z.need_apply_sex)&&(0,j.jsx)(f.Z.Item,{label:"性别",name:"sex",rules:[{required:!0,message:"请选择参赛人员性别"}],children:(0,j.jsxs)(x.ZP.Group,{children:[(0,j.jsx)(x.ZP,{value:0,children:"男"}),(0,j.jsx)(x.ZP,{value:1,children:"女"})]})}),(null==J||null===(T=J.need_apply_info)||void 0===T?void 0:T.need_apply_student_id)&&(0,j.jsx)(f.Z.Item,{label:"学号",name:"student_id",rules:[{required:!0,message:"请输入参赛人员学号"},{whitespace:!0,message:"学号不能为空"}],children:(0,j.jsx)(h.Z,{placeholder:"请输入参赛人员学号",showCount:!0,maxLength:60})}),(null==J||null===(F=J.need_apply_info)||void 0===F?void 0:F.need_apply_phone)&&(0,j.jsx)(f.Z.Item,{label:"电话",name:"phone",rules:[{required:!0,message:"请输入参赛人员电话"},{whitespace:!0,message:"电话不能为空"}],children:(0,j.jsx)(h.Z,{placeholder:"请输入参赛人员电话",showCount:!0,maxLength:60})}),(null==J||null===(A=J.need_apply_info)||void 0===A?void 0:A.need_apply_grade)&&(0,j.jsx)(f.Z.Item,{label:"年级",name:"grade",rules:[{required:!0,message:"请选择参赛人员年级"}],children:(0,j.jsx)(p.default,{placeholder:"请选择参赛人员年级",size:"large",children:(oe=(new Date).getFullYear(),Array(31).fill({}).map((function(e,n){return(0,j.jsx)(b,{value:oe-n,children:(0,j.jsx)("span",{children:oe-n})},n)})))})}),(null==J||null===(H=J.need_apply_info)||void 0===H?void 0:H.need_apply_teacher_name)&&(0,j.jsx)(f.Z.Item,{label:"指导老师姓名",name:"teacher_name",rules:[{required:!0,message:"请输入指导老师姓名"},{whitespace:!0,message:"指导老师姓名不能为空"}],children:(0,j.jsx)(h.Z,{placeholder:"请输入指导老师姓名",showCount:!0,maxLength:60})}),(null==J||null===(M=J.need_apply_info)||void 0===M?void 0:M.need_apply_school)&&(0,j.jsx)(f.Z.Item,{label:"学校/单位",name:"school",rules:[{required:!0,message:"请选择学校/单位"}],children:(0,j.jsx)(_.Z,{size:"large",showSearch:!0,onChange:ie,children:ae.map((function(e,n){return(0,j.jsx)(b,{value:e.name,children:e.name},n)}))})})]})})}}}]); |