You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Shixuns__Edit__index.asy...

1 line
257 KiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

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

(self.webpackChunk=self.webpackChunk||[]).push([[56277],{76558:function(e,n,t){"use strict";t.d(n,{Z:function(){return _}});var i=t(33614),s=t(59301),a={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 112c17.7 0 32 14.3 32 32v736c0 17.7-14.3 32-32 32H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32zm-40 72H184v656h656V184zM640.01 338.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z"}}]},name:"close-square",theme:"outlined"},r=t(1393),l=function(e,n){return s.createElement(r.Z,(0,i.Z)({},e,{ref:n,icon:a}))};var _=s.forwardRef(l)},46061:function(e,n,t){"use strict";t.d(n,{Z:function(){return _}});var i=t(33614),s=t(59301),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"},r=t(1393),l=function(e,n){return s.createElement(r.Z,(0,i.Z)({},e,{ref:n,icon:a}))};var _=s.forwardRef(l)},99089:function(e,n,t){"use strict";t.d(n,{Z:function(){return L}});var i=t(7557),s=t.n(i),a=t(41498),r=t.n(a),l=t(82242),_=t.n(l),o=t(79800),c=t.n(o),u=t(59301),d=t(8591),p=t(43418),m=t(95237),h=t(24905),x=t(5112),v=t(6848),f=t(86859),g="listItem___RLEHn",j="wrap____6VVD",E="leftContent____5nA6",b="header___Lufcs",D="title___UkOuL",P="introduction___q377_",y="bottom___x89GX",O="user_img___K_sq1",C="user_name___AYxpE",M="tags_name___r0cun",S=t(21256),T=t(32007),A=t(50883),I=t(20817),w=t(58159),N=t(85750),k=t(37712),L=(0,T.connect)((function(e){var n=e.globalSetting,t=e.shixunsDetail,i=e.practiceSetting;return{globalSetting:n,shixunsDetail:t,user:e.user,practiceSetting:i}}))((function(e){e.globalSetting,e.dispatch,e.practiceSetting,e.shixunsDetail,e.user;var n=e.visible,t=e.setVisible,i=e.type,a=void 0===i?"all":i,l=e.updateData,o=e.recordId,T=e.identifier,L=(0,u.useState)([]),R=c()(L,2),B=R[0],Z=R[1],W=(0,u.useState)(0),K=c()(W,2),U=K[0],z=K[1],F=(0,u.useState)([]),H=c()(F,2),q=H[0],G=H[1],Y=(0,u.useState)({page:1,limit:4,search:"",order:"public"}),Q=c()(Y,2),J=Q[0],V=Q[1],X=(0,u.useState)([{id:"public",name:"公开数据集"},{id:"mine",name:"我的数据集"},{id:"share",name:"团队共享"},{id:"collect",name:"我收藏的"}]),$=c()(X,2),ee=$[0];$[1];(0,u.useEffect)((function(){n&&ne()}),[n,J]);var ne=function(){var e=r()(s()().mark((function e(){return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(0,w._S)({page:null==J?void 0:J.page,limit:null==J?void 0:J.limit,search:null==J?void 0:J.search,category:"all"==a?null==J?void 0:J.order:"mine"}).then((function(e){var n,t;0==(null==e?void 0:e.status)&&(Z(null==e||null===(n=e.data)||void 0===n?void 0:n.list),z(null==e||null===(t=e.data)||void 0===t?void 0:t.count))}));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),te=function(){var e=r()(s()().mark((function e(){var n;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==(null==q?void 0:q.length)){e.next=2;break}return e.abrupt("return",d.ZP.warning("请选择数据集"));case 2:return n="all"==a?{url:"/api/data_sets/batch_send_to_shixun.json",body:{shixun_identifier:T,data_set_ids:q}}:{url:"/api/data_sets/sync_my_data_sets.json",body:{attachment_ids:o,data_set_id:q[0]}},e.next=5,(0,N.ZP)(null==n?void 0:n.url,{method:"post",body:null==n?void 0:n.body});case 5:0===e.sent.status&&(d.ZP.info("添加成功"),ie(),l());case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ie=function(){t(!1),Z([]),G([]),z(0),V({page:1,limit:4,search:"",order:"public"})};return(0,k.jsxs)(p.Z,{title:"选择数据集",open:n,width:900,centered:!0,keyboard:!1,onCancel:function(){return ie()},maskClosable:!1,bodyStyle:{minHeight:400},okText:(0,k.jsxs)("div",{onClick:function(){return te()},children:["添加(",null==q?void 0:q.length,")"]}),children:[(0,k.jsxs)(m.Z,{align:"middle",justify:"space-between",className:"mt10 mb20",children:[(0,k.jsx)(S.tp,{dataSource:"all"==a?ee:[{id:"mine",name:"我的数据集"}],value:"all"==a?null==J?void 0:J.order:"mine",onChange:function(e){J.page=1,J.order=e,V(_()({},J))}}),(0,k.jsx)(S.t7,{style:{width:303},placeholder:"请搜索数据集名称",value:null==J?void 0:J.search,onChange:function(e){J.search=e,J.page=1,V(_()({},J))}})]}),0===(null==B?void 0:B.length)?(0,k.jsx)(A.Z,{customText:"暂无数据"}):(0,k.jsxs)("div",{children:[(0,k.jsx)("div",{style:{height:"410px",overflowY:"auto"},children:null==B?void 0:B.map((function(e,n){var t,i,s;return(0,k.jsx)("div",{className:g,onClick:function(n){"my"!=a?q.indexOf(e.id)>-1?G(q.filter((function(n){return n!==e.id}))):G(q.concat(e.id)):G([e.id])},children:(0,k.jsxs)("div",{style:{display:"flex"},children:[(0,k.jsx)("div",{style:{marginTop:"1px"},children:"all"==a?(0,k.jsx)(h.Z,{checked:q.includes(e.id),value:e.id}):(0,k.jsx)(x.ZP,{checked:q.includes(e.id),value:e.id})}),(0,k.jsx)("aside",{className:j,children:(0,k.jsxs)("div",{className:E,children:[(0,k.jsx)("div",{className:b,children:(0,k.jsx)("div",{className:D,children:null==e?void 0:e.title})}),(0,k.jsx)(v.Z,{title:null==e?void 0:e.introduction,children:(0,k.jsx)("div",{className:P,children:null==e?void 0:e.desc})}),(0,k.jsxs)("div",{className:y,children:[(0,k.jsx)("img",{className:O,alt:"用户头像",src:"".concat(I.Z.IMG_SERVER,"/images/").concat(null==e||null===(t=e.user_info)||void 0===t?void 0:t.image_url)}),(0,k.jsx)("div",{className:C,children:null==e||null===(i=e.user_info)||void 0===i?void 0:i.name}),null==e||null===(s=e.data_set_tags)||void 0===s?void 0:s.map((function(n,t){return t<3?(0,k.jsx)("div",{className:M,children:null==n?void 0:n.tag_name},t):3==t?(0,k.jsx)(v.Z,{title:null==e||null===(i=e.data_set_tags)||void 0===i?void 0:i.map((function(e,n){var t;if(n>2)return(null==e?void 0:e.tag_name)+(n===(null==e||null===(t=e.data_set_tags)||void 0===t?void 0:t.length)-1?"":"、")})).join(""),children:(0,k.jsx)("div",{className:M,children:"..."},t)},t):null;var i}))]})]})},n)]})},n)}))}),(0,k.jsx)(f.Z,{showTotal:function(e){return(0,k.jsxs)("span",{children:["共",(0,k.jsx)("span",{style:{color:"#165DFF",marginLeft:"3px"},children:e})," 条数据"]})},style:{marginTop:10},onChange:function(e,n){J.page=e,J.limit=n,V(_()({},J)),ne()},defaultCurrent:1,pageSize:J.limit||4,current:J.page||1,total:U})]})]})}))},13057:function(e,n,t){"use strict";t.d(n,{Z:function(){return c}});var i=t(59301),s="label___CZ1_z",a="left___ZKFRV",r="right___zVTRn",l="error___oNJNo",_=t(6848),o=t(37712),c=function(e){var n=e.name,t=e.tooltipTitle,c=e.children,u=e.required,d=e.errorKey,p=e.errorValue,m=e.errorName,h=e.errorStyle,x=void 0===h?{}:h,v=e.nameWidth,f=void 0===v?112:v,g=e.align,j=void 0===g?"center":g,E=e.contentStyle,b=void 0===E?{}:E;return(0,o.jsx)(i.Fragment,{children:(0,o.jsxs)("div",{className:s,style:{alignItems:j},children:[(0,o.jsxs)("div",{className:a,style:{width:f},children:[u&&(0,o.jsx)("span",{children:"*"}),(0,o.jsx)("div",{children:n}),!!t&&(0,o.jsx)(_.Z,{title:t,children:(0,o.jsx)("i",{className:"iconfont icon-xiaowenhao2"})})]}),(0,o.jsxs)("div",{className:r,style:b,children:[c,m&&p===d&&(0,o.jsx)("div",{className:l,style:x,children:m})]})]})})}},37512:function(e,n,t){"use strict";t.d(n,{Z:function(){return c}});var i=t(79800),s=t.n(i),a=t(59301),r="modal___yy3VB",l=t(43418),_=t(51150),o=t(37712),c=function(e){var n=e.title,t=e.children,i=e.value,c=(0,a.useState)(!1),u=s()(c,2),d=u[0],p=u[1];return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{onClick:function(){return p(!0)},children:t}),(0,o.jsxs)(l.Z,{title:n,open:d,width:1e3,destroyOnClose:!0,centered:!0,onCancel:function(){return p(!1)},className:r,footer:null,children:["string"==typeof i&&(0,o.jsx)(_.Z,{value:i||""}),"[object Array]"===Object.prototype.toString.call(i)&&(0,o.jsx)(o.Fragment,{children:null==i?void 0:i.map((function(e,n){return(0,o.jsxs)("div",{children:[(0,o.jsx)("b",{children:e.name||e.type_name}),(0,o.jsx)(_.Z,{value:e.description||""})]},n)}))})]})]})}},51016:function(e,n,t){"use strict";t.d(n,{Z:function(){return F}});var i=t(37205),s=t.n(i),a=t(7557),r=t.n(a),l=t(41498),_=t.n(l),o=t(79800),c=t.n(o),u=t(39647),d=t.n(u),p=t(59301),m=t(32007),h=t(43418),x=t(8591),v=t(3113),f=t(24905),g=t(5112),j=t(88522),E=t(49127),b=t(30518),D=t(94001),P=t(10527),y=t(93524),O=t(95341),C=t(61186),M=t.n(C),S="wrap___LhoYE",T="labelWrap___kKVu_",A="label___we33R",I="labelContent___RWgKj",w="color999___R1ot6",N="radio___S0Uhc",k="selectSchool___egsX3",L="dataPicker___zNtLB",R="modal___J1s9f",B="colorOrange___NDyE2",Z="colorYellow___Ijswi",W="bottomButton___sODGQ",K=t(37712),U=["shixunsDetail","globalSetting","loading","user","dispatch"],z="YYYY-MM-DD HH:mm",F=(0,m.connect)((function(e){var n=e.shixunsDetail,t=e.loading;return{shixunsDetail:n,globalSetting:e.globalSetting,user:e.user,loading:t}}))((function(e){var n,t,i,a,l,o,u,C=e.shixunsDetail,F=(e.globalSetting,e.loading),H=e.user,q=e.dispatch,G=(d()(e,U),(0,p.useRef)()),Y=(0,p.useState)(),Q=c()(Y,2),J=Q[0],V=Q[1],X=(0,p.useState)(),$=c()(X,2),ee=$[0],ne=$[1],te=(0,p.useState)([]),ie=c()(te,2),se=ie[0],ae=ie[1],re=(0,p.useState)([]),le=c()(re,2),_e=le[0],oe=le[1],ce=(0,p.useState)(""),ue=c()(ce,2),de=ue[0],pe=ue[1],me=(0,p.useState)(),he=c()(me,2),xe=he[0],ve=he[1],fe=(0,p.useState)(),ge=c()(fe,2),je=ge[0],Ee=ge[1],be=(0,p.useState)(),De=c()(be,2),Pe=De[0],ye=De[1],Oe=null===(n=H.userInfo)||void 0===n||null===(n=n.shixun)||void 0===n?void 0:n.editable;(0,p.useEffect)((function(){var e;G.current=null===(e=location.pathname)||void 0===e||null===(e=e.split("/"))||void 0===e?void 0:e[2],Ce()}),[]),(0,p.useEffect)((function(){var e,n,t,i,s,a;C.setting&&(V(null===(e=C.setting)||void 0===e||null===(e=e.shixun)||void 0===e?void 0:e.can_copy),ne(null===(n=C.setting)||void 0===n||null===(n=n.shixun)||void 0===n?void 0:n.use_scope),ve(!(null===(t=C.setting)||void 0===t||null===(t=t.shixun)||void 0===t||!t.opening_time)),Ee(null===(i=C.setting)||void 0===i||null===(i=i.shixun)||void 0===i?void 0:i.opening_time),ae(null===(s=C.setting)||void 0===s||null===(s=s.shixun)||void 0===s?void 0:s.scope_partment),ye(null===(a=C.setting)||void 0===a||null===(a=a.shixun)||void 0===a?void 0:a.git_size))}),[C.setting]);var Ce=function(){var e=_()(r()().mark((function e(n){var t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,q({type:"shixunsDetail/getDepartments",payload:{q:n}});case 2:(t=e.sent)&&oe(t.shools_name||[]);case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),Me=function(){var e=_()(r()().mark((function e(){var n,t,i,s,a;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,q({type:"shixunsDetail/getShixunQuote",payload:{id:G.current}});case 2:if(e.t0=e.sent,e.t0){e.next=5;break}e.t0={};case 5:a=e.t0,h.Z.confirm({centered:!0,title:"提示",okText:"确定",cancelText:"取消",width:520,content:(0,K.jsxs)("div",{className:"tc font14 ".concat(R),children:[!(null===(n=a.subjects)||void 0===n||!n.length)&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)("span",{children:["该实践项目已被应用到 ",null===(t=a.subjects)||void 0===t||null===(t=t.splice(0,2))||void 0===t?void 0:t.map((function(e){return"《".concat(e,"》")})),"等",(0,K.jsx)("span",{className:B,children:null==a?void 0:a.subjects_count}),"个实训课程"]}),(0,K.jsx)("br",{})]}),!(null===(i=a.courses)||void 0===i||!i.length)&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)("span",{children:["该实践项目已被应用到",null===(s=a.courses)||void 0===s||null===(s=s.splice(0,2))||void 0===s?void 0:s.map((function(e){return"《".concat(e,"》")})),"等",(0,K.jsx)("span",{className:B,children:null==a?void 0:a.courses_count}),"个教学课堂"]}),(0,K.jsx)("br",{})]}),(0,K.jsx)("span",{className:"".concat(Z," mt30"),children:"删除实践项目将影响课程及课堂对该实践项目的使用!请谨慎操作!"})]}),onOk:function(){var e=_()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,q({type:"shixunsDetail/deleteShixun",payload:{id:G.current}});case 2:1===e.sent.status&&(x.ZP.success("操作成功"),m.history.push("/shixuns"));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()});case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Se=function(){var e=_()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!xe||je){e.next=3;break}return x.ZP.info("请选择开启时间"),e.abrupt("return");case 3:if(1!==ee||se.length){e.next=6;break}return x.ZP.info("请选择指定单位公开"),e.abrupt("return");case 6:return e.next=8,q({type:"shixunsDetail/updatePermissionSetting",payload:{id:G.current,scope_partment:0===ee?null:se,shixun:{can_copy:J,use_scope:ee,opening_time:je,git_size:Pe}}});case 8:-1!==e.sent.status&&(x.ZP.info("权限配置保存成功!"),q({type:"shixunsDetail/getSettingsData",payload:{id:G.current}}),q({type:"shixunsDetail/getShixunsDetail",payload:{id:G.current}}));case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,K.jsxs)("div",{children:[(0,K.jsxs)("section",{className:S,children:[(0,K.jsx)("div",{style:{position:"absolute",top:"25px",right:"25px"},children:2!==(null==C||null===(t=C.detail)||void 0===t?void 0:t.shixun_status)?(0,K.jsx)(v.ZP,{danger:!0,onClick:Me,children:"删除实践项目"}):(0,K.jsx)(v.ZP,{danger:!0,onClick:function(){(0,O.gy)(q,"不能进行删除")},children:"删除实践项目"})}),(0,K.jsxs)("div",{className:T,children:[(0,K.jsx)("label",{className:A,children:"复制:"}),(0,K.jsx)("div",{className:I,children:(0,K.jsxs)("div",{children:[(0,K.jsx)(f.Z,{checked:J,onChange:function(e){return V(e.target.checked)},disabled:!Oe}),(0,K.jsx)("span",{className:"".concat(w),children:"(选中则允许已职业认证的教师复制该实训)"})]})})]}),!(((null===(i=C.detail)||void 0===i?void 0:i.shixun_status)>1||2===(null===(a=C.detail)||void 0===a?void 0:a.public))&&0===(null===(l=C.setting)||void 0===l||null===(l=l.shixun)||void 0===l?void 0:l.use_scope)&&(null===(o=C.detail)||void 0===o?void 0:o.identity)>2)&&(0,K.jsxs)("div",{className:T,children:[(0,K.jsx)("label",{className:A,children:"公开程度:"}),(0,K.jsxs)("div",{className:I,children:[(0,K.jsxs)(g.ZP.Group,{value:ee,onChange:function(e){return ne(e.target.value)},disabled:!Oe,children:[(0,K.jsxs)(g.ZP,{className:N,value:0,children:[(0,K.jsx)("span",{children:"对所有单位公开"}),(0,K.jsx)("span",{className:w,children:"(实训发布后,所有用户可见)"})]}),(0,K.jsxs)(g.ZP,{className:N,value:1,children:[(0,K.jsx)("span",{children:"对指定单位公开"}),(0,K.jsx)("span",{className:w,children:"(实训发布后,仅对下方指定单位的用户可见)"})]})]}),1===ee&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)("div",{className:"mt10",children:[(0,K.jsx)(j.Z,{showSearch:!0,className:k,placeholder:"请输入并选择单位名称",value:de,onChange:function(e){pe(e),Ce(e)},disabled:!Oe,onSelect:function(e){se.includes(e)?x.ZP.info("请勿指定相同的单位"):(pe(null),ae([].concat(s()(se),[e])))},options:null==_e?void 0:_e.map((function(e){return{value:e}}))}),(0,K.jsx)("span",{className:w,children:"(实训发布后,仅对下方指定单位的用户可见)"})]}),(0,K.jsx)("div",{className:"mt10",children:null==se?void 0:se.map((function(e){return Oe?(0,K.jsx)(E.Z,{count:"x",className:"mr20 current",onClick:function(){return ae(se.filter((function(n){return n!==e})))},children:(0,K.jsx)(v.ZP,{type:"primary",ghost:!0,children:e})}):(0,K.jsx)(v.ZP,{type:"primary",ghost:!0,className:"mr20",children:e})}))})]})]})]}),(0,K.jsxs)("div",{className:T,children:[(0,K.jsx)("label",{className:A,children:"开启时间:"}),(0,K.jsxs)("div",{className:I,children:[(0,K.jsxs)("div",{children:[(0,K.jsx)(f.Z,{checked:xe,onChange:function(e){return ve(e.target.checked)},disabled:!Oe}),(0,K.jsx)("span",{className:"".concat(w," ml10"),children:"(选中则学员在指定的开启时间后,才能开启学习;不选中则学员在实训发布后,能立即开启学习)"})]}),xe&&(0,K.jsx)(b.default,{className:"".concat(L," mt10"),format:z,locale:P.Z,disabled:!Oe,placeholder:"请输入开启时间",showToday:!1,disabledDate:function(e){return e&&e<M()().endOf("day").subtract(1,"days")},showTime:{minuteStep:30},value:je&&M()(je,z),onChange:function(e,n){return Ee(function(e){if(!e)return e;var n=e.split(":");if("00"==n[1]||"30"==n[1])return e;var t=parseInt(n[1]);if(t<30||60==t)return[n[0],"30"].join(":");if(t<60){var i=[n[0],"00"].join(":"),s="YYYY-MM-DD HH:mm",a=M()(i,s);return a.add(1,"hours"),a.format(s)}return e}(n))}})]})]}),1===(null==H||null===(u=H.userInfo)||void 0===u?void 0:u.role)&&(0,K.jsxs)("div",{className:T,style:{alignItems:"center"},children:[(0,K.jsx)("label",{className:A,children:"代码仓库容量:"}),(0,K.jsx)("div",{className:I,children:(0,K.jsxs)("div",{children:[(0,K.jsx)(D.Z,{style:{width:150},placeholder:"请输入代码仓库容量",min:1,max:10240,value:Pe,onChange:function(e){ye(e)}}),(0,K.jsx)("span",{className:"c-grey-999",children:" M "})]})})]})]}),(0,K.jsx)(y.t,{okText:"保存",hasOkBtn:Oe,loading:F.effects["shixunsDetail/updatePermissionSetting"],onCancel:function(){return m.history.push("/shixuns/".concat(G.current,"/challenges"))},onOk:Se,className:W})]})}))},93724:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";var _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(37205),_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_0__),_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(7557),_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1__),_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(41498),_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2__),_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(79800),_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3__),react__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(59301),antd__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(8591),antd__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(43418),antd__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__(20834),antd__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__(3113),antd__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__(24905),antd__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__(5112),antd__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__(81327),antd__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__(88522),antd__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__(49127),antd__WEBPACK_IMPORTED_MODULE_23__=__webpack_require__(6848),antd__WEBPACK_IMPORTED_MODULE_24__=__webpack_require__(30518),antd__WEBPACK_IMPORTED_MODULE_26__=__webpack_require__(78673),antd__WEBPACK_IMPORTED_MODULE_27__=__webpack_require__(94001),umi__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(32007),_index_less_modules__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(10462),moment__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(61186),moment__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_7__),antd_lib_date_picker_locale_zh_CN__WEBPACK_IMPORTED_MODULE_25__=__webpack_require__(10527),_components_Permission__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(51016),_utils_env__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(20817),_utils_verifyLogin__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(95341),_utils_authority__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(89260),_utils__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(84431),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(37712),timeFormat="YYYY-MM-DD HH:mm",handleDateString=function(e){if(!e)return e;var n=e.split(":");if("00"==n[1]||"30"==n[1])return e;var t=parseInt(n[1]);if(t<30||60==t)return[n[0],"30"].join(":");if(t<60){var i=[n[0],"00"].join(":"),s="YYYY-MM-DD HH:mm",a=moment__WEBPACK_IMPORTED_MODULE_7___default()(i,s);return a.add(1,"hours"),a.format(s)}return e};function Setting(_ref){var _user$userInfo,_user$userInfo2,_shixunsDetail$detail,_shixunsDetail$detail2,_shixunsDetail$detail3,_shixunsDetail$settin28,_shixunsDetail$settin29,_shixunsDetail$settin30,_user$userInfo3,_shixunsDetail$settin31,user=_ref.user,dispatch=_ref.dispatch,shixunsDetail=_ref.shixunsDetail,practiceSetting=_ref.practiceSetting,_useState=(0,react__WEBPACK_IMPORTED_MODULE_4__.useState)("1"),_useState2=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState,2),MenuSelectKey=_useState2[0],setMenuSelectKey=_useState2[1],_useState3=(0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(!0),_useState4=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState3,2),isShowSetting=_useState4[0],setIsShowSetting=_useState4[1],_useState5=(0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(),_useState6=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState5,2),taskPass=_useState6[0],setTaskPass=_useState6[1],_useState7=(0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(),_useState8=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState7,2),testSetPermission=_useState8[0],setTestSetPermission=_useState8[1],_useState9=(0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(),_useState10=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState9,2),isCopy=_useState10[0],setIsCopy=_useState10[1],_useState11=(0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(),_useState12=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState11,2),openValue=_useState12[0],setOpenValue=_useState12[1],_useState13=(0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(),_useState14=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState13,2),openAnswer=_useState14[0],setOpenAnswer=_useState14[1],_useState15=(0,react__WEBPACK_IMPORTED_MODULE_4__.useState)([]),_useState16=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState15,2),selectDepartmentList=_useState16[0],setSelectDepartmentList=_useState16[1],_useState17=(0,react__WEBPACK_IMPORTED_MODULE_4__.useState)([]),_useState18=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState17,2),departmentList=_useState18[0],setDepartmentList=_useState18[1],_useState19=(0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(""),_useState20=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState19,2),departmentValue=_useState20[0],setDepartmentValue=_useState20[1],_useState21=(0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(),_useState22=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState21,2),isOpenTime=_useState22[0],setIsOpenTime=_useState22[1],_useState23=(0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(),_useState24=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState23,2),openTime=_useState24[0],setOpenTime=_useState24[1],_useState25=(0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(),_useState26=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState25,2),codeEditPermission=_useState26[0],setCodeEditPermission=_useState26[1],_useState27=(0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(),_useState28=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState27,2),allowFileUpload=_useState28[0],setAllowFileUpload=_useState28[1],_useState29=(0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(),_useState30=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState29,2),codeHidden=_useState30[0],setCodeHidden=_useState30[1],_useState31=(0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(),_useState32=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState31,2),forbidCopy=_useState32[0],setForbidCopy=_useState32[1],_useState33=(0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(),_useState34=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState33,2),display_git_address=_useState34[0],set_display_git_address=_useState34[1],_useState35=(0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(!1),_useState36=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState35,2),disableDiscuss=_useState36[0],setDisableDiscuss=_useState36[1],_useState37=(0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(!1),_useState38=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState37,2),disableAI=_useState38[0],setdisableAI=_useState38[1],_useState39=(0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(!1),_useState40=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState39,2),openCodeDebugger=_useState40[0],setOpenCodeDebugger=_useState40[1],_useState41=(0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(!1),_useState42=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState41,2),startPermanent=_useState42[0],setStartPermanent=_useState42[1],_useState43=(0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(!1),_useState44=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState43,2),openSelfRun=_useState44[0],setOpenSelfRun=_useState44[1],_useState45=(0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(),_useState46=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState45,2),gitSize=_useState46[0],setgitSize=_useState46[1],_useState47=(0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(),_useState48=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState47,2),course_workspace_file_time=_useState48[0],setcourse_workspace_file_time=_useState48[1],_useState49=(0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(!1),_useState50=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState49,2),podSwitch=_useState50[0],setPodSwitch=_useState50[1],_useState51=(0,react__WEBPACK_IMPORTED_MODULE_4__.useState)("1"),_useState52=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState51,2),ai_user=_useState52[0],setai_user=_useState52[1],_useState53=(0,react__WEBPACK_IMPORTED_MODULE_4__.useState)(!1),_useState54=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_slicedToArray_js__WEBPACK_IMPORTED_MODULE_3___default()(_useState53,2),openLocalEvaluate=_useState54[0],setOpenLocalEvaluate=_useState54[1],params=(0,umi__WEBPACK_IMPORTED_MODULE_5__.useParams)(),diffObj={forbid_copy:"forbidCopy",task_pass:"taskPass",test_set_permission:"testSetPermission",code_edit_permission:"codeEditPermission",allow_file_upload:"allowFileUpload",can_copy:"isCopy",use_scope:"openValue",open_answer_and_test:"openAnswer",opening_time:"openTime",is_disable_discuss:"disableDiscuss",display_git_address:"display_git_address",show_code_dir:"codeHidden",ai_reply:"disableAI",open_code_debugger:"openCodeDebugger",start_permanent:"startPermanent",open_self_run:"openSelfRun",exit_delete_pod_switch:"podSwitch",open_local_evaluate:"openLocalEvaluate"},editable=null===(_user$userInfo=user.userInfo)||void 0===_user$userInfo||null===(_user$userInfo=_user$userInfo.shixun)||void 0===_user$userInfo?void 0:_user$userInfo.editable,own=null===(_user$userInfo2=user.userInfo)||void 0===_user$userInfo2||null===(_user$userInfo2=_user$userInfo2.shixun)||void 0===_user$userInfo2?void 0:_user$userInfo2.own,handleGetDepartments=function(){var e=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().mark((function e(n){var t;return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,dispatch({type:"shixunsDetail/getDepartments",payload:{q:n}});case 2:(t=e.sent)&&setDepartmentList(t.shools_name||[]);case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();(0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)((function(){var e;null!==(e=shixunsDetail.setting)&&void 0!==e&&null!==(e=e.shixun)&&void 0!==e&&e.main_type&&handleInitState()}),[shixunsDetail.setting]),(0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)((function(){dispatch({type:"shixunsDetail/getSettingsData",payload:params})}),[]);var handleSelectDepartment=function(e){selectDepartmentList.includes(e)?antd__WEBPACK_IMPORTED_MODULE_14__.ZP.info("请勿指定相同的单位"):(setDepartmentValue(null),setSelectDepartmentList([].concat(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_toConsumableArray_js__WEBPACK_IMPORTED_MODULE_0___default()(selectDepartmentList),[e])))},handleInitState=function(){var e,n,t,i,s,a,r,l,_,o,c,u,d,p,m,h,x,v,f,g,j,E,b;setCodeEditPermission(null===(e=shixunsDetail.setting)||void 0===e||null===(e=e.shixun)||void 0===e?void 0:e.code_edit_permission),setAllowFileUpload(null===(n=shixunsDetail.setting)||void 0===n||null===(n=n.shixun)||void 0===n?void 0:n.allow_file_upload),setCodeHidden(null===(t=shixunsDetail.setting)||void 0===t||null===(t=t.shixun)||void 0===t?void 0:t.show_code_dir),setForbidCopy(null===(i=shixunsDetail.setting)||void 0===i||null===(i=i.shixun)||void 0===i?void 0:i.forbid_copy),setTaskPass(null===(s=shixunsDetail.setting)||void 0===s||null===(s=s.shixun)||void 0===s?void 0:s.task_pass),setTestSetPermission(null===(a=shixunsDetail.setting)||void 0===a||null===(a=a.shixun)||void 0===a?void 0:a.test_set_permission),set_display_git_address(null===(r=shixunsDetail.setting.shixun)||void 0===r?void 0:r.display_git_address),setIsCopy(null===(l=shixunsDetail.setting)||void 0===l||null===(l=l.shixun)||void 0===l?void 0:l.can_copy),setOpenValue(null===(_=shixunsDetail.setting)||void 0===_||null===(_=_.shixun)||void 0===_?void 0:_.use_scope),setOpenAnswer(null===(o=shixunsDetail.setting)||void 0===o||null===(o=o.shixun)||void 0===o?void 0:o.open_answer_and_test),setIsOpenTime(!(null===(c=shixunsDetail.setting)||void 0===c||null===(c=c.shixun)||void 0===c||!c.opening_time)),setOpenTime(null===(u=shixunsDetail.setting)||void 0===u||null===(u=u.shixun)||void 0===u?void 0:u.opening_time),setSelectDepartmentList(null===(d=shixunsDetail.setting)||void 0===d||null===(d=d.shixun)||void 0===d?void 0:d.scope_partment),setDisableDiscuss(null===(p=shixunsDetail.setting)||void 0===p||null===(p=p.shixun)||void 0===p?void 0:p.is_disable_discuss),setdisableAI(null===(m=shixunsDetail.setting)||void 0===m||null===(m=m.shixun)||void 0===m?void 0:m.ai_reply),setOpenCodeDebugger(null===(h=shixunsDetail.setting)||void 0===h||null===(h=h.shixun)||void 0===h?void 0:h.open_code_debugger),setStartPermanent(null===(x=shixunsDetail.setting)||void 0===x||null===(x=x.shixun)||void 0===x?void 0:x.start_permanent),setOpenSelfRun(null===(v=shixunsDetail.setting)||void 0===v||null===(v=v.shixun)||void 0===v?void 0:v.open_self_run),setgitSize(null===(f=shixunsDetail.setting)||void 0===f||null===(f=f.shixun)||void 0===f?void 0:f.git_size),setcourse_workspace_file_time(null===(g=shixunsDetail.setting)||void 0===g||null===(g=g.shixun)||void 0===g?void 0:g.course_workspace_file_time),setPodSwitch(null===(j=shixunsDetail.setting)||void 0===j||null===(j=j.shixun)||void 0===j?void 0:j.exit_delete_pod_switch),setai_user(null===(E=shixunsDetail.setting)||void 0===E||null===(E=E.shixun)||void 0===E?void 0:E.ai_user),setOpenLocalEvaluate(null===(b=shixunsDetail.setting)||void 0===b||null===(b=b.shixun)||void 0===b?void 0:b.open_local_evaluate)};function handSubmeit(){return _handSubmeit.apply(this,arguments)}function _handSubmeit(){return _handSubmeit=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().mark((function e(){var n,t,i,s,a,r=arguments;return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.length>0&&void 0!==r[0]&&r[0],t=r.length>1&&void 0!==r[1]?r[1]:1,e.next=4,dispatch({type:"shixunsDetail/updateSetting",payload:{id:params.id,scope_partment:0===openValue?null:selectDepartmentList,open_answer_and_test:openAnswer,shixun_info:{ai_reply:disableAI,start_permanent:startPermanent,git_size:gitSize,course_workspace_file_time:course_workspace_file_time,ai_user:ai_user},shixun:{show_code_dir:codeHidden,forbid_copy:forbidCopy,task_pass:taskPass,test_set_permission:testSetPermission,display_git_address:display_git_address,code_edit_permission:codeEditPermission,allow_file_upload:allowFileUpload,can_copy:isCopy,use_scope:openValue,open_answer_and_test:openAnswer,opening_time:openTime,is_disable_discuss:disableDiscuss,open_code_debugger:openCodeDebugger,open_self_run:openSelfRun,exit_delete_pod_switch:podSwitch,open_local_evaluate:openLocalEvaluate},sync_origin_shixun:n}});case 4:0===(null==(i=e.sent)?void 0:i.status)&&(null!=shixunsDetail&&null!==(s=shixunsDetail.detail)&&void 0!==s&&s.copy_for_exercise||antd__WEBPACK_IMPORTED_MODULE_14__.ZP.success("修改成功"),dispatch({type:"shixunsDetail/getSettingsData",payload:params}),dispatch({type:"shixunsDetail/getShixunsDetail",payload:params}),null!=shixunsDetail&&null!==(a=shixunsDetail.detail)&&void 0!==a&&a.copy_for_exercise&&(0,_utils__WEBPACK_IMPORTED_MODULE_12__.m)(dispatch,shixunsDetail,params.id,t));case 6:case"end":return e.stop()}}),e)}))),_handSubmeit.apply(this,arguments)}console.log("----",ai_user),(0,react__WEBPACK_IMPORTED_MODULE_4__.useEffect)((function(){var _Object$keys$filter,_shixunsDetail$settin26,confirmLeave=!1;null!==(_Object$keys$filter=Object.keys(diffObj).filter((function(item){var _shixunsDetail$settin25;return(null===(_shixunsDetail$settin25=shixunsDetail.setting)||void 0===_shixunsDetail$settin25?void 0:_shixunsDetail$settin25.shixun[item])!=eval(diffObj[item])})))&&void 0!==_Object$keys$filter&&_Object$keys$filter.length&&(confirmLeave=!0),selectDepartmentList.length!=(null===(_shixunsDetail$settin26=shixunsDetail.setting)||void 0===_shixunsDetail$settin26||null===(_shixunsDetail$settin26=_shixunsDetail$settin26.shixun)||void 0===_shixunsDetail$settin26||null===(_shixunsDetail$settin26=_shixunsDetail$settin26.scope_partment)||void 0===_shixunsDetail$settin26?void 0:_shixunsDetail$settin26.length)&&(confirmLeave=!0),null==selectDepartmentList||selectDepartmentList.map((function(e,n){var t;e!=(null===(t=shixunsDetail.setting)||void 0===t||null===(t=t.shixun)||void 0===t?void 0:t.scope_partment[n])&&(confirmLeave=!0)})),dispatch({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:confirmLeave}})}),[taskPass,testSetPermission,isCopy,openValue,openAnswer,selectDepartmentList,isOpenTime,openTime,display_git_address,codeHidden,codeEditPermission,allowFileUpload,forbidCopy,disableDiscuss,disableAI,openCodeDebugger,startPermanent,openSelfRun,openLocalEvaluate]);var handleDeleteShixun=function(){var e=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().mark((function e(){var n,t,i,s,a;return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,dispatch({type:"shixunsDetail/getShixunQuote",payload:{id:params.id}});case 2:if(e.t0=e.sent,e.t0){e.next=5;break}e.t0={};case 5:a=e.t0,antd__WEBPACK_IMPORTED_MODULE_15__.Z.confirm({centered:!0,title:"提示",okText:"确定",cancelText:"取消",width:520,content:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{children:[!(null===(n=a.subjects)||void 0===n||!n.length)&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("span",{children:["该实践项目已被应用到"," ",null===(t=a.subjects)||void 0===t||null===(t=t.splice(0,2))||void 0===t?void 0:t.map((function(e){return"《".concat(e,"》")})),"等",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.colorOrange,children:null==a?void 0:a.subjects_count}),"个实训课程"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("br",{})]}),!(null===(i=a.courses)||void 0===i||!i.length)&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("span",{children:["该实践项目已被应用到",null===(s=a.courses)||void 0===s||null===(s=s.splice(0,2))||void 0===s?void 0:s.map((function(e){return"《".concat(e,"》")})),"等",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.colorOrange,children:null==a?void 0:a.courses_count}),"个教学课堂"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("br",{})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{className:"".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.colorYellow," mt30"),children:"删除实践项目将影响课程及课堂对该实践项目的使用!请谨慎操作!"})]}),onOk:function(){var e=_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_2___default()(_root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().mark((function e(){return _root_workspace_ppte5yg23_SJ5m_develop_node_modules_babel_runtime_7_23_6_babel_runtime_helpers_regeneratorRuntime_js__WEBPACK_IMPORTED_MODULE_1___default()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,dispatch({type:"shixunsDetail/deleteShixun",payload:{id:params.id}});case 2:1===e.sent.status&&(antd__WEBPACK_IMPORTED_MODULE_14__.ZP.success("操作成功"),umi__WEBPACK_IMPORTED_MODULE_5__.history.push("/shixuns"));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()});case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),handleDeleteElseShixun=function(){(0,_utils_verifyLogin__WEBPACK_IMPORTED_MODULE_10__.gy)(dispatch,"不能进行删除")};function showExitmodel(e){antd__WEBPACK_IMPORTED_MODULE_15__.Z.confirm({title:"离开此页提示",content:"系统可能不会保存您所做的更改。",okText:"离开",cancelText:"取消",onOk:function(){setMenuSelectKey(e),1===parseInt(e)?(setIsShowSetting(!0),handleInitState()):setIsShowSetting(!1),dispatch({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})}})}return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{style:{height:"100%",display:"flex",background:"#fff",position:"relative"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{style:{height:"100%",background:"#0A143D",width:"25%",maxWidth:"440px",padding:"20px 20px",color:"#ffffff"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{style:{padding:"0px 15px",fontSize:"16px"},children:"设置"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_16__.Z,{selectedKeys:[MenuSelectKey],theme:"dark",style:{background:"#0A143D",marginTop:"30px",fontSize:"14px"},onClick:function(e){var n;null!=practiceSetting&&null!==(n=practiceSetting.sideBar)&&void 0!==n&&n.confirmLeave?showExitmodel(e.key):(setMenuSelectKey(e.key),1===parseInt(e.key)?(setIsShowSetting(!0),handleInitState()):setIsShowSetting(!1))},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_16__.Z.Item,{children:"设置"},1),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_16__.Z.Item,{children:"关于实训"},2)]})]}),isShowSetting&&(null==shixunsDetail||null===(_shixunsDetail$detail=shixunsDetail.detail)||void 0===_shixunsDetail$detail?void 0:_shixunsDetail$detail.is_jupyter_lab)&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_components_Permission__WEBPACK_IMPORTED_MODULE_8__.Z,{}),isShowSetting&&!(null!=shixunsDetail&&null!==(_shixunsDetail$detail2=shixunsDetail.detail)&&void 0!==_shixunsDetail$detail2&&_shixunsDetail$detail2.is_jupyter_lab)&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{style:{width:"calc(100% - 24%)",overflow:"auto"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{style:{padding:"40px 40px",marginBottom:"70px"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("p",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.titlesize,style:{display:"flex"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{style:{flex:"1"},children:"关卡和测试集"}),2!==(null==shixunsDetail||null===(_shixunsDetail$detail3=shixunsDetail.detail)||void 0===_shixunsDetail$detail3?void 0:_shixunsDetail$detail3.shixun_status)?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__.ZP,{danger:!0,onClick:handleDeleteShixun,children:"删除实践项目"}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__.ZP,{danger:!0,onClick:handleDeleteElseShixun,children:"删除实践项目"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelWrap,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("label",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.label,children:"跳关:"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelContent,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_18__.Z,{checked:taskPass,disabled:!editable,onChange:function(e){return setTaskPass(e.target.checked)}}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{className:"c-grey-999",children:"(选中则允许学员跳关学习实训关卡任务)"})]})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelWrap,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("label",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.label,children:"测试集解锁:"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelContent,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_18__.Z,{checked:testSetPermission,disabled:!editable,onChange:function(e){return setTestSetPermission(e.target.checked)}}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{className:"c-grey-999",children:"(选中则允许学员通过金币解锁查看隐藏测试集的内容)"})]})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("p",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.titlesize,style:{marginTop:"20px"},children:"权限"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelWrap,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("label",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.label,children:"复制/合并/拆分:"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelContent,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_18__.Z,{checked:isCopy,onChange:function(e){return setIsCopy(e.target.checked)},disabled:!editable}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{className:"c-grey-999",children:"(选中则允许已职业认证的教师复制、合并和拆分该实训)"})]})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelWrap,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("label",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.label,children:"公开实训:"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelContent,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_19__.ZP.Group,{value:openValue,onChange:function(e){return setOpenValue(e.target.value)},disabled:!editable,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_20__.Z,{direction:"vertical",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_19__.ZP,{value:0,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{children:"对所有单位公开"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{className:"c-grey-999",children:"(实训发布后,所有用户可见)"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_19__.ZP,{style:{marginTop:"22px"},value:1,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{children:"对指定单位公开"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{className:"c-grey-999",children:"(实训发布后,仅对下方指定单位的用户可见)"})]})]})}),1===openValue&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.graaytitle,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_21__.Z,{showSearch:!0,className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.selectSchool,bordered:!1,placeholder:"请输入并选择单位名称",value:departmentValue,onChange:function(e){setDepartmentValue(e),handleGetDepartments(e)},disabled:!editable,onSelect:handleSelectDepartment,options:null==departmentList?void 0:departmentList.map((function(e){return{value:e}}))})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{className:"mt10",children:null==selectDepartmentList?void 0:selectDepartmentList.map((function(e){return editable?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_22__.Z,{count:"x",className:"mr20 current",onClick:function(){return setSelectDepartmentList(selectDepartmentList.filter((function(n){return n!==e})))},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__.ZP,{type:"primary",ghost:!0,children:e})}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__.ZP,{type:"primary",ghost:!0,className:"mr20",children:e})}))})]})]})]}),!(null!==(_shixunsDetail$settin28=shixunsDetail.setting)&&void 0!==_shixunsDetail$settin28&&null!==(_shixunsDetail$settin28=_shixunsDetail$settin28.shixun)&&void 0!==_shixunsDetail$settin28&&_shixunsDetail$settin28.is_jupyter)&&!(null!==(_shixunsDetail$settin29=shixunsDetail.setting)&&void 0!==_shixunsDetail$settin29&&null!==(_shixunsDetail$settin29=_shixunsDetail$settin29.shixun)&&void 0!==_shixunsDetail$settin29&&_shixunsDetail$settin29.is_jupyter_lab)&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelWrap,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("label",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.label,children:"公开答案和测试集:"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelContent,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_19__.ZP.Group,{value:openAnswer,onChange:function(e){return setOpenAnswer(e.target.value)},disabled:!editable,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_20__.Z,{direction:"vertical",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_19__.ZP,{value:1,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{children:"对所有认证教师公开"}),2!==(null===(_shixunsDetail$settin30=shixunsDetail.setting)||void 0===_shixunsDetail$settin30||null===(_shixunsDetail$settin30=_shixunsDetail$settin30.shixun)||void 0===_shixunsDetail$settin30?void 0:_shixunsDetail$settin30.status)&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_23__.Z,{title:"该选项需在实践项目发布后生效",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("i",{style:{marginLeft:10,color:"#e9b357",fontSize:14},className:"iconfont icon-jinggao-3"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{className:"c-grey-999",children:"(选中则允许已职业认证的教师查看)"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_19__.ZP,{style:{marginTop:"22px"},value:2,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{children:"仅实训合作者可见"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{className:"c-grey-999",children:"(选中则仅允许实训合作者可以直接查看,其他用户需通过金币解锁查看)"})]})]})})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelWrap,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("label",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.label,children:"开启时间:"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelContent,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_18__.Z,{checked:isOpenTime,onChange:function(e){setIsOpenTime(e.target.checked),e.target.checked||setOpenTime("")},disabled:!editable}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{className:"c-grey-999",children:"(选中则学员在指定的开启时间后才能开启挑战)"})]}),isOpenTime&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.graaytitle,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_24__.default,{className:"".concat(_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.dataPicker),format:timeFormat,locale:antd_lib_date_picker_locale_zh_CN__WEBPACK_IMPORTED_MODULE_25__.Z,bordered:!1,disabled:!editable,placeholder:"请输入开启时间",showToday:!1,disabledDate:function(e){return e&&e<moment__WEBPACK_IMPORTED_MODULE_7___default()().endOf("day").subtract(1,"days")},showTime:{minuteStep:30},value:openTime&&moment__WEBPACK_IMPORTED_MODULE_7___default()(openTime,timeFormat),onChange:function(e,n){return setOpenTime(handleDateString(n))}})})]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("p",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.titlesize,style:{marginTop:"20px"},children:"功能"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelWrap,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("label",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.label,children:"显示代码库地址:"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelContent,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_18__.Z,{checked:display_git_address,disabled:!editable,onChange:function(e){return set_display_git_address(e.target.checked)}}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{className:"c-grey-999",children:"(选中则对学员公开代码库地址,学员可以将所有代码下载到本地)"})]})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelWrap,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("label",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.label,children:"显示代码目录:"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelContent,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_18__.Z,{checked:codeHidden,disabled:!editable,onChange:function(e){setCodeHidden(e.target.checked)}}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{className:"c-grey-999",children:"(选中则学员页面显示版本库目录)"})]}),codeHidden&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{style:{background:"#f5f5f5",marginTop:"10px",borderRadius:"8px",justifyContent:"left",alignItems:"center",padding:"0px 20px"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{style:{display:"flex",marginTop:"20px"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("label",{style:{width:"150px",textAlign:"right"},children:"代码库文件修改权限:"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelContent,style:{padding:"0px"},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_18__.Z,{checked:codeEditPermission,disabled:!editable,onChange:function(e){setCodeEditPermission(e.target.checked),e.target.checked||setAllowFileUpload(e.target.checked)}}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{className:"c-grey-999",children:"(勾选后允许学员修改代码库所有文件,否则仅可修改学员任务文件)"})]})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{style:{display:"flex",marginTop:"10px",marginBottom:"20px"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("label",{style:{width:"150px",textAlign:"right"},children:"允许上传文件:"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelContent,style:{padding:"0px"},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_18__.Z,{checked:allowFileUpload,disabled:!editable,onChange:function(e){setAllowFileUpload(e.target.checked),e.target.checked&&setCodeEditPermission(e.target.checked)}}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{className:"c-grey-999",children:"(勾选后,允许用户实训挑战时,在代码目录中上传文件,否则不允许上传)"})]})})]})]})]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelWrap,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("label",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.label,children:"禁用粘贴:"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelContent,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_18__.Z,{checked:forbidCopy,disabled:!editable,onChange:function(e){return setForbidCopy(e.target.checked)}}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{className:"c-grey-999",children:"(选中则学员在编码区域无法使用粘贴功能)"})]})})]}),own&&editable&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelWrap,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("label",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.label,children:["调试器",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("a",{href:"https://www.educoder.net/forums/36718",target:"_blank",className:"iconfont icon-xiaowenhao2 font14 ml5"}),""]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelContent,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_26__.Z,{checked:openCodeDebugger,onChange:function(e){return setOpenCodeDebugger(e)}}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{className:"c-grey-999",children:"开启后学员在实践项目挑战页面可以使用代码调试工具检查代码运行情况。目前仅支持Python3, Java, C语言"})]})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelWrap,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("label",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.label,children:"自测运行:"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelContent,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_26__.Z,{checked:openSelfRun,onChange:function(e){return setOpenSelfRun(e)}}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{className:"c-grey-999",children:"(开启后,学员在实践项目挑战页面,可以使用自测运行功能)"})]})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelWrap,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("label",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.label,children:"本地评测:"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelContent,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_26__.Z,{checked:openLocalEvaluate,onChange:function(e){return setOpenLocalEvaluate(e)}}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("span",{className:"c-grey-999",children:["开启后实训挑战用户在使用客户端进行评测时将使用用户本地的算力资源减少网络带来的影响。目前仅支持Python3语言 ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("a",{target:"_blank",href:"/download",children:" 下载客户端 "}),""]})]})})]}),1===(null==user||null===(_user$userInfo3=user.userInfo)||void 0===_user$userInfo3?void 0:_user$userInfo3.role)&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelWrap,style:{alignItems:"center"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("label",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.label,children:"代码仓库容量 "}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelContent,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_27__.Z,{style:{width:150},placeholder:"请输入代码仓库容量",min:1,max:10240,value:gitSize,onChange:function(e){setgitSize(e)}}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{className:"c-grey-999",children:" M "})]})})]}),(null===(_shixunsDetail$settin31=shixunsDetail.setting)||void 0===_shixunsDetail$settin31||null===(_shixunsDetail$settin31=_shixunsDetail$settin31.shixun)||void 0===_shixunsDetail$settin31?void 0:_shixunsDetail$settin31.show_start_permanent)&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelWrap,style:{alignItems:"center"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("label",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.label,children:"保存实验临时数据:"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelContent,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_26__.Z,{checked:startPermanent,onChange:function(e){(0,_utils_authority__WEBPACK_IMPORTED_MODULE_11__.Ny)()?setStartPermanent(e):(0,_utils_verifyLogin__WEBPACK_IMPORTED_MODULE_10__.pW)(2)}}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("span",{className:"c-grey-999",children:["(开启后,学员在实验环境的/data/workspace目录将长期保存教师发送实践项目至课堂后可选择导出实验临时数据 ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("a",{target:"_blank",href:_utils_env__WEBPACK_IMPORTED_MODULE_9__.Z.API_SERVER+"/images/educoder/shixuns/导出实验文件操作指引.pdf",children:" 操作指引 "}),""]})]})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelWrap,style:{alignItems:"center"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("label",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.label,children:"默认释放实验资源:"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelContent,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_26__.Z,{checked:podSwitch,onChange:function(e){setPodSwitch(e)}}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{className:"c-grey-999",children:"(开启后,在退出实训时默认释放实验资源)"})]})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("p",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.titlesize,style:{marginTop:"20px"},children:[" ","评论区"]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelWrap,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("label",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.label,children:"显示评论区:"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelContent,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_26__.Z,{checked:!disableDiscuss,onChange:function(e){return setDisableDiscuss(!e)}}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{className:"c-grey-999",children:"(关闭后,实践项目详情页及关卡挑战页面不显示任何评论)"})]})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelWrap,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("label",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.label,children:"智能问答:"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelContent,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_26__.Z,{checked:disableAI,onChange:function(e){setdisableAI(e)}}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{className:"c-grey-999",children:"(开启后,学生的评论将由智能机器人进行回答)"})]})})]}),disableAI&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelWrap,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("label",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.label}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.labelContent,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(antd__WEBPACK_IMPORTED_MODULE_19__.ZP.Group,{value:ai_user+"",onChange:function(e){setai_user(e.target.value)},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_19__.ZP,{value:"1",children:"以头歌智能助教身份回答"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_19__.ZP,{value:"2",children:"以实训创建者身份回答"})]})})]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{style:{height:"70px",width:"76%",background:"#ffffff",boxShadow:"0px -4px 8px 1px #F1F1F1",position:"absolute",bottom:"0px",display:"flex",alignItems:"center",justifyContent:"center"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__.ZP,{style:{marginRight:"10px",width:"100px",height:"40px",borderRadius:"4px",border:"1px solid #0152d9",color:"#0152d9"},onClick:function(){umi__WEBPACK_IMPORTED_MODULE_5__.history.push("/shixuns/".concat(params.id,"/challenges"))},children:"取消"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(antd__WEBPACK_IMPORTED_MODULE_17__.ZP,{style:{marginLeft:"10px",width:"100px",height:"40px",fontSize:"16px",background:"#0152d9",borderRadius:"4px"},type:"primary",onClick:function(){var e,n;!isOpenTime||openTime?1!==openValue||selectDepartmentList.length?null!=shixunsDetail&&null!==(e=shixunsDetail.detail)&&void 0!==e&&e.is_fork_from_creator&&null!=shixunsDetail&&null!==(n=shixunsDetail.detail)&&void 0!==n&&n.copy_for_exercise?dispatch({type:"classroomList/setActionTabs",payload:{key:"同步修改",type:"setting",fn:function(e,n){handSubmeit(e,n)}}}):handSubmeit():antd__WEBPACK_IMPORTED_MODULE_14__.ZP.info("请选择指定单位公开"):antd__WEBPACK_IMPORTED_MODULE_14__.ZP.info("请选择开启时间")},children:"保存"})]})]}),!isShowSetting&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{style:{padding:"40px"},children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("p",{style:{color:"#333333",fontSize:"16px"},children:"创建者"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.itemWrap,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("img",{alt:"用户头像",height:"60",width:"60",className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.img,src:"".concat(_utils_env__WEBPACK_IMPORTED_MODULE_9__.Z.IMG_SERVER,"/images/").concat(null==practiceSetting?void 0:practiceSetting.user_image_url)}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.itemContent,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("p",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.nameWrap,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.name,children:null==practiceSetting?void 0:practiceSetting.user_name}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.actionGroup})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("p",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.schoolWrap,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span",{className:_index_less_modules__WEBPACK_IMPORTED_MODULE_6__.Z.school,children:null==practiceSetting?void 0:practiceSetting.user_school})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("p",{style:{color:"#333333",fontSize:"16px"},children:["创建时间:",null==practiceSetting?void 0:practiceSetting.created_at]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("p",{style:{color:"#333333",fontSize:"16px"},children:["更新时间:",null==practiceSetting?void 0:practiceSetting.updated_at]})]})]})]})]})}__webpack_exports__.Z=(0,umi__WEBPACK_IMPORTED_MODULE_5__.connect)((function(e){return{user:e.user,shixunsDetail:e.shixunsDetail,practiceSetting:e.practiceSetting}}))(Setting)},24958:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return zi}});var i=t(82242),s=t.n(i),a=t(39647),r=t.n(a),l=t(59301),_="practiceSetting___duHIg",o="wrapHeader___vb3NV",c="wrapLayout___z6EgF",u="wrapSidebar___TzHq8",d="wrapContent___iZrCo",p=t(7557),m=t.n(p),h=t(41498),x=t.n(h),v={flex_box_center:"flex_box_center___XeTw7",flex_space_between:"flex_space_between___Hfc9g",flex_box_vertical_center:"flex_box_vertical_center___JWkfv",flex_box_center_end:"flex_box_center_end___bKF19",flex_box_column:"flex_box_column___XWcdc",header:"header___HkrmL","flex-center":"flex-center___Xqcdj",title:"title___rc2FS",schedule:"schedule___MloKP",clickWarp:"clickWarp___yvMMm",num:"num___etFJa",subject:"subject___ZbcjS",btns:"btns___R7eGw",btn:"btn___NLvn4",simulate:"simulate___kVrJQ",exit:"exit___CTNC5"},f=t(66621),g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAACL0lEQVRIS72WvU9TURTAf4e+qBUritRXoYkaB0w0alz4B3RQExTSbjpooouiddGVxf0hTjKQ+MkANhiVwYTNwcHFRuNgdIHGYiMmVWnja6+5La8ttq99Vesd3/n4nXPuOec+ocHpu6nCecVJFCcUHBDo0eoK0gKvEZ76hNnFy7Lg5kbqCXrGVa8vzyhwVsBoFIQCG5jM+xhNj0jyd90agGmpQVHcQwg0clwjU2SUcDoVk8fVsjUAc0yNiMICOlpyXlEuKCGWuiLjzqcyoBg5xP/CueOzoGDIyaQI0DU3bN61XBa3NBUZ22CvvpMiwLTUbYHzf1gWDpmw9B2S3yoeFEykYnJBdCvaBT4265Z6cEMgNgBn9sPQNHz4ugZgGx3sltCYuojiVqvRd/th4jjsC0J0BhKf63gQLknIUs+AY60A+rfB3UEIboTIDLz65Go9J6alFgT6vAIOboeHp2CrH64+h6m37pYKFnUGWWB9tZrfAOso5Gy4Ng/ZfEl62ISpYQisgzsJuD7fNKxcXUCoE+JR2NUFiSU49wQ2GDAbBV3798tw5D7kVsENMDnXEoUDEI9AeDN8WYGsDb0B0FM0PA0va7ZOLcYpkesl7+wqQXZsqhh7LI1jMNe0TfdsKUGCnfDjJwxMQnqlae1LCrpNvQxafzc8isCDN3DjhTfneo0XB83rqtADlczAsu45D6e8Kv7LslvNon3r2sm4rQ9OGdLOJ9OBtPXRr26Qf/Hb8gvtaezbqqd4vgAAAABJRU5ErkJggg==",j=t(16896),E=t(43418),b=t(8591),D=t(85750),P=t(32007),y=t(37712),O=["globalSetting","loading","dispatch","practiceSetting","shixunsDetail"],C=(0,P.connect)((function(e){var n=e.loading;return{globalSetting:e.globalSetting,loading:n,practiceSetting:e.practiceSetting,shixunsDetail:e.shixunsDetail}}))((function(e){e.globalSetting,e.loading;var n,t,i=e.dispatch,s=e.practiceSetting,a=e.shixunsDetail,_=(r()(e,O),(0,P.useLocation)()),o=(0,l.useRef)(""),c=((0,P.useParams)(),s.title),u=s.base_info_warning,d=s.challenges_warning,p=s.service_warning,h=s.repository_warning,C=s.mirror_warning;(0,l.useEffect)((function(){var e;o.current=null===(e=_.pathname.split("/"))||void 0===e?void 0:e[2],i({type:"practiceSetting/setParams",payload:{id:o.current}}),i({type:"practiceSetting/getCommonData",payload:{id:o.current}})}),[_.pathname]),(0,l.useEffect)((function(){return(0,f.Dk)(c||"实践项目名称-未填写"),function(){(0,f.Dk)()}}));var M=function(){var e=x()(m()().mark((function e(){return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S();case 2:P.history.push("/shixuns/".concat(o.current,"/challenges"));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),S=function(){return new Promise((function(e,n){var t;null!=s&&null!==(t=s.sideBar)&&void 0!==t&&t.confirmLeave?E.Z.confirm({title:"离开此页提示",content:"系统可能不会保存您所做的更改。",okText:"离开",cancelText:"取消",onOk:function(){i({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}}),e()},onCancel:function(){n()}}):e()}))},T=function(e){var n;if(e!==(null==s?void 0:s.sideBar.tabsActive)){var t=function(){P.history.push("/shixuns/".concat(o.current,"/edit?tabId=").concat(e)),i({type:"practiceSetting/setSideBarTabs",payload:{tabsActive:e,selectPath:"",confirmLeave:!1}})};null!=s&&null!==(n=s.sideBar)&&void 0!==n&&n.confirmLeave?E.Z.confirm({title:"离开此页提示",content:"系统可能不会保存您所做的更改。",okText:"离开",cancelText:"取消",onOk:function(){t()}}):t()}},A=function e(n){var t,i;n=null!==(t=n)&&void 0!==t&&t.includes(".json")?n:"".concat(n,".json"),E.Z.confirm({centered:!0,title:"提示",okText:"确定",cancelText:"取消",content:(0,y.jsx)("div",{className:"tc font16",children:"实训已经更新了,正在为您重置!"}),onOk:(i=x()(m()().mark((function t(){var i,s;return m()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,D.ZP)("/api"+n,{method:"get"});case 2:if(i=t.sent){t.next=5;break}return t.abrupt("return");case 5:return b.ZP.success("重置成功,正在进入实践项目!"),t.next=8,(0,j.Ir)({id:i.shixun_identifier});case 8:if(null==(s=t.sent)||!s.game_identifier){t.next=12;break}return(0,f.xg)("/tasks/".concat(s.game_identifier)),t.abrupt("return");case 12:2===(null==s?void 0:s.status)?e(null==s?void 0:s.message):3===(null==s?void 0:s.status)&&I(null==s?void 0:s.message);case 13:case"end":return t.stop()}}),t)}))),function(){return i.apply(this,arguments)})})},I=function(e){E.Z.confirm({centered:!0,title:"提示",okText:"确定",cancelText:"取消",content:(0,y.jsxs)("div",{className:"tc font16",children:["目前该实践项目尚在内测中,将于",e,"之后开放,谢谢!"]})})},w=function(){var e=x()(m()().mark((function e(n,t){var s,r,l;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S();case 2:if((0,f.L9)(["实践项目","设置","模拟实战"]),!(null!==(s=a.detail)&&void 0!==s&&s.is_jupyter||null!==(r=a.detail)&&void 0!==r&&r.is_jupyter_lab)){e.next=6;break}return i({type:"shixunsDetail/execJupyter",payload:{id:o.current}}).then((function(e){null!=e&&e.identifier&&(null===P.history||void 0===P.history||P.history.push("/tasks/".concat(e.identifier,"/jupyter")))})),e.abrupt("return");case 6:if(i({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"正在进入实践项目,请稍后..."}}),!t){e.next=13;break}return e.next=10,(0,j.BK)({id:n});case 10:e.t0=e.sent,e.next=16;break;case 13:return e.next=15,(0,j.Ir)({id:n});case 15:e.t0=e.sent;case 16:if(l=e.t0,i({type:"globalSetting/setGlobalLoading",payload:{show:!1,text:""}}),!(null!=l&&l.game_identifier||null!=l&&l.identifier)){e.next=21;break}return(0,f.xg)(t?"/tasks/".concat(null==l?void 0:l.identifier,"/jupyter"):"/tasks/".concat(l.game_identifier)),e.abrupt("return");case 21:-3===(null==l?void 0:l.status)?(0,f.eF)():2===(null==l?void 0:l.status)?A(null==l?void 0:l.message):3===(null==l?void 0:l.status)&&I(null==l?void 0:l.message);case 22:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),N=function(){var e=x()(m()().mark((function e(){return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S();case 2:i({type:"practiceSetting/setSideBarTabs",payload:{tabsActive:"information"}});case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),k=function(e){return{borderBottomColor:(null==s?void 0:s.sideBar.tabsActive)===e?"#0152d9":"transparent"}};return(0,y.jsxs)("div",{className:v.header,children:[(0,y.jsxs)("aside",{className:v.title,children:[(0,y.jsx)("i",{onClick:M,style:{color:"#fff",marginRight:20},className:"icon iconfont icon-fanhui1"}),(0,y.jsx)("span",{className:v.edit,children:c||"实践项目名称-未填写"}),(0,y.jsx)("i",{onClick:N,className:"icon iconfont icon-xiugai1"})]}),(0,y.jsxs)("aside",{className:v.schedule,children:[(0,y.jsxs)("div",{children:[(0,y.jsxs)("span",{style:k("information"),className:v.clickWarp,onClick:function(){return T("information")},children:[u?(0,y.jsx)("span",{className:v.num,children:"1"}):(0,y.jsx)("img",{src:g}),(0,y.jsx)("span",{className:v.subject,children:"基本信息"})]}),(0,y.jsx)("i",{className:"iconfont icon-lujing"})]}),(0,y.jsxs)("div",{children:[(0,y.jsxs)("span",{style:k("warehouse"),className:v.clickWarp,onClick:function(){return T("warehouse")},children:[h?(0,y.jsx)("span",{className:v.num,children:"2"}):(0,y.jsx)("img",{src:g}),(0,y.jsx)("span",{className:v.subject,children:"代码仓库"})]}),(0,y.jsx)("i",{className:"iconfont icon-lujing"})]}),(null==a?void 0:a.detail)&&!(null!=a&&null!==(n=a.detail)&&void 0!==n&&n.is_jupyter_lab)&&(0,y.jsxs)("div",{children:[(0,y.jsxs)("span",{style:k("level"),className:v.clickWarp,onClick:function(){return T("level")},children:[d?(0,y.jsx)("span",{className:v.num,children:"3"}):(0,y.jsx)("img",{src:g}),(0,y.jsx)("span",{className:v.subject,children:"任务关卡"})]}),(0,y.jsx)("i",{className:"iconfont icon-lujing"})]}),(null==a?void 0:a.detail)&&(null==a||null===(t=a.detail)||void 0===t?void 0:t.is_jupyter_lab)&&(0,y.jsxs)("div",{children:[(0,y.jsxs)("span",{style:k("service"),className:v.clickWarp,onClick:function(){return T("service")},children:[p?(0,y.jsx)("span",{className:v.num,children:"3"}):(0,y.jsx)("img",{src:g}),(0,y.jsx)("span",{className:v.subject,children:"服务"})]}),(0,y.jsx)("i",{className:"iconfont icon-lujing"})]}),(0,y.jsx)("div",{children:(0,y.jsxs)("span",{style:k("environment"),className:v.clickWarp,onClick:function(){return T("environment")},children:[C?(0,y.jsx)("span",{className:v.num,children:"4"}):(0,y.jsx)("img",{src:g}),(0,y.jsx)("span",{className:v.subject,children:"实验环境"})]})})]}),(0,y.jsx)("aside",{className:v.btns,children:(0,y.jsx)("div",{className:v.simulate,onClick:function(){return w(o.current,!1)},children:"模拟实战"})})]})})),M=t(79800),S=t.n(M),T="information___HnFAg",A="scroll___SzyY_",I="formWrap___dlZEW",w="img___ESi1t",N=t(95992),k=t(78241),L=t(3113),R=t(92832),B=t(19842),Z=t(95237),W=t(43604),K=t(53326),U=t(24905),z=t(37205),F=t.n(z),H="btn___CiIEf",q="s1___JCH7l",G="s2___jSyjE",Y=["InputRight","value","onChange"],Q=function(e){var n=e.InputRight,t=e.value,i=void 0===t?[]:t,a=e.onChange,_=r()(e,Y),o=(0,l.useState)(),c=S()(o,2),u=c[0],d=c[1],p=function(e){e.preventDefault(),u&&(i.findIndex((function(e){return e.name===u}))>-1?b.ZP.warning("不允许添加相同标签"):(a([].concat(F()(i),[{id:null,name:u}])),d(null)))};return(0,y.jsxs)("div",{children:[(0,y.jsx)(R.Z,s()({bordered:!1,style:{width:600},value:u,onChange:function(e){return d(e.target.value)},onPressEnter:p,onBlur:p},_)),n||(0,y.jsx)("span",{className:"pl20 font14 c-light-black",children:"回车添加标签"}),(0,y.jsx)("div",{className:"mt20",children:null==i?void 0:i.map((function(e,n){return(0,y.jsxs)("div",{className:H,children:[(0,y.jsx)("span",{className:q,children:e.name}),(0,y.jsx)("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABjUlEQVQ4T61VsUoDQRB9s+eVYifkUlqIWCW3sbBMqYUR0cbfUPETxPgZ2giigpZaCnKXpBK1sMydpIx25+7ISu5ILhsjclvuzLx5M292lmA57PtuF2gIYIMBSYBn3BiICAg1cF0GrqjVSvLhlL+IqtVNEDUZWLAlS+8IeAPzvtduXw77ZYAMiEjKI2LeY2AskQ2cAGaiEy8MDwnQxicL7Ep5bDL+xmqijahZDsODDHBQ5sVfmVn6xmDeMuWTESAGnqf1bBpz09MSsESx729r4DwfIIA6hPjUSt2AaP7Hztwj5nXHdd0vpR7yMQzsUOT7pwzsjgEKsVIKgiCu1Za1UvfGLhynXgqCp6hSkSxEYCn9jLq+/wJgcawk5l4KYECN3YBlCVLWo4GvhmGfgVlrj4ZAjX0KmBmZD8Owj4IAMQAsvGSrKKR1zet0QpsosZQrmvnRKsqksZlxnFWVJAkT3Y6MDbAmgDlFdGcdm8IH22Qp9OmltAtdDoPlWez6SpkWtmCHFTNCvQMN/scX8A1e4fnIOEHt8AAAAABJRU5ErkJggg==",className:G,onClick:function(){return function(e){var n=i.filter((function(n,t){return t!==e}));a(n)}(n)}})]},n)}))})]})},J=t(89392),V=t(20817),X="complete___zRKx3",$="cancel___D5r7A",ee="save___sa92o",ne=(0,P.connect)()((function(e){e.dispatch;var n=e.onCancel,t=e.onSave,i=e.loading,s=void 0!==i&&i;return(0,y.jsxs)("div",{className:X,children:[(0,y.jsx)("div",{onClick:n,className:$,children:"取消"}),(0,y.jsx)(L.ZP,{type:"primary",loading:s,onClick:t,className:ee,children:"保存"})]})})),te=t(84431),ie=t(46061),se=t(21884),ae=t(51150),re=["globalSetting","loading","dispatch","practiceSetting","problemset","shixunsDetail"],le=(0,P.connect)((function(e){var n=e.problemset,t=e.loading;return{globalSetting:e.globalSetting,loading:t,practiceSetting:e.practiceSetting,problemset:n,shixunsDetail:e.shixunsDetail}}))((function(e){e.globalSetting,e.loading;var n,t,i=e.dispatch,a=e.practiceSetting,_=e.problemset,o=e.shixunsDetail,c=(r()(e,re),k.Z.useForm()),u=S()(c,1)[0],d=(0,l.useState)({}),p=S()(d,2),h=p[0],v=p[1],g=(0,l.useState)(!1),j=S()(g,2),O=j[0],C=j[1],M=(0,l.useState)(!1),z=S()(M,2),F=z[0],H=z[1],q=(0,l.useState)(!1),G=S()(q,2),Y=G[0],X=G[1],$=(0,l.useState)(""),ee=S()($,2),le=ee[0],_e=ee[1],oe=(0,l.useState)(""),ce=S()(oe,2),ue=ce[0],de=ce[1],pe=(0,l.useState)(""),me=S()(pe,2),he=me[0],xe=me[1],ve=(0,l.useState)(),fe=S()(ve,2),ge=fe[0],je=fe[1],Ee=(0,l.useRef)({}),be=(0,l.useRef)(""),De=(0,l.useRef)(""),Pe=(0,l.useRef)(""),ye=(0,l.useRef)(null),Oe=(0,l.useRef)((0,J.throttle)((function(){return Ne()}),2e3,{leading:!0,trailing:!1})).current,Ce=a.id,Me=(0,l.useState)(!1),Se=S()(Me,2),Te=Se[0],Ae=Se[1];(0,l.useEffect)((function(){Ce&&we()}),[Ce]),(0,l.useEffect)((function(){return"{}"!==JSON.stringify(h)&&Ie(),function(){clearTimeout(ye.current)}}),[h,le,he,ue]);var Ie=function(){clearTimeout(ye.current),ye.current=setTimeout((function(){(0,J.isEqual)(h,Ee.current)&&le===be.current&&he===De.current&&ue===Pe.current?i({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}}):i({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!0}})}),500)},we=function(){var e=x()(m()().mark((function e(){var n,t,a,r,l,_,c;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i({type:"problemset/getEditDisciplines",payload:{source:"shixun"}}),e.next=3,(0,D.ZP)("/api/shixuns/".concat(Ce,"/edit_base_info.json"),{method:"get"});case 3:0===(n=e.sent).status&&(_=s()(s()({},n.data),{},{description:(0,te.S)(n.data.description)}),c={description:_.description,shixun_tags:_.shixun_tags,name:_.name,course:(null==_||null===(t=_.disciplines)||void 0===t?void 0:t.length)>0?[null==_||null===(a=_.disciplines)||void 0===a||null===(a=a[0])||void 0===a?void 0:a.id,null==_||null===(r=_.disciplines)||void 0===r||null===(r=r[0])||void 0===r||null===(r=r.sub_discipline)||void 0===r?void 0:r.id]:[]},null!==(l=o.detail)&&void 0!==l&&l.is_jupyter_lab&&(c.jupyter_show_description=n.data.jupyter_show_description),u.setFieldsValue(c),Ee.current=s()({},c),be.current=_.attachment_id||"",De.current=_.cover_image_id||"",Pe.current=_.attachment_id_b||"",v(s()({},c)),_e(_.attachment_id||""),de(_.attachment_id_b||""),xe(_.cover_image_id||""),je(_.cover_image||""));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ne=function(){(0,f.L9)(["实践项目","设置","基本信息","保存"]),u.submit()},ke=function(e){var n,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=e.name,l=e.description,_=e.shixun_tags,c=e.course,u=e.jupyter_show_description,d=void 0!==u&&u,p={name:r,description:l,shixun_tags:_,attachment_id:le,cover_image_id:he,attachment_id_b:ue,sub_discipline_ids:c[1]};null!==(n=o.detail)&&void 0!==n&&n.is_jupyter_lab&&(p=s()(s()({},p),{},{jupyter_show_description:d}));var v=(0,D.ZP)("/api/shixuns/".concat(Ce,"/base_info_save.json"),{method:"post",body:{shixun:s()({},p),sync_origin_shixun:t}});v.then(function(){var e=x()(m()().mark((function e(n){var t,s,r,l,_;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==n.status){e.next=13;break}if(null!=o&&null!==(t=o.detail)&&void 0!==t&&t.copy_for_exercise||b.ZP.success("保存成功"),i({type:"practiceSetting/getCommonData",payload:{id:Ce}}),i({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}}),Ee.current={description:h.description,shixun_tags:h.shixun_tags,name:h.name},be.current=le,De.current=he,Pe.current=ue,null==o||null===(s=o.detail)||void 0===s||!s.copy_for_exercise){e.next=13;break}return e.next=11,i({type:"shixunsDetail/saveCopyForExercise",payload:{id:Ce,save_type:a}});case 11:r=e.sent,1===a?null!=r&&null!==(l=r.data)&&void 0!==l&&l.exists_same_shixun_name?i({type:"classroomList/setActionTabs",payload:{key:"重名修改",name:null==r||null===(_=r.data)||void 0===_?void 0:_.shixun_name,getBaseInfo:function(){we()}}}):(b.ZP.info("保存成功"),i({type:"classroomList/setActionTabs",payload:{}})):(i({type:"classroomList/setActionTabs",payload:{}}),0===(null==r?void 0:r.status)&&E.Z.info({title:"提示",width:460,icon:null,centered:!0,content:(0,y.jsx)("div",{children:(0,y.jsx)("div",{children:"实训同步修改完成,请验证实训是否可以正常使用。"})}),okText:"前往原实训",onOk:function(){var e;(0,f.xg)("/shixuns/".concat(null==o||null===(e=o.detail)||void 0===e||null===(e=e.fork_from)||void 0===e?void 0:e.fork_identifier,"/challenges"))}}));case 13:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}())},Le=function(){var e,n=function(){P.history.push("/shixuns/".concat(Ce,"/challenges")),i({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})};null!=a&&null!==(e=a.sideBar)&&void 0!==e&&e.confirmLeave?E.Z.confirm({title:"离开此页提示",content:"系统可能不会保存您所做的更改。",okText:"离开",cancelText:"取消",onOk:function(){n()}}):n()};function Re(e){var n="image/jpeg"===e.type||"image/png"===e.type;return n||b.ZP.error("请上传jpg或png的图片!"),n}var Be=(0,y.jsx)(L.ZP,{loading:O,icon:(0,y.jsx)(ie.Z,{}),children:"选择上传文件"}),Ze=(0,y.jsx)(L.ZP,{loading:Y,icon:(0,y.jsx)(ie.Z,{}),children:"选择上传文件"}),We=(0,y.jsx)(L.ZP,{loading:F,icon:(0,y.jsx)(ie.Z,{}),children:"选择上传文件"});return(0,y.jsxs)("div",{className:T,children:[(0,y.jsxs)("section",{className:A,children:[(0,y.jsx)("header",{children:"基本信息"}),(0,y.jsxs)("div",{className:I,children:[" ",(0,y.jsxs)(k.Z,{form:u,scrollToFirstError:!0,layout:"vertical",onValuesChange:function(e,n){v(s()({},n))},onFinish:function(e){var n,t;null!=o&&null!==(n=o.detail)&&void 0!==n&&n.is_fork_from_creator&&null!=o&&null!==(t=o.detail)&&void 0!==t&&t.copy_for_exercise?i({type:"classroomList/setActionTabs",payload:{key:"同步修改",value:e,type:"information",fn:function(e,n,t){ke(e,n,t)}}}):ke(e)},children:[(0,y.jsx)(k.Z.Item,{name:"name",label:"名称:",rules:[{required:!0,message:"请输入名称"},{max:60,message:"请输入名称最大限制60个字符"},{whitespace:!0,message:"请勿输入空格"}],children:(0,y.jsx)(R.Z,{bordered:!1,placeholder:"请输入名称最大限制60个字符",suffix:"".concat((null===(n=h.name)||void 0===n?void 0:n.length)||0,"/60")})}),(0,y.jsx)(k.Z.Item,{className:"customAddTags",name:"shixun_tags",label:(0,y.jsxs)("div",{children:["技能标签 :"," ",(0,y.jsx)("span",{className:"pl10 font14 c-light-black",children:"学员通过所有任务关卡,将获得技能标签"})]}),rules:[{required:!0,message:"请选输入技能标签"}],children:(0,y.jsx)(Q,{placeholder:"添加标签"})}),(0,y.jsx)(k.Z.Item,{label:"方向&课程:",name:"course",labelCol:{span:5},wrapperCol:{span:5},children:(0,y.jsx)(B.Z,{placeholder:"请选择...",allowClear:!1,options:_.courseOptions,getPopupContainer:function(e){return e.parentNode}})}),(0,y.jsxs)(Z.Z,{children:[(0,y.jsx)(W.Z,{children:(0,y.jsx)(k.Z.Item,{label:"顶部背景图:",children:le?(0,y.jsxs)("div",{className:w,children:[(0,y.jsx)("img",{src:(0,ae.z)("/api/attachments/"+le,!0),alt:"avatar",style:{width:"100%"}}),(0,y.jsx)("div",{children:(0,y.jsx)(se.Z,{onClick:function(){return _e("")},style:{fontSize:"16px",color:"red"}})})]}):(0,y.jsx)(K.Z,{withCredentials:!0,name:"file",showUploadList:!1,action:"".concat(V.Z.API_SERVER,"/api/attachments.json"),beforeUpload:Re,onChange:function(e){var n;"uploading"!==e.file.status?"done"===e.file.status&&(C(!1),_e(null==e||null===(n=e.file)||void 0===n||null===(n=n.response)||void 0===n?void 0:n.id)):C(!0)},children:Be})})}),(0,y.jsx)(W.Z,{className:"c-grey-999",children:(0,y.jsx)("div",{style:{marginTop:71,marginLeft:20},children:"说明支持上传jpg/png等格式文件文件大小不能超过2M,建议使用1920*200像素如不上传默认使用系统图片。"})})]}),(0,y.jsxs)(Z.Z,{children:[(0,y.jsx)(W.Z,{children:(0,y.jsx)(k.Z.Item,{label:"顶部内容图:",children:ue?(0,y.jsxs)("div",{className:w,children:[(0,y.jsx)("img",{src:(0,ae.z)("/api/attachments/"+ue,!0),alt:"avatar",style:{width:"100%"}}),(0,y.jsx)("div",{children:(0,y.jsx)(se.Z,{onClick:function(){return de("")},style:{fontSize:"16px",color:"red"}})})]}):(0,y.jsx)(K.Z,{withCredentials:!0,name:"file",showUploadList:!1,action:"".concat(V.Z.API_SERVER,"/api/attachments.json"),beforeUpload:Re,onChange:function(e){var n;"uploading"!==e.file.status?"done"===e.file.status&&(H(!1),de(null==e||null===(n=e.file)||void 0===n||null===(n=n.response)||void 0===n?void 0:n.id)):H(!0)},children:We})})}),(0,y.jsx)(W.Z,{className:"c-grey-999",children:(0,y.jsx)("div",{style:{marginTop:71,marginLeft:20},children:"说明支持上传jpg/png等格式文件文件大小不能超过2M,建议使用1920*200像素如不上传默认使用系统图片。"})})]}),(0,y.jsxs)(Z.Z,{children:[(0,y.jsx)(W.Z,{children:(0,y.jsx)(k.Z.Item,{label:"列表封面图:",children:he||ge?(0,y.jsxs)("div",{className:w,children:[(0,y.jsx)("img",{src:(0,ae.z)(Te?"/api/attachments/"+he:ge,!0),alt:"avatar",style:{width:"100%"}}),(0,y.jsx)("div",{children:(0,y.jsx)(se.Z,{onClick:function(){xe(""),je("")},style:{fontSize:"16px",color:"red"}})})]}):(0,y.jsx)(K.Z,{withCredentials:!0,name:"file",showUploadList:!1,action:"".concat(V.Z.API_SERVER,"/api/attachments.json"),beforeUpload:Re,onChange:function(e){var n;"uploading"!==e.file.status?"done"===e.file.status&&(X(!1),xe(null==e||null===(n=e.file)||void 0===n||null===(n=n.response)||void 0===n?void 0:n.id),Ae(!0)):X(!0)},children:Ze})})}),(0,y.jsx)(W.Z,{className:"c-grey-999",children:(0,y.jsx)("div",{style:{marginTop:71,marginLeft:20},children:"说明支持上传jpg/png等格式文件文件大小不能超过2M,建议使用290*218像素如不上传默认使用系统图片。"})})]}),(0,y.jsx)(k.Z.Item,{name:"description",label:"简介:",children:(0,y.jsx)(N.Z,{defaultValue:h.description||"",watch:!0})}),(null===(t=o.detail)||void 0===t?void 0:t.is_jupyter_lab)&&(0,y.jsx)(k.Z.Item,{name:"jupyter_show_description",valuePropName:"checked",children:(0,y.jsx)(U.Z,{children:"显示任务要求(勾选后,将简介作为任务要求显示在实践项目挑战页面)"})})]})]})]}),(0,y.jsx)(ne,{onSave:Oe,onCancel:function(){Le()},loading:O||Y||F})]})})),_e=t(72016),oe={flex_box_center:"flex_box_center___eoeVu",flex_space_between:"flex_space_between___f9Khj",flex_box_vertical_center:"flex_box_vertical_center___mDOuj",flex_box_center_end:"flex_box_center_end___q43Rs",flex_box_column:"flex_box_column___lnTOC",level:"level___W39_7",left:"left___xugM0",container:"container___MnoCi",title:"title___HNuSO",listWrap:"listWrap___Oz5IK",list:"list___Fq6dF",s3:"s3___piVr6",s2:"s2___jJaip",listActive:"listActive___e7FOo",os:"os___Zt66K",btns:"btns___mA9Xb",btnsWrap:"btnsWrap___hx2vE",icon:"icon___l26_g",btn:"btn___AF61O",d1:"d1___WyJ4s",d2:"d2___GQq5w",shrink:"shrink___NbOqs",elseShrink:"elseShrink___ZoNE2",right:"right___zgEq_",addIcon:"addIcon___aVZVl"},ce=t(95341),ue=t(71418),de=t(64165),pe=t(29747),me=["globalSetting","dispatch","practiceSetting"],he=(0,P.connect)((function(e){return{globalSetting:e.globalSetting,practiceSetting:e.practiceSetting}}))((function(e){e.globalSetting;var n=e.dispatch,t=e.practiceSetting,i=(r()(e,me),(0,P.useLocation)()),a=(0,P.useSearchParams)(),_=S()(a,1)[0],o=(0,l.useState)(!1),c=S()(o,2),u=c[0],d=c[1],p=(0,l.useState)({}),h=S()(p,2),v=h[0],f=h[1],g=(0,l.useState)(!0),b=S()(g,2),D=b[0],O=b[1],C=(0,l.useState)(!1),M=S()(C,2),T=M[0],A=M[1],I=(0,l.useState)(null),w=S()(I,2),N=w[0],k=w[1],L=(0,l.useRef)(!1),R=t.id,B=t.updateIndex,Z=t.is_published,W=t.newQuestion,K=v.challenge_list,U=void 0===K?[]:K;(0,l.useEffect)((function(){if(R)return H(),function(){n({type:"practiceSetting/setParams",payload:{newQuestion:null}})}}),[R,B]),(0,l.useEffect)((function(){F()}),[i]);var z,F=function(){var e=i.pathname.split("/");(e.includes("newquestion")||e.includes("new")||_.get("tabId"))&&(L.current=!0)},H=function(){var e=x()(m()().mark((function e(){var t,s,a,r,l,_,o;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return O(!0),e.next=3,(0,j.n5)({id:R});case 3:null!=(a=e.sent)&&null!==(t=a.challenge_list)&&void 0!==t&&t.length&&(r=i.pathname.split("/"),l=a.challenge_list.find((function(e){return String(e.challenge_id)===r[4]})),r.includes("newquestion")||r.includes("new")?(o=a.challenge_list[(null===(_=a.challenge_list)||void 0===_?void 0:_.length)-1],n({type:"practiceSetting/setParams",payload:{newQuestion:{st:r.includes("new")?0:1,name:""}}}),k(void 0),Y(o)):r[4]&&l?q(l,!1):q(a.challenge_list[0])),null!=a&&null!==(s=a.challenge_list)&&void 0!==s&&s.length||k(null),f(a),O(!1);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),q=function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(k(e.challenge_id),Y(e),n){var t="/shixuns/".concat(R,"/edit/").concat(e.challenge_id,"/").concat(1===e.st?"editquestion":"editcheckpoint");P.history.push(t)}},G=function(e,n){if(e.destination){var t=function(e,n,t){var i=Array.from(e),s=i.splice(n,1),a=S()(s,1)[0];return i.splice(t,0,a),i}(n,e.source.index,e.destination.index);f(s()(s()({},v),{},{challenge_list:t}));var i=t.map((function(e){return e.challenge_id}));(0,j.xg)({id:R,ids:i}).then((function(e){0!==e.status&&f(s()(s()({},v),{},{challenge_list:n}))}))}},Y=function(e){n({type:"practiceSetting/setParams",payload:{selectQuestionParams:e}})},Q=function(){var e=x()(m()().mark((function e(t,i){var s;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==N){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,J();case 4:k(t),Y(i),n({type:"practiceSetting/setParams",payload:{newQuestion:null}}),s="/shixuns/".concat(R,"/edit/").concat(t,"/").concat(1===i.st?"editquestion":"editcheckpoint"),P.history.push(s);case 9:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),J=function(){return new Promise((function(e,i){var s;null!=t&&null!==(s=t.sideBar)&&void 0!==s&&s.confirmLeave?E.Z.confirm({title:"离开此页提示",content:"系统可能不会保存您所做的更改。",okText:"离开",cancelText:"取消",onOk:function(){n({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}}),e()},onCancel:function(){i()}}):e()}))},V=function(){var e=x()(m()().mark((function e(t){return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,J();case 2:"new"===t?P.history.push("/shixuns/".concat(R,"/edit/new")):P.history.push("/shixuns/".concat(R,"/edit/newquestion")),d(!1),k(void 0),n({type:"practiceSetting/setParams",payload:{newQuestion:{st:"new"===t?0:1,name:""}}});case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,y.jsxs)("div",{className:oe.level,children:[(0,y.jsxs)("aside",{className:oe.left,style:{width:T?"0":"25%"},children:[(0,y.jsxs)("div",{className:oe.container,children:[(0,y.jsxs)("div",{className:oe.title,children:["任务关卡(",U.length,")"]}),(0,y.jsx)("div",{className:oe.listWrap,children:D?(0,y.jsx)(ue.Z,{size:"middle"}):U.length||W?(z=U,(0,y.jsxs)(l.Fragment,{children:[(0,y.jsx)(pe.Z5,{onDragEnd:function(e){return G(e,z)},children:(0,y.jsx)(pe.bK,{droppableId:"droppable",children:function(e,n){return(0,y.jsx)("div",s()(s()({ref:e.innerRef},e.droppableProps),{},{style:{width:"100%"},children:z.map((function(e,n){var t=e.st,i=e.name,a=e.challenge_id;return(0,y.jsx)(pe._l,{draggableId:a.toString(),index:n,isDragDisabled:Z,children:function(r,l){return(0,y.jsxs)("div",s()(s()(s()({ref:r.innerRef},r.draggableProps),r.dragHandleProps),{},{className:N===a?oe.listActive:oe.list,onClick:function(){return Q(a,e)},children:[(0,y.jsx)("span",{className:oe.s1,children:0===t?(0,y.jsx)("i",{className:"iconfont icon-shixunti",style:{color:"#0152d9"}}):(0,y.jsx)("i",{className:"iconfont icon-xuanzeti3",style:{color:"#44D7B6"}})}),(0,y.jsxs)("span",{className:oe.s2,children:["第",n+1,"关: ",i]}),!Z&&(0,y.jsx)("span",{className:oe.s3,onClick:function(n){return function(e,n){n.stopPropagation();var t=e.challenge_id,i=function(){var e=x()(m()().mark((function e(){var n,i,s;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,j.rO)({id:R,challengesId:t});case 2:if(1!==e.sent.status){e.next=12;break}return e.next=6,(0,j.n5)({id:R});case 6:if(s=e.sent,f(s),t!==N||null===(n=s.challenge_list)||void 0===n||!n.length){e.next=11;break}return q(s.challenge_list[0]),e.abrupt("return");case 11:null!==(i=s.challenge_list)&&void 0!==i&&i.length||(k(null),L.current=!0,Y({}),P.history.push("/shixuns/".concat(R,"/edit?tabId=level")));case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();E.Z.confirm({title:"提示",content:"是否删除该关卡!",centered:!0,onOk:i})}(e,n)},children:(0,y.jsx)("i",{className:"iconfont icon-shanchu7"})})]}))}},a)}))}))}})}),W&&(0,y.jsxs)("div",{className:oe.listActive,children:[(0,y.jsx)("span",{className:oe.s1,children:0===(null==W?void 0:W.st)?(0,y.jsx)("i",{className:"iconfont icon-shixunti",style:{color:"#0152d9"}}):(0,y.jsx)("i",{className:"iconfont icon-xuanzeti3",style:{color:"#44D7B6"}})}),(0,y.jsxs)("span",{className:oe.s2,children:["第",z.length+1,"关: ",null==W?void 0:W.name]})]}),!Z&&(0,y.jsx)("div",{className:oe.os,children:"--拖拽任务关卡进行排序--"})]})):(0,y.jsx)(de.Z,{image:"data:image/png;base64,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",description:"暂无任务关卡!"})})]}),!T&&(0,y.jsx)("div",{className:oe.btns,children:(0,y.jsxs)("aside",{className:oe.btnsWrap,children:[(0,y.jsx)("div",{style:{transform:u?"rotate(45deg)":"rotate(0deg)"},className:oe.icon,onClick:function(){(0,ce.gy)(n,"不能新建任务关卡")||d(!u)},children:"+"}),(0,y.jsxs)("div",{className:oe.btn,style:{left:u?20:-154},children:[(0,y.jsx)("div",{className:oe.d1,onClick:function(){return V("new")},children:"新建实践题关卡"}),(0,y.jsx)("div",{className:oe.d2,onClick:function(){return V("newquestion")},children:"新建理论题关卡"})]})]})}),(0,y.jsx)("div",{className:T?oe.elseShrink:oe.shrink,onClick:function(){return A(!T)},children:(0,y.jsx)("i",{className:"iconfont icon-zuoyouzhankai"})})]}),(0,y.jsx)("aside",{className:oe.right,id:"modal-level-question",children:null===N&&L.current?(0,y.jsx)("div",{className:oe.addIcon,children:(0,y.jsx)("span",{children:"在左侧点击“+”号新建关卡。"})}):(0,y.jsx)(P.Outlet,{})})]})})),xe=t(66999),ve=t(38854),fe=t(20834),ge=t(86859),je=t(5112),Ee="title___NTpKq",be="content___oL0Iy",De="add___L4cbC",Pe="colorBlue___xRARA",ye="radio___cfwvc",Oe=["shixunsDetail","globalSetting","loading","dispatch","onReloadData"],Ce=(0,P.connect)((function(e){var n=e.shixunsDetail,t=e.loading;return{shixunsDetail:n,globalSetting:e.globalSetting,loading:t}}))((function(e){var n=e.shixunsDetail,t=(e.globalSetting,e.loading),i=e.dispatch,s=e.onReloadData,a=(r()(e,Oe),(0,l.useState)()),_=S()(a,2),o=_[0],c=_[1],u=(0,l.useState)([]),d=S()(u,2),p=d[0],h=d[1];(0,l.useEffect)((function(){"Collaborators-ChangeManager"===n.actionTabs.key&&v()}),[n.actionTabs.key]);var v=function(){var e=x()(m()().mark((function e(){var t,s;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i({type:"shixunsDetail/getChangeManager",payload:{id:null===(t=n.actionTabs.params)||void 0===t?void 0:t.id}});case 2:s=e.sent,h(s||[]);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),f=function(){var e=x()(m()().mark((function e(){var t,a;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o){e.next=3;break}return b.ZP.info("所选人员为空,没有更换成功"),e.abrupt("return");case 3:return e.next=5,i({type:"shixunsDetail/changeManager",payload:{id:null===(t=n.actionTabs.params)||void 0===t?void 0:t.id,user_id:o}});case 5:a=e.sent,g(),a&&(s(),b.ZP.info(a.message));case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),g=function(){i({type:"shixunsDetail/setActionTabs",payload:{}}),c(null)};return(0,y.jsx)(E.Z,{centered:!0,keyboard:!1,closable:!1,title:"更换管理员",open:"Collaborators-ChangeManager"===n.actionTabs.key,confirmLoading:t.effects["shixunsDetail/changeManager"],onOk:f,onCancel:g,children:(0,y.jsxs)("div",{children:[(0,y.jsxs)("div",{className:Ee,children:["选择的成员将会成为新的管理员",(0,y.jsx)("br",{}),"您将不再拥有管理员的权限,但您仍是合作团队的一员"]}),(0,y.jsx)("div",{className:be,children:p.length?(0,y.jsx)(je.ZP.Group,{value:o,onChange:function(e){return c(e.target.value)},children:p.map((function(e,n){return(0,y.jsx)(je.ZP,{className:ye,value:e.user_id,children:e.name},n)}))}):(0,y.jsx)("div",{className:De,children:(0,y.jsxs)("span",{children:["请先将新的管理员通过",(0,y.jsx)("a",{className:Pe,onClick:function(){var e;i({type:"shixunsDetail/setActionTabs",payload:{key:"Collaborators-AddCollaborator",params:{id:null===(e=n.actionTabs.params)||void 0===e?void 0:e.id}}})},children:'"添加合作者"'}),"加入合作者列表"]})})})]})})})),Me=t(99313),Se=t(93415),Te=t(39421),Ae=Me.Z.TabPane,Ie=function(e){var n=e.visible,t=e.onCancel,i=e.onSelectGroup,s=e.shixunId,a=e.onSelectCollaborator;return(0,y.jsx)(E.Z,{title:"添加合作者",open:n,width:1100,centered:!0,keyboard:!1,onCancel:t,maskClosable:!1,destroyOnClose:!0,forceRender:!0,bodyStyle:{minHeight:400},footer:null,children:(0,y.jsxs)(Me.Z,{defaultActiveKey:"1",children:[(0,y.jsx)(Ae,{tab:"搜索添加",children:(0,y.jsx)(Se.Z,{onCancel:t,container_type:2,container_id:s,onSelect:a})},"1"),(0,y.jsx)(Ae,{tab:"团队添加",children:(0,y.jsx)(Te.Z,{onCancel:t,onSelect:i})},"2")]})})},we={bg:"bg___GzXpp",wrap:"wrap___A40jS",modal:"modal___Zz7dC",content:"content___H5ZN2",head:"head___o5t32",headCount:"headCount___eBMPN",button:"button___YSSGm",itemWrap:"itemWrap___iPWUC",imgWrap:"imgWrap___T70Es",img:"img___oumA5",manager:"manager___VdXG8",itemContent:"itemContent____npAh",nameWrap:"nameWrap___nazId",name:"name___Z48aE",actionGroup:"actionGroup___eScAq",deleteIcon:"deleteIcon___FK_OA",schoolWrap:"schoolWrap___jJuIm",school:"school___kSMwT",countWrap:"countWrap___p7epV",deletetitle:"deletetitle___uVCHi",yseTitle:"yseTitle___L6JF9"},Ne=t(46952),ke=t(1082),Le=(0,P.connect)((function(e){var n=e.shixunsDetail,t=e.loading;return{shixunsDetail:n,globalSetting:e.globalSetting,user:e.user,loading:t}}))((function(e){var n,t,i,a,r=e.shixunsDetail,_=(e.globalSetting,e.loading),o=e.user,c=e.dispatch,u=(0,P.useParams)(),d=(0,l.useRef)(),p=(0,l.useState)(0),h=S()(p,2),v=h[0],f=h[1],g=(0,l.useState)([]),j=S()(g,2),D=j[0],O=j[1],C=(0,l.useState)({id:null,page:1}),M=S()(C,2),T=M[0],A=M[1],I=null===(n=o.userInfo)||void 0===n||null===(n=n.shixun)||void 0===n?void 0:n.editable,w=(null===(t=o.userInfo)||void 0===t?void 0:t.role)<=2||(null===(i=o.userInfo)||void 0===i||null===(i=i.shixun)||void 0===i?void 0:i.is_creator);(0,l.useEffect)((function(){d.current=u.id,T.id=d.current,A(T),N(T)}),[]);var N=function(){var e=x()(m()().mark((function e(n){var t;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c({type:"shixunsDetail/getCollaboratorsData",payload:n});case 2:(t=e.sent)&&(O(t.members||[]),f(t.member_count));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),k=function(){var e=x()(m()().mark((function e(){var n;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T.page=1,A(T),n=(0,ke.g)(),e.next=5,c({type:"user/getUserInfo",payload:n});case 5:return e.next=7,N(T);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();function R(){return R=x()(m()().mark((function e(n,t,i,s){return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c({type:"shixunsDetail/updateCollaboratorEditable",payload:{identifier:n,user_id:t,editable:i?0:1}});case 2:N(T);case 3:case"end":return e.stop()}}),e)}))),R.apply(this,arguments)}function B(){c({type:"shixunsDetail/setActionTabs",payload:{}})}var Z,W,K={visible:"Collaborators-AddCollaborator"===r.actionTabs.key,onCancel:B,shixunId:d.current,onSelectCollaborator:(W=x()(m()().mark((function e(n){return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return B(),e.next=3,c({type:"shixunsDetail/addCollaborator",payload:{id:d.current,user_ids:n}});case 3:e.sent&&(b.ZP.success("添加成功"),k());case 5:case"end":return e.stop()}}),e)}))),function(e){return W.apply(this,arguments)}),onSelectGroup:(Z=x()(m()().mark((function e(n){return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return B(),e.next=3,c({type:"shixunsDetail/addTeachGroupMember",payload:{identifier:d.current,group_id:n.group_id}});case 3:e.sent&&(b.ZP.success("添加成功"),k());case 5:case"end":return e.stop()}}),e)}))),function(e){return Z.apply(this,arguments)})};return(0,y.jsxs)("section",{children:[(0,y.jsxs)("div",{className:we.wrap,children:[(0,y.jsxs)("div",{className:we.content,children:[(null===(a=r.detail)||void 0===a?void 0:a.identity)<5&&(0,y.jsxs)("div",{className:we.head,children:[(0,y.jsxs)("span",{className:we.headCount,children:["合作成员(",v,"人)"]}),(0,y.jsxs)("div",{children:[w&&(0,y.jsx)(L.ZP,{type:"primary",ghost:!0,className:we.button,style:{marginRight:"20px"},onClick:function(){c({type:"shixunsDetail/setActionTabs",payload:{key:"Collaborators-ChangeManager",params:{id:d.current}}})},children:"更换管理员"}),I&&(0,y.jsx)(L.ZP,{type:"primary",className:we.button,style:{marginRight:"40px"},onClick:function(){c({type:"shixunsDetail/setActionTabs",payload:{key:"Collaborators-AddCollaborator",params:{id:d.current}}})},children:"添加合作者"})]})]}),(0,y.jsx)("div",{className:we.list,children:(0,y.jsx)(xe.Z,{loading:_.effects["shixunsDetail/getCollaboratorsData"],active:!0,avatar:{size:40},paragraph:{rows:3},className:"mt30",children:D.map((function(e,n){var t,i,s,a,l,_,u,p;return(0,y.jsx)("div",{style:{display:"inline-block",width:"50%"},children:(0,y.jsxs)("div",{className:we.itemWrap,children:[(0,y.jsxs)("a",{href:null===(t=e.user)||void 0===t?void 0:t.user_url,target:"_blank",className:we.imgWrap,children:[(0,y.jsx)("img",{alt:"用户头像",height:"48",width:"48",className:we.img,src:"".concat(V.Z.IMG_SERVER,"/images/").concat(null===(i=e.user)||void 0===i?void 0:i.image_url)}),(null===(s=e.user)||void 0===s?void 0:s.shixun_manager)&&(0,y.jsx)("span",{className:we.manager,children:"创建者"})]}),(0,y.jsxs)("div",{className:we.itemContent,children:[(0,y.jsxs)("p",{className:we.nameWrap,children:[(0,y.jsxs)("a",{href:e.user.user_url,target:"_blank",className:we.name,children:[null===(a=e.user)||void 0===a?void 0:a.name,e.user.user_id===(null===(l=o.userInfo)||void 0===l?void 0:l.user_id)?(0,y.jsx)("span",{children:"我"}):null]}),(0,y.jsxs)("div",{className:we.actionGroup,children:[w?null!==(_=e.user)&&void 0!==_&&_.shixun_manager?null:(0,y.jsx)(ve.Z,{dropdownRender:function(){return(0,y.jsxs)(fe.Z,{selectedKeys:[e.editable?"1":"2"],onClick:function(){var n;!function(e,n,t,i){R.apply(this,arguments)}(r.detail.identifier,e.user.user_id,e.editable,null===(n=e.user)||void 0===n?void 0:n.name)},children:[(0,y.jsx)(fe.Z.Item,{children:"编辑权限"},1),(0,y.jsx)(fe.Z.Item,{children:"查看权限"},2)]})},children:(0,y.jsxs)("div",{children:[e.editable?(0,y.jsx)("span",{style:{fontSize:"16px"},className:"c-grey-c",children:"编辑权限"}):(0,y.jsx)("span",{style:{fontSize:"16px"},className:"c-grey-c",children:"查看权限"})," ",(0,y.jsx)(Ne.Z,{style:{fontSize:"14px",color:"#888888"}})]})}):e.editable?(0,y.jsx)("span",{style:{fontSize:"16px"},className:"c-grey-c",children:"编辑权限"}):(0,y.jsx)("span",{style:{fontSize:"16px"},className:"c-grey-c",children:"查看权限"}),null!==(u=e.user)&&void 0!==u&&u.shixun_manager||!I?null:(0,y.jsx)("a",{className:we.deletetitle,onClick:function(){var n,t,i;return t=null===(n=e.user)||void 0===n?void 0:n.user_id,void E.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:(0,y.jsx)("div",{className:we.modal,children:"确定要删除吗?"}),onOk:(i=x()(m()().mark((function e(){var n,i;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c({type:"shixunsDetail/deleteCollaborators",payload:{id:d.current,userId:t}});case 2:if(i=e.sent,(null===(n=o.userInfo)||void 0===n?void 0:n.user_id)!==t){e.next=6;break}return P.history.push("/shixuns"),e.abrupt("return");case 6:b.ZP.info(null==i?void 0:i.message),T.page=1,A(T),N(T);case 10:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)})})},children:"删除"})]})]}),(0,y.jsx)("p",{className:we.schoolWrap,children:(0,y.jsx)("span",{className:we.school,children:null===(p=e.user)||void 0===p?void 0:p.school_name})})]})]},n)})}))})})]}),v>10&&(0,y.jsx)("div",{className:we.countWrap,children:(0,y.jsx)(ge.Z,{showQuickJumper:!1,showSizeChanger:!1,total:v,onChange:function(e){return function(e){T.page=e,A(T),N(T)}(e)},pageSize:10,current:T.page})})]}),(0,y.jsx)(Ce,{onReloadData:k}),(0,y.jsx)(Ie,s()({},K))]})})),Re=t(93724),Be=t(91232),Ze=t.n(Be),We=t(57809),Ke=t(6848),Ue=t(78673),ze=t(13057),Fe=t(36723),He=t(12261),qe="mirrorModal___z1tEP",Ge="right___ZlGrr",Ye="title___lWaS3",Qe="content___bCC9x",Je="des___ujB5y",Ve="btns___L4vgc",Xe="confirm___RFRg4",$e="cancel___F1WB_",en="modal___A5dbG",nn=t(17621),tn=t(27283),sn=(0,P.connect)((function(e){return{newShixuns:e.newShixuns,globalSetting:e.globalSetting,user:e.user}}))((function(e){var n,t,i=e.newShixuns,s=(e.user,e.dispatch),a=e.visible,r=e.onOk,_=e.onCancel,o=e.useId,c=void 0===o?null:o,u=e.identifier,d=e.shixun_environment_id,p=e.tab_type,h=(0,l.useState)(null),v=S()(h,2),f=v[0],g=v[1],b=(0,l.useState)({}),D=S()(b,2),P=D[0],O=D[1],C=(0,l.useState)(""),M=S()(C,2),T=M[0],A=M[1],I=i.environmentData,w=I.frequence_image,N=void 0===w?[]:w,k=I.environments,R=void 0===k?[]:k,B=I.other_image,Z=void 0===B?[]:B,W=P.name,K=P.description;(0,l.useEffect)((function(){a&&(s({type:"newShixuns/getEnvironmentData",payload:{tab_type:p}}),A(""),g(c))}),[a,c]),(0,l.useEffect)((function(){"NewShixuns-Apply"===i.actionTabs.key&&_()}),[null==i||null===(n=i.actionTabs)||void 0===n?void 0:n.key]),(0,l.useEffect)((function(){null!==f&&U()}),[f]);var U=function(){var e=x()(m()().mark((function e(){var n;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,j.Q1)({mirror_repository_id:f,identifier:u,shixun_environment_id:d});case 2:n=e.sent,O(n.data);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(E.Z,{title:"选择实验镜像",open:a,width:1e3,destroyOnClose:!0,centered:!0,onCancel:_,className:en,footer:null,children:(0,y.jsxs)("div",{className:qe,children:[(0,y.jsx)(He.Z,{dispatch:s,value:f,data:R,otherData:Z,tags:N,onChange:function(e){return g(e)},onSearchWord:function(e){return A(e)},tab_type:p}),(0,y.jsxs)("div",{className:Ge,children:[(0,y.jsx)("header",{children:(0,y.jsxs)("div",{className:Ye,children:["实验环境: ",(0,y.jsx)("span",{dangerouslySetInnerHTML:{__html:null===f?"— —":null===(t=W||"")||void 0===t?void 0:t.replace(new RegExp(null==T?void 0:T.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>')}})]})}),(0,y.jsxs)("div",{className:Qe,children:[null===f&&(0,y.jsx)(de.Z,{image:Fe,description:"请选择实验环境"}),null!==f&&(0,y.jsx)("div",{className:Je,children:(0,y.jsx)(ae.Z,{value:K,highlightKeywords:T})}),(0,y.jsxs)("div",{className:Ve,children:[(0,y.jsx)(L.ZP,{onClick:function(){g(null),O({}),_()},className:$e,children:"取消 "}),(0,y.jsx)(L.ZP,{onClick:function(){r(P)},className:Xe,type:"primary",children:"保存 "})]})]})]})]})}),(0,y.jsx)(nn.Z,{}),(0,y.jsx)(tn.Z,{})]})})),an="content___ujW8g",rn="explain___vGa5a",ln="tabs___MbGuX",_n="active___SCmkJ",on="btns___MiEQa",cn="must___n8wNT",un="popover___wqXWh",dn="zybzForm___m1nC0",pn="graaytitle___vdUDn",mn="dataPicker___RiEgz",hn="examineStatus___OCyYC",xn="contacts___MWvKz",vn="contacts_img___kiMTs",fn="suc_status___p81iO",gn="fail_status___Rv54W",jn="bohui___wtuT5",En=t(43428),bn=t(46400),Dn=t(60324),Pn=t(30518),yn=t(94001),On=t(84445),Cn="footerWrap___lXI4I",Mn=["shixunsDetail","globalSetting","loading","dispatch","onFinish"],Sn=R.Z.TextArea,Tn=(0,P.connect)((function(e){var n=e.shixunsDetail,t=e.loading;return{shixunsDetail:n,globalSetting:e.globalSetting,loading:t}}))((function(e){var n=e.shixunsDetail,t=(e.globalSetting,e.loading),i=e.dispatch,s=e.onFinish,a=void 0===s?function(){}:s,l=(r()(e,Mn),k.Z.useForm()),_=S()(l,1)[0],o=function(){var e=x()(m()().mark((function e(t){var s,r;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i({type:"shixunsDetail/getCustomScript",payload:{id:null===(s=n.actionTabs.params)||void 0===s?void 0:s.id,compile:t.execute,excutive:t.compile}});case 2:r=e.sent,c(),r&&a(null==r?void 0:r.shixun_script);case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),c=function(){i({type:"shixunsDetail/setActionTabs",payload:{}})};return(0,y.jsx)(E.Z,{centered:!0,title:"自定义模板",open:"Settings-UseCustomScript"===n.actionTabs.key,okText:"确定",cancelText:"取消",footer:null,onCancel:c,children:(0,y.jsxs)(k.Z,{form:_,scrollToFirstError:!0,layout:"vertical",onFinish:o,children:[(0,y.jsx)(k.Z.Item,{name:"execute",label:"执行命令:",rules:[{required:!0,message:"执行命令不能为空"}],children:(0,y.jsx)(Sn,{rows:4})}),(0,y.jsx)(k.Z.Item,{name:"compile",label:"编译命令:",children:(0,y.jsx)(Sn,{rows:4})}),(0,y.jsx)("div",{className:Cn,children:(0,y.jsxs)(k.Z.Item,{children:[(0,y.jsx)(L.ZP,{className:"mr5",size:"middle",onClick:c,children:"取消"}),(0,y.jsx)(L.ZP,{size:"middle",type:"primary",htmlType:"submit",loading:t.effects["shixunsDetail/getCustomScript"],children:"保存"})]})})]})})})),An=t(89260),In=t(61186),wn=t.n(In),Nn=t(46906),kn=(0,P.connect)((function(e){return{shixunsDetail:e.shixunsDetail}}))((function(e){var n,t,i,s=e.shixunsDetail,a=e.visible,r=e.onOk,_=e.onCancel,o=e.dispatch,c=e.is_published,u=e.id,d=(e.has_relation,e.environment),p=void 0===d?[]:d,h=e.verifyModal,v=(0,P.useParams)(),f=(0,l.useState)(1),g=S()(f,2),j=g[0],O=g[1],C=(0,l.useState)(!0),M=S()(C,2),T=M[0],A=M[1],I=(0,l.useState)(!1),w=S()(I,2),N=w[0],B=w[1],W=(0,l.useState)(null),K=S()(W,2),z=K[0],F=K[1],H=(0,l.useState)(),q=S()(H,2),G=q[0],Y=q[1],Q=(0,l.useState)(),J=S()(Q,2),V=J[0],X=J[1],$=(0,l.useState)([]),ee=S()($,2),ne=ee[0],ie=ee[1],ae=(0,l.useState)(!1),re=S()(ae,2),le=re[0],_e=re[1],oe=(0,l.useState)(""),ce=S()(oe,2),ue=ce[0],de=ce[1],pe=(0,l.useState)(null),me=S()(pe,2),he=me[0],ve=me[1],fe=k.Z.useForm(),ge=S()(fe,1)[0],je=(0,l.useState)([]),Ee=S()(je,2),be=Ee[0],De=Ee[1],Pe=(0,l.useState)(""),ye=S()(Pe,2),Oe=ye[0],Ce=ye[1],Me=(0,l.useState)([{id:1,name:"评测脚本设置"},{id:2,name:"实验环境设置"}]),Se=S()(Me,2),Te=Se[0],Ae=Se[1];(0,l.useEffect)((function(){var e;((0,An.Ny)()||null!=s&&null!==(e=s.detail)&&void 0!==e&&e.manager_of_shixun)&&Ae([{id:1,name:"评测脚本设置"},{id:2,name:"实验环境设置"},{id:3,name:"实验资源优先保障"}])}),[]),(0,l.useEffect)((function(){u&&a&&(Ie(),we())}),[u,a]);var Ie=function(){var e=x()(m()().mark((function e(){var n,t,i,s,a,r,l,_,o=arguments;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(n=o.length>0&&void 0!==o[0]?o[0]:null)||A(!0),e.next=4,(0,D.ZP)("/api/shixuns/".concat(u,"/get_shixun_env_setting.json"),{method:"get",params:{shixun_environment_id:n}});case 4:0!==(t=e.sent).status||n||(r=t.data,console.log("data",r),F((null==r?void 0:r.shixun_environment_id)||null),Y((null==r?void 0:r.evaluate_script)||""),X((null==r?void 0:r.choice_standard_scripts)||null),ie((null==r?void 0:r.standard_scripts)||[]),_e((null===(i=r.shixun)||void 0===i?void 0:i.close_internet)||!1),de(null===(s=r.shixun)||void 0===s?void 0:s.survival_time),l=null===(a=r.shixun)||void 0===a?void 0:a.important_shixun_configs,ge.setFieldsValue({identifier:(null==l?void 0:l.identifier)||"",people_number:(null==l?void 0:l.people_number)||"",school_id:(null==l?void 0:l.school_id)||"",times:null!=l&&l.start_time&&null!=l&&l.end_time?[wn()(null==l?void 0:l.start_time),wn()(null==l?void 0:l.end_time)]:["",""]}),Ce((null==l?void 0:l.verify_reason)||""),ve((null==l?void 0:l.process)||null)),0===t.status&&n&&(_=t.data,Y((null==_?void 0:_.evaluate_script)||""),X(null),ie((null==_?void 0:_.standard_scripts)||[])),A(!1);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),we=function(){var e=x()(m()().mark((function e(){var n;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o({type:"account/getSchoolOption"});case 2:n=e.sent,De(null==n?void 0:n.schools);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ne=function(){var e=x()(m()().mark((function e(n){var t;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o({type:"shixunsDetail/getScriptContent",payload:{id:v.id,script_id:n}});case 2:(t=e.sent)&&Y(t.content);case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),ke=function(){var e=x()(m()().mark((function e(){var n,t,i,a,l,_,c,d,p=arguments;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=p.length>0&&void 0!==p[0]&&p[0],t=p.length>1&&void 0!==p[1]?p[1]:1,1!==j){e.next=7;break}return B(!0),e.next=6,(0,D.ZP)("/api/shixuns/".concat(v.id,"/update_evaluate_script_setting.json"),{method:"put",body:{shixun_environment_id:z,mirror_script_id:V,evaluate_script:G,sync_origin_shixun:n}});case 6:i=e.sent;case 7:if(2!==j){e.next=13;break}return B(!0),a={close_internet:le,survival_time:ue,sync_origin_shixun:n},e.next=12,(0,D.ZP)("/api/shixuns/".concat(v.id,"/update_environment_setting.json"),{method:"put",body:a});case 12:i=e.sent;case 13:if(3!==j){e.next=23;break}return l=ge.getFieldsValue(),e.next=17,ge.validateFields();case 17:return B(!0),(_={close_internet:le,survival_time:ue,sync_origin_shixun:n}).important_shixun_configs={identifier:null==l?void 0:l.identifier,people_number:null==l?void 0:l.people_number,school_id:null==l?void 0:l.school_id,start_time:wn()(null==l?void 0:l.times[0]).format("YYYY-MM-DD HH:mm"),end_time:wn()(null==l?void 0:l.times[1]).format("YYYY-MM-DD HH:mm")},e.next=22,(0,D.ZP)("/api/shixuns/".concat(v.id,"/resources_first_ensure.json"),{method:"post",body:_});case 22:i=e.sent;case 23:0===i.status&&(null!=s&&null!==(c=s.detail)&&void 0!==c&&c.copy_for_exercise&&3!==j||b.ZP.success("".concat(3==j?"提交申请成功":"保存成功")),null!=s&&null!==(d=s.detail)&&void 0!==d&&d.copy_for_exercise&&3!=j&&(0,te.m)(o,s,u,t),Ie(),r()),B(!1);case 25:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(En.Z,{title:null,width:1e3,placement:"right",closable:!1,onClose:_,open:a,children:(0,y.jsx)("div",{className:an,children:(0,y.jsxs)(xe.Z,{loading:T,active:!0,children:[(0,y.jsxs)(Z.Z,{className:"mt10",justify:"space-between",children:[(0,y.jsx)("b",{className:"c-grey-333 font16",children:"设置"}),(0,y.jsx)("i",{onClick:_,className:"iconfont icon-guanbi11 current",style:{color:"#979797"}})]}),(0,y.jsx)("div",{className:ln,children:Te.map((function(e){var n=e.name,t=e.id;return(0,y.jsx)("div",{className:j===t?_n:"",onClick:function(){return O(t)},children:n},t)}))}),1===j&&(0,y.jsxs)(l.Fragment,{children:[(0,y.jsx)(bn.Z,{className:"mt20",message:"选择实验环境下的评测脚本:将作为整个实训所有实验环境下,学员评测时运行的脚本。",type:"info",showIcon:!0,closable:!0}),(0,y.jsxs)(Z.Z,{align:"middle",className:"mt20",children:[(0,y.jsx)("span",{className:"c-grey-333 font16",children:"运行环境"}),(0,y.jsx)(We.default,{onClick:h,getPopupContainer:function(e){return e.parentNode},bordered:!1,className:"ml10",style:{width:300,backgroundColor:"#f5f5f5",height:50,borderRadius:4,paddingTop:10},value:z,onChange:function(e){F(e),Ie(e)},showArrow:!0,placeholder:"实验环境",children:null===(n=p.filter((function(e){return 0!==e.id})))||void 0===n?void 0:n.map((function(e,n){return(0,y.jsx)(We.default.Option,{value:e.id,name:e.name,children:e.name},e.id)}))})]}),(0,y.jsxs)(Z.Z,{align:"middle",className:"mt20",children:[(0,y.jsx)("span",{className:"c-grey-333 font16",children:"评测脚本"}),(0,y.jsx)(We.default,{onClick:h,getPopupContainer:function(e){return e.parentNode},bordered:!1,className:"ml10 mr10",style:{width:300,backgroundColor:"#f5f5f5",height:50,borderRadius:4,paddingTop:10},showArrow:!0,value:V,placeholder:"请选择评测脚本",onChange:function(e){!function(e){var n;E.Z.confirm({centered:!0,title:"提示",okText:"确定",cancelText:"取消",content:(0,y.jsxs)("div",{className:"tc font16",children:["原有脚本将被新的脚本覆盖,无法撤销",(0,y.jsx)("br",{}),"是否确认执行覆盖操作"]}),onOk:(n=x()(m()().mark((function n(){return m()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Ne(e);case 2:X(e),E.Z.info({centered:!0,title:"提示",okText:"知道啦",content:(0,y.jsx)("div",{className:"tc font16",children:"评测脚本生成成功!"})});case 4:case"end":return n.stop()}}),n)}))),function(){return n.apply(this,arguments)})})}(e)},children:(ne||[]).map((function(e,n){return(0,y.jsx)(We.default.Option,{value:parseInt(e.id),name:e.scptname,children:e.scptname},n)}))}),(0,y.jsx)("span",{className:rn,onClick:function(){h()||o({type:"shixunsDetail/setActionTabs",payload:{key:"Settings-UseCustomScript",params:{id:v.id}}})},children:"使用自定义脚本"}),(0,y.jsx)(Dn.Z,{className:un,content:(0,y.jsxs)("p",{className:"font12",children:["使用自定义模板,平台无法自动更新脚本,请在关卡创建完后手动更新脚本中的必填参",(0,y.jsx)("br",{}),"数和以下2个数组元素",(0,y.jsx)("br",{}),"challengeProgramNames",(0,y.jsx)("br",{}),"sourceClassNames",(0,y.jsx)("br",{}),(0,y.jsx)("br",{}),"示例有2个关卡的实训",(0,y.jsx)("br",{}),(0,y.jsx)("br",{}),"各关卡的待编译文件为:",(0,y.jsx)("br",{}),"src/step1/HelloWorld.java",(0,y.jsx)("br",{}),"src/step2/Other.java",(0,y.jsx)("br",{}),(0,y.jsx)("br",{}),"各关卡的编译后生成的执行文件为:",(0,y.jsx)("br",{}),"step1.HelloWorld",(0,y.jsx)("br",{}),"step2.Other",(0,y.jsx)("br",{}),(0,y.jsx)("br",{}),"则数组元素更新如下:",(0,y.jsx)("br",{}),'ff challengeProgramNames=("src/step1/',(0,y.jsx)("br",{}),'HelloWorld.java" "src/step2/Other.java")',(0,y.jsx)("br",{}),'sourceClassNames=("step1.HelloWorld',(0,y.jsx)("br",{}),'" "step2.Other")',(0,y.jsx)("br",{}),(0,y.jsx)("br",{}),"其它参数可按实际需求定制"]}),trigger:"click",children:(0,y.jsx)("span",{style:{color:"#999",fontSize:14,marginTop:2,marginLeft:4},className:"iconfont icon-tishi11 c-grey-999"})})]}),(0,y.jsx)(On.ZP,{style:{border:"1px solid #ccc",background:"#f5f5f5",marginTop:"30px"},language:"shell",theme:"vs-light",value:G,options:{readOnly:c},onChange:function(e){Y(e)}})]}),2===j&&(0,y.jsxs)("div",{style:{flex:1,overflowY:"auto"},children:[(0,y.jsxs)(Z.Z,{align:"middle",className:"mt20",children:[(0,y.jsx)("span",{className:"c-grey-333 font16 ml30 mr10",children:"实训容器网络"}),(0,y.jsxs)(U.Z,{checked:le,onChange:function(e){return _e(e.target.checked)},children:[(0,y.jsx)("span",{className:"c-grey-333 font14",children:"关闭外网"}),(0,y.jsx)("span",{className:"c-grey-999 font14",children:"(选中,在实训编译页面中不可访问互联网)"})]})]}),(0,y.jsxs)(Z.Z,{align:"middle",className:"mt20",children:[(0,y.jsx)("span",{className:"c-grey-333 font16 mr10",children:"实验环境使用时长"}),(0,y.jsx)(R.Z,{bordered:!1,value:ue,onChange:function(e){return de(e.target.value)},style:{width:300,backgroundColor:"#f5f5f5",height:50,borderRadius:4}}),(0,y.jsx)("span",{className:"ml10 c-grey-999 font14",children:"分"})]})]}),3===j&&((0,An.Ny)()||(null==s||null===(t=s.detail)||void 0===t?void 0:t.manager_of_shixun))&&(0,y.jsx)("div",{style:{flex:1,overflowY:"auto"},children:(0,y.jsxs)(Z.Z,{align:"middle",className:"mt20",children:[(0,y.jsxs)(k.Z,{form:ge,layout:"horizontal",className:dn,children:[(0,y.jsxs)(Z.Z,{align:"middle",children:[(0,y.jsxs)("span",{className:"c-grey-333 font16 mr10",style:{marginLeft:55},children:[(0,y.jsx)("span",{className:cn,children:"*"}),"保障标识"]}),(0,y.jsx)(k.Z.Item,{label:"",name:"identifier",rules:[{required:!0,message:"请输入保障标识"},{validator:function(e,n){return n&&!/^[a-zA-Z0-9]+$/.test(n)?Promise.reject("输入内容只能包含数字和字母"):n&&!/^[^0-9][a-zA-Z0-9]*$/.test(n)?Promise.reject("不能以数字开头"):n&&!/^.{4,30}$/.test(n)?Promise.reject("输入内容长度必须在4到30个字符之间"):Promise.resolve()}}],children:(0,y.jsx)(R.Z,{bordered:!1,style:{width:300,backgroundColor:"#f5f5f5",height:50,borderRadius:4},minLength:4,maxLength:30,showCount:!0,placeholder:"请输入保障标识"})}),(0,y.jsxs)("span",{className:"ml10 c-grey-999 font14",children:["保障标识只能由字母和数字组成4~30 位),不能以数字开头。",(0,y.jsx)("br",{}),"填写保障标识是为了便于平台为此实践项目特别分配节点。"]})]}),(0,y.jsxs)(Z.Z,{align:"middle",className:"mt25",children:[(0,y.jsxs)("span",{className:"c-grey-333 font16 mr10",style:{marginLeft:7},children:[(0,y.jsx)("span",{className:cn,children:"*"}),"需要保障的单位"]}),(0,y.jsx)(k.Z.Item,{label:"",name:"school_id",rules:[{required:!0,message:"请选择需要保障的单位"}],children:(0,y.jsx)(We.default,{bordered:!1,style:{width:300,backgroundColor:"#f5f5f5",height:50,borderRadius:4,paddingTop:10},showArrow:!0,filterOption:function(e,n){return n.children.toLowerCase().indexOf(e.toLowerCase())>=0},showSearch:!0,placeholder:"请选择需要保障的单位",children:null===(i=be.filter((function(e){return 0!==e.id})))||void 0===i?void 0:i.map((function(e,n){return(0,y.jsx)(We.default.Option,{title:null==e?void 0:e.name,value:null==e?void 0:e.id,children:null==e?void 0:e.name},n+1)}))})})]}),(0,y.jsxs)(Z.Z,{align:"middle",className:"mt25",children:[(0,y.jsxs)("span",{className:"c-grey-333 font16 mr10",style:{marginLeft:55},children:[(0,y.jsx)("span",{className:cn,children:"*"}),"保障时间"]}),(0,y.jsx)("div",{className:pn,children:(0,y.jsx)(k.Z.Item,{label:"",name:"times",rules:[{required:!0,message:"请选择开始时间和结束时间"},{validator:function(e,n){if(n&&2===n.length){var t=S()(n,2),i=t[0],s=t[1];if(!i||!s)return Promise.reject(new Error("请选择起始时间和结束时间"))}return Promise.resolve()}}],children:(0,y.jsx)(Pn.default.RangePicker,{disabledDate:function(e){return e&&e<wn()().startOf("days")},className:"".concat(mn),format:"YYYY-MM-DD HH:mm",showTime:{format:"HH:mm"},bordered:!1,allowClear:!1,onChange:function(e){if(e&&e[0]&&e[1]){var n=e[0].isBefore(wn()())?wn()():e[0];ge.setFieldValue("times",[n,e[1]])}else ge.setFieldValue("times",e)}})})})]}),(0,y.jsxs)(Z.Z,{align:"middle",className:"mt25",children:[(0,y.jsxs)("span",{className:"c-grey-333 font16 mr10",style:{marginLeft:55},children:[(0,y.jsx)("span",{className:cn,children:"*"}),"保障人数"]}),(0,y.jsx)(k.Z.Item,{label:"",name:"people_number",rules:[{required:!0,message:"请输入保障人数"}],children:(0,y.jsx)(yn.Z,{parser:function(e){return parseInt(e||"0",10)},style:{width:200},placeholder:"请输入保障人数",min:1})})]})]}),(0,y.jsxs)("div",{className:"".concat(hn," mt25"),children:[he>=1&&(0,y.jsxs)("div",{children:[" ",(0,y.jsx)(Nn.Z,{className:fn})," 实验资源优先保障申请成功,平台管理员审核中"]}),he>=2&&3!=he&&(0,y.jsxs)("div",{children:[" ",(0,y.jsx)(Nn.Z,{className:fn})," 平台管理员审核通过,系统资源分配中"]}),3==he&&(0,y.jsxs)("div",{children:[" ",(0,y.jsx)(se.Z,{className:gn}),"平台管理员审核驳回,驳回原因: ( ",(0,y.jsx)("span",{title:Oe,className:jn,children:Oe}),") 如有问题请联系",(0,y.jsxs)("span",{className:xn,children:[(0,y.jsx)("span",{children:"平台运营人员"})," ",(0,y.jsx)("div",{className:vn})]})]}),he>=4&&5!=he&&7!=he&&(0,y.jsxs)("div",{children:[" ",(0,y.jsx)(Nn.Z,{className:fn})," 系统资源分配完成,实验资源保障中"]}),(5==he||7==he)&&(0,y.jsxs)("div",{children:[" ",(0,y.jsx)(se.Z,{className:gn}),"系统资源分配失败,请联系",(0,y.jsxs)("span",{className:xn,children:[(0,y.jsx)("span",{children:"平台运营人员"})," ",(0,y.jsx)("div",{className:vn})]})]}),he>5&&(0,y.jsxs)("div",{children:[" ",(0,y.jsx)(Nn.Z,{className:fn})," 实验资源保障已结束"]})]})]})}),(0,y.jsxs)("div",{className:on,children:[(0,y.jsx)(L.ZP,{onClick:_,children:"取消"}),(0,y.jsx)(L.ZP,{disabled:3==j&&[2,4,5].includes(he),onClick:x()(m()().mark((function e(){var n,t;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(1!==j||z){e.next=3;break}return b.ZP.warning("请选择运行环境"),e.abrupt("return");case 3:null!=s&&null!==(n=s.detail)&&void 0!==n&&n.is_fork_from_creator&&null!=s&&null!==(t=s.detail)&&void 0!==t&&t.copy_for_exercise&&3!=j&&(p.filter((function(e){return e.id===z}))[0].has_relation&&1===j||2===j)?o({type:"classroomList/setActionTabs",payload:{key:"同步修改",type:"environment",fn:function(e,n){ke(e,n)},zIndex:1e4}}):ke();case 4:case"end":return e.stop()}}),e)}))),loading:N,type:"primary",className:"ml20",children:3==j?"提交申请":"保存"})]})]})})}),(0,y.jsx)(Tn,{onFinish:function(e){return Y(e)}})]})})),Ln=t(37512),Rn=t(25510),Bn="wrap___S9yE5",Zn="content___xIxOT",Wn="head___icGJE",Kn="title___NbDBd",Un="add___ntZkv",zn="addDisable___pgd9I",Fn="setting___kQ9Qx",Hn="tabs___o2qas",qn="name___HUyj5",Gn="active___SVp4l",Yn="line___DSw6E",Qn="resource___AgLC3",Jn="mirror___DGr0Q",Vn="interface___xxy5c",Xn="disabled___GqKcR",$n="grade___b6Adk",et="tabsBox___TnoNw",nt="tabTitle___i8cO0",tt="more___kbzpa",it="serverConfig___BtI29",st="viewRecommendConfig___ODGyC",at="system___YygCM",rt="explain___klZ55",lt="btns___o6xWf",_t="template___AMzZZ",ot="liWrap___tCbB1",ct="li___srrGx",ut="tag___NcFBh",dt=t(93611),pt=t(65894),mt=t(35529),ht=We.default.Option,xt=(0,P.connect)((function(e){return{practiceSetting:e.practiceSetting,globalSetting:e.globalSetting,shixunsDetail:e.shixunsDetail,user:e.user}}))((function(e){var n,t,i,a,r,_,o,c,u,d=e.practiceSetting,p=e.dispatch,h=e.shixunsDetail,v=(e.user,d.id),f=d.is_published,g=(0,l.useState)([]),j=S()(g,2),O=j[0],C=j[1],M=(0,l.useState)(null),T=S()(M,2),A=T[0],I=T[1],w=(0,l.useState)([]),N=S()(w,2),k=N[0],B=N[1],W=(0,l.useState)([]),K=S()(W,2),z=K[0],H=K[1],q=(0,l.useRef)(null),G=(0,l.useState)({}),Y=S()(G,2),Q=Y[0],V=Y[1],X=(0,l.useRef)({}),$=(0,l.useRef)({}),ee=Q.shixun_environment,ne=void 0===ee?{}:ee,ie=Q.mirror_repository,se=void 0===ie?{}:ie,ae=Q.small_type,re=void 0===ae?[]:ae,le=Q.new_service_configs,_e=void 0===le?[]:le,oe=Q.network_mode_list,ue=void 0===oe?[]:oe,me=Q.boosters,he=void 0===me?[]:me,ge=(0,l.useState)(""),je=S()(ge,2),Ee=je[0],be=je[1],De=(0,l.useState)("请输入端口"),Pe=S()(De,2),ye=Pe[0],Oe=Pe[1],Ce=(0,l.useState)(!1),Se=S()(Ce,2),Te=Se[0],Ae=Se[1],Ie=(0,l.useState)(!1),we=S()(Ie,2),Ne=we[0],ke=we[1],Le=(0,l.useState)(!0),Re=S()(Le,2),Be=Re[0],He=Re[1],qe=(0,l.useState)(!0),Ge=S()(qe,2),Ye=Ge[0],Qe=Ge[1],Je=(0,l.useState)(!1),Ve=S()(Je,2),Xe=Ve[0],$e=Ve[1],en=(0,l.useState)(!1),nn=S()(en,2),tn=nn[0],an=nn[1],rn=(0,l.useState)(!1),ln=S()(rn,2),_n=ln[0],on=ln[1],cn=(0,l.useState)(!1),un=S()(cn,2),dn=un[0],pn=un[1],mn=(0,l.useState)(0),hn=S()(mn,2),xn=hn[0],vn=hn[1],fn=(0,l.useState)(!1),gn=S()(fn,2),jn=gn[0],En=gn[1],bn=(0,l.useState)({}),Dn=S()(bn,2),Pn=Dn[0],yn=Dn[1],Cn=(0,l.useState)({}),Mn=S()(Cn,2),Sn=Mn[0],Tn=Mn[1],In=(0,l.useState)({}),wn=S()(In,2),Nn=wn[0],xt=wn[1],vt=(0,l.useState)(""),ft=S()(vt,2),gt=ft[0],jt=ft[1],Et=(0,l.useState)(!1),bt=S()(Et,2),Dt=bt[0],Pt=bt[1],yt=(0,l.useState)(!1),Ot=S()(yt,2),Ct=Ot[0],Mt=Ot[1],St=(0,l.useState)({}),Tt=S()(St,2),At=Tt[0],It=Tt[1];console.log("--1111-",he);var wt=[{id:0,name:"公共镜像",type:"public"},{id:1,name:"自定义镜像",type:"customize"},{id:2,name:"共享镜像",type:"share"}],Nt=(null==z?void 0:z.find((function(e){return e.id===ne.instance_startup_template_id})))||{},kt=Nt.desc,Lt=Nt.virt_type,Rt=1===(null==k||null===(n=k.find((function(e){return e.id===(null==ne?void 0:ne.private_cloud_id)})))||void 0===n?void 0:n.cloud_type),Bt=4===(null==k||null===(t=k.find((function(e){return e.id===(null==ne?void 0:ne.private_cloud_id)})))||void 0===t?void 0:t.cloud_type);(0,l.useEffect)((function(){return window.addEventListener("click",qt),function(){window.removeEventListener("click",qt)}}),[]),(0,l.useEffect)((function(){Wt(),zt(),Kt()}),[]),(0,l.useEffect)((function(){(0,J.isEqual)($.current,Q)?p({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}}):p({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!0}}),X.current=Q}),[Q]);var Zt=function(){var e=x()(m()().mark((function e(){var n,t,i,s;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,D.ZP)("/api/shixuns/new.json",{method:"get",params:{tab_type:null===(n=wt[Number(xn)])||void 0===n?void 0:n.type}});case 2:0===(null==(t=e.sent)?void 0:t.status)&&(0===(null==t||null===(i=t.data)||void 0===i||null===(i=i.environments)||void 0===i?void 0:i.length)&&0===(null==t||null===(s=t.data)||void 0===s?void 0:s.other_image.length)?En(!0):En(!1));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();(0,l.useEffect)((function(){Zt()}),[xn]);var Wt=function(){var e=x()(m()().mark((function e(){var n,t,i;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,D.ZP)("/api/shixuns/".concat(v,"/get_shixun_env_tabs.json"),{method:"get"});case 2:0===(n=e.sent).status&&((i=(null===(t=n.data)||void 0===t?void 0:t.shixun_environments_tabs)||[]).length&&null===A&&I(i[0].id),C(i));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Kt=function(){var e=x()(m()().mark((function e(){var n,t;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Qe(!0),e.next=3,(0,D.ZP)("/api/shixuns/get_private_clouds.json",{method:"get"});case 3:0===(n=e.sent).status&&B(null==n||null===(t=n.data)||void 0===t?void 0:t.list),Qe(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ut=function(){var e=x()(m()().mark((function e(n,t){var i,s;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,D.ZP)("/api/shixuns/get_instance_startup_template.json",{method:"get",params:{private_cloud_id:n,operating_system:t}});case 2:0===(i=e.sent).status&&H(null==i||null===(s=i.data)||void 0===s?void 0:s.list);case 4:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),zt=function(){var e=x()(m()().mark((function e(){var n,t,i,s,a,r,l,_,o,c,u,d,p,h=arguments;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=h.length>0&&void 0!==h[0]?h[0]:null,He(!0),e.next=4,(0,D.ZP)("/api/shixuns/".concat(v,"/get_multi_environments.json"),{method:"get",params:{shixun_environment_id:n}});case 4:0===(t=e.sent).status&&($.current=(0,J.cloneDeep)(t.data||{}),V(t.data||{}),vn(Number(null===(i=t.data)||void 0===i||null===(i=i.shixun_environment)||void 0===i?void 0:i.mirror_tab_type)||0),0===Number(null===(s=t.data)||void 0===s||null===(s=s.shixun_environment)||void 0===s?void 0:s.mirror_tab_type)?(yn(null===(o=t.data)||void 0===o?void 0:o.mirror_repository),Tn({}),xt({})):1===Number(null===(a=t.data)||void 0===a||null===(a=a.shixun_environment)||void 0===a?void 0:a.mirror_tab_type)?(Tn(null===(c=t.data)||void 0===c?void 0:c.mirror_repository),yn({}),xt({})):2===Number(null===(r=t.data)||void 0===r||null===(r=r.shixun_environment)||void 0===r?void 0:r.mirror_tab_type)&&(xt(null===(u=t.data)||void 0===u?void 0:u.mirror_repository),yn({}),xt({})),d=null==t||null===(l=t.data)||void 0===l||null===(l=l.shixun_environment)||void 0===l?void 0:l.private_cloud_id,p=null==t||null===(_=t.data)||void 0===_||null===(_=_.shixun_environment)||void 0===_?void 0:_.operating_system,d&&p&&Ut(d,p)),He(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ft=function(){var e=x()(m()().mark((function e(){var n,t;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,D.ZP)("/api/shixuns/".concat(v,"/check_code_editor.json"),{method:"get",params:{shixun_environment_id:A}});case 2:if(0!==(n=e.sent).status){e.next=7;break}if(!n.is_exist_code_editor){e.next=7;break}return E.Z.confirm({icon:null,centered:!0,className:dt.Z.CustomTipsModalCss,okButtonProps:{type:"primary"},width:425,okText:"前往关闭",cancelText:"取消",title:"提示",content:(0,y.jsxs)("div",{children:[(0,y.jsx)("div",{children:"每个实践项目只能开启一个代码编辑器界面。"}),(0,y.jsxs)("div",{children:["“",null==n||null===(t=n.shixun_environment)||void 0===t?void 0:t.name,"”已开启代码编辑器,需先关闭,然后才能在当前实验环境选择代码编辑器。"]})]}),onOk:function(){var e=x()(m()().mark((function e(){return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:I(n.shixun_environment.id),zt(n.shixun_environment.id),Wt();case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}),e.abrupt("return",Promise.reject());case 7:return e.abrupt("return",Promise.resolve());case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ht={shixun_environment:{id:0,resource_type:1,is_support_code_editor:!1,is_support_vnc:!1,is_support_webssh:!1,is_support_thiry_party:!1,disabled_support_vnc:!1,disabled_support_webssh:!1,private_is_support_vnc:!1,private_is_support_webssh:!1,disabled2_support_vnc:!1,disabled2_support_webssh:!1,proxy_port:"",web_route:"",private_cloud_id:null,instance_startup_template_id:null,operating_system:1,instance_startup_type:1},mirror_repository:{choice_small_mirrors:[],shixun_service_configs:[]},small_type:[]},qt=function(e){(function(e,n){var t;if("string"==typeof(null==e?void 0:e.className)&&null!=e&&null!==(t=e.className)&&void 0!==t&&t.includes(n))return e;for(var i=0,s=e;s=s.parentNode;i++){var a;if("string"==typeof(null==e?void 0:e.className)&&null!==(a=s)&&void 0!==a&&null!==(a=a.className)&&void 0!==a&&a.includes(n))return s;if(s==document.documentElement)return!1}})(e.target,"editor-scrollable")&&Gt()},Gt=function(){return(0,ce.gy)(p,"不能选择/更换实验环境")},Yt=function(e){return(0,y.jsx)(ze.Z,{required:!0,name:"实验界面",errorKey:"interface",errorValue:Ee,align:"start",errorName:"请选择实验界面",tooltipTitle:(0,y.jsxs)("div",{className:"p10",children:[e&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("b",{className:"font14",children:"代码编辑器"}),(0,y.jsx)("br",{}),"学员进行实验时,为学员提供代码编辑器、编译器、调试器等工具。",(0,y.jsx)("br",{}),"当选择了VSCode相关的实验镜像时代码编辑器以VSCode的形式展示给学员。",(0,y.jsx)("br",{}),"每个实践项目",(0,y.jsx)("b",{children:"只能开启一个"}),"代码编辑器界面。",(0,y.jsx)("br",{})]}),(0,y.jsx)("div",{className:"mt10 blod font14",children:"图形化桌面"}),"学员进行实验时,使用图形化方式显示操作界面。",(0,y.jsx)("br",{}),(0,y.jsx)("div",{className:"mt10 blod font14",children:"命令行终端"}),"学员进行实验时,为学员提供命令行窗口。",e&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:"mt10 blod font14",children:"容器内服务"}),"学员进行实验时可以在实验页面直接预览容器内部Web服务。"]})]}),children:(0,y.jsxs)("div",{className:Vn,children:[e&&(0,y.jsxs)("div",{onClick:function(){return ei("shixun_environment","is_support_code_editor",!(null!=ne&&ne.is_support_code_editor))},className:null!=ne&&ne.is_support_code_editor?Gn:"",children:[(0,y.jsx)("span",{className:"iconfont icon-xuanzhong9"}),(0,y.jsxs)("div",{children:[(0,y.jsx)("i",{className:"iconfont icon-daimabianjiqi1"}),(0,y.jsx)("span",{children:"代码编辑器"})]}),(0,y.jsx)("aside",{children:" 提供代码编辑器,编译器,调试器等工具"})]}),null!=ne&&ne[e?"disabled_support_vnc":"disabled2_support_vnc"]?(0,y.jsx)(Ke.Z,{title:"选择的实验镜像不支持图形化桌面",children:(0,y.jsxs)("div",{className:Xn,children:[(0,y.jsx)("span",{className:"iconfont icon-xuanzhong9"}),(0,y.jsxs)("div",{children:[(0,y.jsx)("i",{className:"iconfont icon-tuxinghuazhuomian"}),(0,y.jsx)("span",{children:"图形化桌面"})]}),(0,y.jsx)("aside",{children:"使用图形化方式显示操作界面"})]})}):(0,y.jsxs)("div",{onClick:function(){return ei("shixun_environment",e?"is_support_vnc":"private_is_support_vnc",!(null!=ne&&ne[e?"is_support_vnc":"private_is_support_vnc"]))},className:null!=ne&&ne[e?"is_support_vnc":"private_is_support_vnc"]?Gn:"",children:[(0,y.jsx)("span",{className:"iconfont icon-xuanzhong9"}),(0,y.jsxs)("div",{children:[(0,y.jsx)("i",{className:"iconfont icon-tuxinghuazhuomian"}),(0,y.jsx)("span",{children:"图形化桌面"})]}),(0,y.jsx)("aside",{children:"使用图形化方式显示操作界面"})]}),null!=ne&&ne[e?"disabled_support_webssh":"disabled2_support_webssh"]?(0,y.jsx)(Ke.Z,{title:"选择的实验镜像不支持命令行终端",children:(0,y.jsxs)("div",{className:Xn,children:[(0,y.jsx)("span",{className:"iconfont icon-xuanzhong9"}),(0,y.jsxs)("div",{children:[(0,y.jsx)("i",{className:"iconfont icon-minglinghang"}),(0,y.jsx)("span",{children:"命令行终端"})]}),(0,y.jsx)("aside",{children:"提供命令行窗口"})]})}):(0,y.jsxs)("div",{onClick:function(){return ei("shixun_environment",e?"is_support_webssh":"private_is_support_webssh",!(null!=ne&&ne[e?"is_support_webssh":"private_is_support_webssh"]))},className:null!=ne&&ne[e?"is_support_webssh":"private_is_support_webssh"]?Gn:"",children:[(0,y.jsx)("span",{className:"iconfont icon-xuanzhong9"}),(0,y.jsxs)("div",{children:[(0,y.jsx)("i",{className:"iconfont icon-minglinghang"}),(0,y.jsx)("span",{children:"命令行终端"})]}),(0,y.jsx)("aside",{children:" 提供命令行窗口"})]}),e&&(0,y.jsxs)("div",{onClick:function(){return ei("shixun_environment","is_support_thiry_party",!(null!=ne&&ne.is_support_thiry_party))},className:null!=ne&&ne.is_support_thiry_party?Gn:"",children:[(0,y.jsx)("span",{className:"iconfont icon-xuanzhong9"}),(0,y.jsxs)("div",{children:[(0,y.jsx)("i",{className:"iconfont icon-rongqi1"}),(0,y.jsx)("span",{children:"容器内服务"})]}),(0,y.jsx)("aside",{children:" 直接预览容器内部Web服务"})]})]})})},Qt=function(e,n,t){var i=Array.from(e),s=i.splice(n,1),a=S()(s,1)[0];return i.splice(t,0,a),i},Jt=function(){var e=x()(m()().mark((function e(n,t){var i;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.destination){e.next=2;break}return e.abrupt("return");case 2:i=Qt(t,n.source.index,n.destination.index),C(i),(0,D.ZP)("/api/shixuns/".concat(v,"/update_environment_position.json"),{method:"put",body:{tabs:i}});case 5:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),Vt=function(e,n){var t,i=n;E.Z.confirm({icon:null,centered:!0,className:dt.Z.CustomTipsModalCss,okButtonProps:{type:"primary"},width:460,okText:"确认",cancelText:"取消",title:"重命名",content:(0,y.jsxs)("div",{children:[(0,y.jsx)("div",{className:"mb5 c-grey-333",children:"实验环境名称"}),(0,y.jsxs)("div",{children:[(0,y.jsx)(R.Z,{defaultValue:i,onChange:function(e){return i=e.target.value},maxLength:8,style:{width:300},placeholder:"请输入实验环境名称"}),(0,y.jsx)("span",{className:"c-grey-999 font14 ml10",children:"最多8个字"})]})]}),onOk:(t=x()(m()().mark((function n(){var t;return m()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(i){n.next=3;break}return b.ZP.warning("名称不能为空"),n.abrupt("return",Promise.reject());case 3:if(t=O.map((function(n){return n.id===e?s()(s()({},n),{},{name:i}):n})),0!==A){n.next=7;break}return C(t),n.abrupt("return");case 7:return n.next=9,(0,D.ZP)("/api/shixuns/".concat(v,"/update_environment_name.json"),{method:"put",body:{shixun_environment_id:e,name:i}});case 9:0===n.sent.status&&C(t);case 11:case"end":return n.stop()}}),n)}))),function(){return t.apply(this,arguments)})})},Xt=function(e,n){var t;Gt()||E.Z.confirm({icon:null,centered:!0,className:dt.Z.CustomTipsModalCss,width:425,okText:"确认",cancelText:"取消",title:"删除",content:"你确定要删除该实验环境?",okButtonProps:{type:"primary"},onOk:(t=x()(m()().mark((function n(){var t,i,s;return m()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(0!==A){n.next=4;break}n.t0={status:0},n.next=7;break;case 4:return n.next=6,(0,D.ZP)("/api/shixuns/".concat(v,"/delete_environment.json"),{method:"delete",body:{shixun_environment_id:e}});case 6:n.t0=n.sent;case 7:0===n.t0.status&&(t=O.filter((function(n){return n.id!==e})),e===A?(s=(null==t||null===(i=t[0])||void 0===i?void 0:i.id)||null,I(s),zt(s),C(t)):C(t));case 9:case"end":return n.stop()}}),n)}))),function(){return t.apply(this,arguments)})})},$t=function(){var e=x()(m()().mark((function e(){var n,t,i,a,r,l,_,o=arguments;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]&&o[0],i=o.length>1&&void 0!==o[1]?o[1]:1,$e(!0),a=null===(n=O.find((function(e){return e.id===A})))||void 0===n?void 0:n.name,e.next=6,(0,D.ZP)("/api/shixuns/".concat(v,"/update_for_multi.json"),{method:"put",body:{tabs:O,shixun_environment_id:A,sub_type:null==se?void 0:se.choice_small_type,main_type:se.id,shixun_environment:s()(s()({},ne),{},{name:a,mirror_tab_type:xn,network_mode:gt}),shixun_service_configs:null==se?void 0:se.shixun_service_configs,new_service_configs:_e,sync_origin_shixun:t}});case 6:0===(r=e.sent).status&&(zt(r.shixun_environment_id),I(r.shixun_environment_id),Wt(),null!=h&&null!==(l=h.detail)&&void 0!==l&&l.copy_for_exercise||b.ZP.success("保存成功"),null!=h&&null!==(_=h.detail)&&void 0!==_&&_.copy_for_exercise&&(0,te.m)(p,h,v,i)),$e(!1);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ei=function(){var e=x()(m()().mark((function e(n,t,i){var s,a,r,l,_,o,c,u,d,p,h,x;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Gt()){e.next=2;break}return e.abrupt("return");case 2:if(s=(0,J.cloneDeep)(X.current),"is_support_code_editor"!==t||!i){e.next=6;break}return e.next=6,Ft();case 6:"resource_type"===t&&(s.shixun_environment.instance_startup_type=1,2!==i||s.shixun_environment.private_cloud_id||(s.shixun_environment.private_cloud_id=null==k||null===(a=k[0])||void 0===a?void 0:a.id,s.shixun_environment.operating_system=1,Ut(s.shixun_environment.private_cloud_id,s.shixun_environment.operating_system))),"private_cloud_id"===t&&(s.shixun_environment.private_is_support_vnc=!1,s.shixun_environment.private_is_support_webssh=!1,s.shixun_environment.operating_system=1,s.shixun_environment.instance_startup_template_id=null,s.shixun_environment.instance_startup_type=1,Ut(i,s.shixun_environment.operating_system)),"operating_system"===t&&i&&(s.shixun_environment.private_is_support_vnc=!1,s.shixun_environment.private_is_support_webssh=!1,s.shixun_environment.instance_startup_template_id=null,s.shixun_environment.instance_startup_type=1,Ut(s.shixun_environment.private_cloud_id,i)),"instance_startup_template_id"===t&&(s.shixun_environment.private_is_support_vnc=!1,s.shixun_environment.private_is_support_webssh=!1,s.shixun_environment.instance_startup_type=1,l=z.find((function(e){return e.id===i})),s.shixun_environment.disabled2_support_vnc=l.disabled_support_vnc,s.shixun_environment.disabled2_support_webssh=l.disabled_support_webssh,s.boosters=l.boosters,s.network_mode_list=l.network_mode_list,jt(null===(r=l.network_mode_list)||void 0===r||null===(r=r.filter((function(e){return e.is_default})))||void 0===r||null===(r=r[0])||void 0===r?void 0:r.network_mode),s.new_service_configs=null!=l&&l.service_config_info?[l.service_config_info]:[]),"private_is_support_vnc"!==t&&"private_is_support_webssh"!==t||(s.shixun_environment.instance_startup_type=1),"choice_small_type"===t&&(s.mirror_repository.choice_small_mirrors=re.filter((function(e){return i.includes(e.id)})),_=s.mirror_repository.choice_small_mirrors,o=se.choice_small_mirrors,_.length>o.length?null!=(u=(0,J.differenceBy)(_,o,"id"))&&null!==(c=u[0])&&void 0!==c&&c.mirror_name&&(h={cpu_limit:1,lower_cpu_limit:.1,memory_limit:1,mirror_repository_id:null==u||null===(d=u[0])||void 0===d?void 0:d.id,name:null==u||null===(p=u[0])||void 0===p?void 0:p.mirror_name,request_limit:10,resource_limit:10},s.mirror_repository.shixun_service_configs.push(h)):(x=(0,J.differenceBy)(o,_,"id"),s.mirror_repository.shixun_service_configs=s.mirror_repository.shixun_service_configs.filter((function(e){var n;return e.mirror_repository_id!==(null==x||null===(n=x[0])||void 0===n?void 0:n.id)})))),t?s[n][t]=i:s[n]=i,console.log("cloneData",s),be(""),V(s);case 16:case"end":return e.stop()}}),e)})));return function(n,t,i){return e.apply(this,arguments)}}(),ni=function(e,n,t){var i,s=(0,J.cloneDeep)(null===(i=X.current)||void 0===i||null===(i=i.mirror_repository)||void 0===i?void 0:i.shixun_service_configs);["cpu_limit","lower_cpu_limit","memory_limit","request_limit","resource_limit"].includes(n)?t.match(/^\d*(\.\d*)?$/)&&(s[e][n]=t,ei("mirror_repository","shixun_service_configs",s)):(s[e][n]=t,ei("mirror_repository","shixun_service_configs",s))},ti=function(){E.Z.info({centered:!0,icon:null,width:460,title:"联系平台管理员",content:(0,y.jsx)("div",{className:"tc",children:(0,y.jsx)("img",{style:{border:"4px solid #0152d9",borderRadius:"4px"},src:Rn,alt:"二维码",width:160})}),okText:"我知道了"})},ii=function(){var e=x()(m()().mark((function e(n){return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ni(n.index,"cpu_limit",String(null==n?void 0:n.cpu));case 2:return e.next=4,ni(n.index,"memory_limit",String(null==n?void 0:n.memory));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,y.jsxs)("div",{className:Bn,children:[(0,y.jsxs)("div",{className:Zn,children:[(0,y.jsxs)("div",{className:Wn,children:[(0,y.jsx)("div",{className:Kn,children:"实验环境"}),O.length<5?(0,y.jsx)("div",{onClick:function(){var e;if(!Gt())if(0===A||null!=d&&null!==(e=d.sideBar)&&void 0!==e&&e.confirmLeave)b.ZP.warning("当前实验环境正在编辑中,不能添加新的实验环境");else{var n=(0,J.cloneDeep)(Ht);console.log("cloneData---",n),C([].concat(F()(O),[{id:0,name:"实验环境".concat(O.length+1)}])),vn(0),yn({}),Tn({}),xt({}),I(0),V(n)}},className:Un,children:"添加实验环境"}):(0,y.jsx)(Ke.Z,{title:"最多可以添加".concat(5,"个实验环境"),children:(0,y.jsx)("div",{className:zn,children:"添加实验环境"})}),(0,y.jsx)("div",{onClick:function(){return on(!0)},className:Fn,children:"设置"})]}),!!O.length&&(0,y.jsxs)(l.Fragment,{children:[(0,y.jsx)(pe.Z5,{onDragEnd:function(e){return Jt(e,O)},children:(0,y.jsx)(pe.bK,{droppableId:"droppable",direction:"horizontal",children:function(e,n){return(0,y.jsxs)("div",s()(s()({},e.droppableProps),{},{ref:e.innerRef,className:Hn,children:[O.map((function(e,n){var t=e.name,i=e.id;return(0,y.jsx)(pe._l,{draggableId:i.toString(),index:n,children:function(e,n){return(0,l.createElement)("div",s()(s()(s()({},e.draggableProps),e.dragHandleProps),{},{ref:e.innerRef,className:A===i?Gn:"",key:i}),(0,y.jsx)("i",{className:"iconfont icon-tuodong"}),(0,y.jsx)("span",{className:qn,onClick:function(){return function(e){var n;if(e!==A){var t=function(){I(e),zt(e),Wt()};null!=d&&null!==(n=d.sideBar)&&void 0!==n&&n.confirmLeave?E.Z.confirm({title:"离开此页提示",content:"系统可能不会保存您所做的更改。",okText:"离开",cancelText:"取消",onOk:function(){t()}}):t()}}(i)},children:t}),(0,y.jsx)(ve.Z,{trigger:["click"],dropdownRender:function(){return(0,y.jsxs)(fe.Z,{style:{width:92},children:[(0,y.jsx)(fe.Z.Item,{onClick:function(){return Vt(i,t)},className:"font14",children:"重命名"}),(0,y.jsx)(fe.Z.Item,{onClick:function(){return Xt(i)},className:"font14",children:"删除"})]})},getPopupContainer:function(e){return e.parentNode},children:(0,y.jsx)("i",{className:"iconfont icon-zhankai5 current"})}))}},i)})),e.placeholder]}))}})}),(0,y.jsx)("div",{className:Yn})]}),(0,y.jsxs)(xe.Z,{loading:Be||Ye,active:!0,children:[!!O.length&&(0,y.jsxs)(l.Fragment,{children:[(0,y.jsx)(ze.Z,{required:!0,name:"实验资源",tooltipTitle:(0,y.jsxs)("div",{className:"p10",children:[(0,y.jsx)("b",{className:"font14",children:"通用云"}),(0,y.jsx)("br",{}),"常规场景选用,调用头歌通用资源,基于容器形式为实训提供虚拟实验环境。",(0,y.jsx)("br",{}),(0,y.jsx)("div",{className:"mt10 blod font14",children:"专有云"}),"专用场景可选用不同云集群的资源包括阿里云、华为云、算能云等如算能云适用于需要调用TPU资源训练的实训"]}),children:(0,y.jsx)("div",{className:Qn,children:[{id:1,name:"通用云"},{id:2,name:"专有云"}].map((function(e){return(0,y.jsx)("div",{className:(null==ne?void 0:ne.resource_type)===e.id?Gn:"",onClick:function(){(null==ne?void 0:ne.resource_type)!==e.id&&ei("shixun_environment","resource_type",e.id)},children:e.name},e.id)}))})}),1===(null==ne?void 0:ne.resource_type)&&(0,y.jsxs)(l.Fragment,{children:[(0,y.jsx)(ze.Z,{required:!0,name:"实验镜像",children:(0,y.jsx)("div",{className:Qn,style:{width:300},children:wt.map((function(e){return(0,y.jsx)("div",{className:xn===e.id?Gn:"",onClick:function(){xn!==e.id&&(Gt()||(vn(e.id),be(""),0===e.id&&V(s()(s()({},Q),{},{mirror_repository:s()({},Pn)})),1===e.id&&V(s()(s()({},Q),{},{mirror_repository:s()({},Sn)})),2===e.id&&V(s()(s()({},Q),{},{mirror_repository:s()({},Nn)}))))},children:e.name},e.id)}))})}),(0,y.jsx)(ze.Z,{errorKey:"mirror",errorValue:Ee,errorName:"请选择实验镜像",children:(0,y.jsx)(Z.Z,{align:"middle",children:!1===jn?(0,y.jsxs)(y.Fragment,{children:[!(null==se||!se.id)&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("div",{onClick:function(){Gt()||pn(!0)},className:Jn,children:[(0,y.jsx)("div",{children:null==se?void 0:se.name}),(0,y.jsx)("i",{className:"iconfont icon-genghuan"})]}),(0,y.jsx)(Ln.Z,{value:[{description:null==se?void 0:se.description,name:null==se?void 0:se.name}],title:"实验镜像说明",children:(0,y.jsx)("span",{className:rt,children:"实验镜像说明"})})]}),!(null!=se&&se.id)&&(0,y.jsxs)("div",{onClick:function(){pn(!0)},className:Jn,children:[(0,y.jsx)("i",{className:"iconfont icon-tianjia3 font14 mr10"}),(0,y.jsx)("div",{children:"选择实验镜像"})]})]}):"暂无数据"})}),Yt(!0),(null==ne?void 0:ne.is_support_thiry_party)&&(0,y.jsx)(ze.Z,{required:!0,align:"start",name:"端口配置",errorKey:"port",errorValue:Ee,errorName:ye,children:(0,y.jsxs)(Z.Z,{children:[(0,y.jsxs)("div",{className:"font14",style:{lineHeight:"14px"},children:[(0,y.jsx)("div",{children:"容器端口"}),(0,y.jsx)(R.Z,{onClick:Gt,value:null==ne?void 0:ne.proxy_port,onChange:function(e){var n=e.target.value;(""===n||/^[0-9]\d*$/.test(n))&&ei("shixun_environment","proxy_port",e.target.value)},bordered:!1,style:{width:400,height:50,background:"#F5F5F5",borderRadius:4,marginTop:6}})]}),(0,y.jsxs)("div",{className:"ml20",children:[(0,y.jsx)("div",{className:"font14",style:{lineHeight:"14px"},children:"路由(选填)"}),(0,y.jsx)(R.Z,{onClick:Gt,value:null==ne?void 0:ne.web_route,onChange:function(e){return ei("shixun_environment","web_route",e.target.value)},bordered:!1,style:{width:450,height:50,background:"#F5F5F5",borderRadius:4,marginTop:6}})]})]})}),(0,y.jsx)(ze.Z,{name:"附带环境",children:(0,y.jsxs)(Z.Z,{align:"middle",children:[(0,y.jsx)(We.default,{getPopupContainer:function(e){return e.parentNode},onClick:Gt,mode:"multiple",bordered:!1,className:"mr10",optionFilterProp:"children",placeholder:"请选择附带环境",style:{minWidth:400,backgroundColor:"#f5f5f5",height:50,borderRadius:4,paddingTop:10},value:null==se?void 0:se.choice_small_type,onChange:function(e){return ei("mirror_repository","choice_small_type",e)},showArrow:!0,maxTagCount:5,children:re.map((function(e,n){return(0,y.jsx)(ht,{value:e.id,children:e.type_name},e.id)}))}),!(null==se||null===(i=se.choice_small_mirrors)||void 0===i||!i.length)&&(0,y.jsx)(Ln.Z,{value:(null==se?void 0:se.choice_small_mirrors)||[],title:"附带环境说明",children:(0,y.jsx)("span",{className:rt,children:"附带环境说明"})})]})}),(0,An.Ny)()&&(0,y.jsxs)(l.Fragment,{children:[(0,y.jsxs)("div",{onClick:function(){return Ae(!Te)},className:$n,children:["高级设置",(0,y.jsx)("i",{className:"iconfont ".concat(Te?"icon-shouqi4":"icon-a-xialazhankai")})]}),Te&&(0,y.jsx)(l.Fragment,{children:(0,y.jsx)(ze.Z,{required:!0,name:"镜像配置",align:"start",errorKey:"shixun_service_configs",errorValue:Ee,errorName:"请添加镜像配置",contentStyle:{overflow:null!=se&&null!==(a=se.shixun_service_configs)&&void 0!==a&&a.length?"hidden":"initial"},children:(0,y.jsxs)("div",{className:et,children:[!(null!=se&&null!==(r=se.shixun_service_configs)&&void 0!==r&&r.length)&&(0,y.jsx)(de.Z,{image:Fe,imageStyle:{height:180,marginTop:67},description:""}),!(null==se||null===(_=se.shixun_service_configs)||void 0===_||!_.length)&&(0,y.jsx)(Me.Z,{destroyInactiveTabPane:!0,moreIcon:(0,y.jsxs)("span",{className:tt,children:["更多 ",(0,y.jsx)("i",{className:"iconfont icon-xiala1"})]}),children:null==se||null===(o=se.shixun_service_configs)||void 0===o?void 0:o.map((function(e,n){var t,i=e.cpu_limit,s=(e.lower_cpu_limit,e.memory_limit),a=(e.request_limit,e.resource_limit),r=e.name;return(0,y.jsxs)(Me.Z.TabPane,{className:"p20",tab:(0,y.jsx)("div",{title:r,className:nt,children:r}),children:[(0,y.jsx)(ze.Z,{name:"资源配置",align:"center",children:(0,y.jsxs)(Z.Z,{align:"middle",children:[(0,y.jsx)(Z.Z,{align:"middle",className:"mr20",wrap:!1,children:(0,y.jsxs)("div",{className:it,onClick:function(){Gt()||(It({index:n,cpu:i,memory:s}),Pt(!0))},children:[(0,y.jsxs)("div",{children:[(0,y.jsxs)("span",{children:[i,"核"]})," ",(0,y.jsxs)("span",{children:[s,"GB"]})]}),(0,y.jsx)("i",{className:"iconfont icon-bianji21"})]})}),0==n&&(0,y.jsx)(Z.Z,{align:"middle",wrap:!1,children:(0,y.jsx)("div",{className:st,onClick:function(){return Mt(!0)},children:"查看推荐配置"})})]})}),(0,y.jsx)(ze.Z,{name:"文件大小限制",align:"center",children:(0,y.jsx)(Z.Z,{align:"middle",children:(0,y.jsxs)(Z.Z,{align:"middle",wrap:!1,children:[(0,y.jsx)(R.Z,{onClick:Gt,style:{width:400},value:a,maxLength:5,onChange:function(e){e.target.value.match(/^\d*(\.\d*)?$/)&&ni(n,"resource_limit",e.target.value)},addonAfter:"M"}),(0,y.jsx)("span",{style:{marginLeft:10,color:"#999"},children:"File size limit参数表示单个文件上传的大小限制"})]})})}),(0,y.jsxs)(ze.Z,{name:"启动设置",align:"start",required:null==e?void 0:e.open_start_command,errorKey:"start_command",errorValue:Ee,errorName:"请输入启动命令",children:[(0,y.jsxs)("div",{className:"font14 mb5",children:["用户名",(0,y.jsx)("span",{className:"c-grey-999",children:"(登录容器时可使用的用户名)"})]}),(0,y.jsx)(We.default,{getPopupContainer:function(e){return e.parentNode},onClick:Gt,bordered:!1,fieldNames:{label:"name",value:"id"},options:null==Q||null===(t=Q.mirror_repository)||void 0===t?void 0:t.webssh_user_arr,value:(null==e?void 0:e.webssh_user)||"root",onChange:function(e){return ni(n,"webssh_user",e)},style:{minWidth:400,backgroundColor:"#f5f5f5",height:50,borderRadius:4,paddingTop:10,marginBottom:20}}),(0,y.jsxs)("div",{className:"font14 mb5",children:["主机名",(0,y.jsx)("span",{className:"c-grey-999",children:"(登录容器时可指定主机名)"})]}),(0,y.jsxs)(Z.Z,{className:"mb20",children:[(0,y.jsx)(R.Z,{bordered:!1,onClick:Gt,value:null==e?void 0:e.webssh_host,maxLength:255,placeholder:"选填,操作系统内部的计算机名",onChange:function(e){if(ni(n,"webssh_host",e.target.value),e.target.value){/^(?![0-9]+$)(?!.*--)[a-z0-9](?:[a-z0-9-]{0,60}[a-z0-9])$/.test(e.target.value)?an(!1):an(!0)}else an(!1)},style:{width:400,height:50,background:"#F5F5F5",borderRadius:4,marginTop:5,marginRight:10}}),(0,y.jsxs)("div",{style:{marginTop:8,maxWidth:575},className:"c-grey-999",children:["长度为2~64个字符只能包含小写字母、数字、连字符 “-”,必须以字母或数字开头和结尾",(0,y.jsx)("br",{}),"不能连续使用 “-”,不能使用纯数字"]})]}),tn&&(0,y.jsx)("div",{style:{color:"#E53333",marginTop:"-15px",marginBottom:"5px"},children:"请输入规范的主机名"}),(0,y.jsxs)(U.Z,{checked:null==e?void 0:e.open_start_command,onChange:function(e){return ni(n,"open_start_command",e.target.checked)},style:{marginTop:-4},className:"font14",children:["启动命令",(0,y.jsx)("span",{className:"c-grey-999",children:"(启动容器时运行的命令或脚本,填写将覆盖容器默认的启动指令。)"})]}),(null==e?void 0:e.open_start_command)&&(0,y.jsx)(On.ZP,{width:"90%",height:250,placeholder:"例如echo helloworld > /data/workspace/01.txt",style:{border:"1px solid #ccc",background:"#dedede",marginTop:"20px"},value:null==e?void 0:e.start_command,language:"shell",theme:"vs-light",onChange:function(e){return ni(n,"start_command",e)}})]}),(0,y.jsxs)(ze.Z,{required:null==e?void 0:e.open_envs,name:"环境变量",align:"start",errorKey:"envs",errorValue:Ee,errorName:"请输入环境变量",children:[(0,y.jsxs)(U.Z,{checked:null==e?void 0:e.open_envs,onChange:function(e){return ni(n,"open_envs",e.target.checked)},style:{marginTop:-4},className:"font14",children:["环境变量",(0,y.jsx)("span",{className:"c-grey-999",children:"(为容器添加环境变量)"})]}),(null==e?void 0:e.open_envs)&&(0,y.jsx)(On.ZP,{width:"90%",height:250,placeholder:"例如MY_VARIABLE=my_value",style:{border:"1px solid #ccc",background:"#dedede",marginTop:"20px"},language:"shell",theme:"vs-light",value:null==e?void 0:e.envs,onChange:function(e){return ni(n,"envs",e)}})]}),(0,y.jsx)(ze.Z,{name:"访问模式",children:(0,y.jsxs)(Z.Z,{align:"middle",children:[(0,y.jsx)(Ue.Z,{checked:null==e?void 0:e.privileged,onChange:function(e){return ni(n,"privileged",e)}}),(0,y.jsx)("span",{className:"ml10 c-grey-333 font14",children:"特权模式"}),(0,y.jsx)("span",{className:"c-grey-999 font14",children:"(赋予容器访问宿主机内核特性和设备的能力)"})]})}),(0,y.jsxs)(ze.Z,{name:"权限控制",align:"start",children:[(0,y.jsxs)("div",{className:"font14",children:["添加权限",(0,y.jsx)("span",{className:"c-grey-999",children:"(添加多个权限用英文 , 分隔)"})]}),(0,y.jsx)(R.Z,{onClick:Gt,value:null==e?void 0:e.add_cap,onChange:function(e){return ni(n,"add_cap",e.target.value)},bordered:!1,placeholder:"例如NET_ADMIN",style:{width:400,height:50,background:"#F5F5F5",borderRadius:4,marginTop:5}}),(0,y.jsxs)("div",{className:"font14 mt20",children:["移除权限",(0,y.jsx)("span",{className:"c-grey-999",children:"(移除多个权限用英文 , 分隔)"})]}),(0,y.jsx)(R.Z,{onClick:Gt,value:null==e?void 0:e.drop_cap,onChange:function(e){return ni(n,"drop_cap",e.target.value)},bordered:!1,placeholder:"例如SYS_PTRACE",style:{width:400,height:50,background:"#F5F5F5",borderRadius:4,marginTop:5}})]})]},n)}))})]})})})]})]}),2===(null==ne?void 0:ne.resource_type)&&(0,y.jsxs)(l.Fragment,{children:[(0,y.jsx)(ze.Z,{children:(0,y.jsx)(We.default,{getPopupContainer:function(e){return e.parentNode},bordered:!1,onClick:Gt,className:"mr10",style:{width:460,backgroundColor:"#f5f5f5",height:50,borderRadius:4,paddingTop:10},showArrow:!0,value:null==ne?void 0:ne.private_cloud_id,onChange:function(e){return ei("shixun_environment","private_cloud_id",e)},children:k.map((function(e,n){return(0,y.jsx)(ht,{value:e.id,children:e.name},e.id)}))})}),(0,y.jsx)(ze.Z,{name:"操作系统",required:!0,errorKey:"system",errorValue:Ee,errorName:"请选择操作系统",children:(0,y.jsx)("div",{className:at,children:[{id:1,name:"Windows",icon:"iconfont icon-Windows"},{id:2,name:"Linux",icon:"iconfont icon-Linux"},{id:3,name:"其他",icon:"iconfont icon-qitaxitong"}].map((function(e){return(0,y.jsxs)("div",{onClick:function(){ne.operating_system!==e.id&&ei("shixun_environment","operating_system",e.id)},className:(null==ne?void 0:ne.operating_system)===e.id?Gn:"",children:[(0,y.jsx)("i",{className:e.icon}),(0,y.jsx)("span",{children:e.name})]},e.id)}))})}),(0,y.jsx)(ze.Z,{required:!0,name:"实例启动模版",errorKey:"template",errorValue:Ee,errorName:"请选择实例启动模版",children:(0,y.jsxs)(Z.Z,{align:"middle",children:[(0,y.jsx)(We.default,{getPopupContainer:function(e){return e.parentNode},bordered:!1,className:"mr10",placeholder:"请选择实例启动模版",style:{width:460,backgroundColor:"#f5f5f5",height:50,borderRadius:4,paddingTop:10},onClick:Gt,ref:q,showArrow:!0,dropdownRender:function(e){return(0,y.jsxs)("div",{className:_t,children:[(0,y.jsx)("div",{className:ot,children:z.map((function(e){return(0,y.jsxs)("div",{className:ct,onClick:function(){q.current.blur(),ei("shixun_environment","instance_startup_template_id",e.id)},children:[(0,y.jsx)("span",{title:e.name,style:{color:(null==ne?void 0:ne.instance_startup_template_id)===e.id?"#0152d9":"initial"},children:e.name}),!e.is_public&&(0,y.jsx)("b",{className:ut,children:"私有"})]},e.id)}))}),(0,y.jsxs)("div",{style:{padding:12},children:[!z.length&&(0,y.jsx)(de.Z,{image:Fe,imageStyle:{height:120,marginTop:20},description:"暂无数据"}),(0,y.jsxs)("div",{style:{marginTop:null!=z&&z.length?0:20},className:"c-grey-999 font14",children:["未找到合适的实例启动模板?",(0,y.jsx)("span",{onClick:ti,className:"c-light-primary current",children:"联系平台管理员"})]})]})]})},options:null==z?void 0:z.map((function(e){return{label:e.name,value:e.id}})),value:null==ne?void 0:ne.instance_startup_template_id}),!!kt&&(0,y.jsx)(Ln.Z,{value:kt,title:"模版描述",children:(0,y.jsx)("span",{className:rt,children:"模版描述"})})]})}),Yt(!1),1===(null==ne?void 0:ne.operating_system)&&(null==ne?void 0:ne.private_is_support_vnc)&&(Rt||Bt&&1===Lt)&&(0,y.jsx)(ze.Z,{required:!0,name:"实例启动方式",errorKey:"instance_startup_type",errorValue:Ee,errorName:"请选择实例启动模版",children:(0,y.jsx)("div",{className:Qn,children:[{id:1,name:"VNC"},{id:2,name:"RDP"}].map((function(e){return(0,y.jsx)("div",{className:(null==ne?void 0:ne.instance_startup_type)===e.id?Gn:"",onClick:function(){return ei("shixun_environment","instance_startup_type",e.id)},children:e.name},e.id)}))})}),(0,An.Ny)()&&1===Lt&&(0,y.jsxs)(l.Fragment,{children:[(0,y.jsxs)("div",{onClick:function(){return ke(!Ne)},className:$n,children:["高级设置",(0,y.jsx)("i",{className:"iconfont ".concat(Ne?"icon-shouqi4":"icon-a-xialazhankai")})]}),Ne&&(0,y.jsxs)(l.Fragment,{children:[(0,y.jsx)(ze.Z,{required:!0,name:"资源配置",align:"start",errorKey:"shixun_service_configs",errorValue:Ee,errorName:"请添加资源配置",contentStyle:{overflow:null!=_e&&_e.length?"hidden":"initial"},children:(0,y.jsxs)("div",{className:et,children:[!(null!=_e&&_e.length)&&(0,y.jsx)(de.Z,{image:Fe,imageStyle:{height:180,marginTop:67},description:""}),!(null==_e||!_e.length)&&(0,y.jsx)(Me.Z,{destroyInactiveTabPane:!0,moreIcon:(0,y.jsxs)("span",{className:tt,children:["更多 ",(0,y.jsx)("i",{className:"iconfont icon-xiala1"})]}),children:null==_e?void 0:_e.map((function(e,n){var t=e.cpu_limit,i=(e.lower_cpu_limit,e.memory_limit),s=(e.request_limit,e.resource_limit,e.name);return(0,y.jsx)(Me.Z.TabPane,{className:"p20",tab:(0,y.jsx)("div",{title:s,className:nt,children:s}),children:(0,y.jsxs)(Z.Z,{align:"middle",children:[(0,y.jsx)(Z.Z,{align:"middle",className:"mr20",wrap:!1,children:(0,y.jsxs)("div",{className:it,onClick:function(){It({index:n,cpu:t,memory:i}),Pt(!0)},children:[(0,y.jsxs)("div",{children:[(0,y.jsxs)("span",{children:[t,"核"]})," ",(0,y.jsxs)("span",{children:[i,"GB"]})]}),(0,y.jsx)("i",{className:"iconfont icon-bianji21"})]})}),0==n&&(0,y.jsx)(Z.Z,{align:"middle",wrap:!1,children:(0,y.jsx)("div",{className:st,onClick:function(){return Mt(!0)},children:"查看推荐配置"})})]})},n)}))})]})}),(0,An.Ny)()&&(null==he?void 0:he.length)>0&&(0,y.jsx)(ze.Z,{required:!0,name:"GPU加速器",align:"center",children:(0,y.jsx)(We.default,{disabled:!0,getPopupContainer:function(e){return e.parentNode},bordered:!1,className:"mr10",value:he[0],style:{width:460,backgroundColor:"#f5f5f5",height:50,borderRadius:4,paddingTop:10},showArrow:!0,children:he.map((function(e){return(0,y.jsx)(We.default.Option,{value:e,children:e},e)}))})}),(0,An.Ny)()&&(null==ue?void 0:ue.length)>0&&(0,y.jsx)(ze.Z,{required:!0,name:"网络模式",align:"center",tooltipTitle:(0,y.jsxs)("div",{className:"p10",children:[(0,y.jsx)("p",{children:"NAT模式虚拟机通过主机的网络连接共享IP地址。虚拟机的IP固定为10.0.2.2"}),(0,y.jsx)("p",{children:"passt模式允许虚拟机直接访问主机上的硬件设备。虚拟机的IP为pod的IP"})]}),children:(0,y.jsx)(We.default,{disabled:!0,getPopupContainer:function(e){return e.parentNode},bordered:!1,className:"mr10",value:null==ue||null===(c=ue.filter((function(e){return e.is_default})))||void 0===c||null===(c=c[0])||void 0===c?void 0:c.network_mode,onChange:function(e){jt(e)},style:{width:460,backgroundColor:"#f5f5f5",height:50,borderRadius:4,paddingTop:10},showArrow:!0,children:null==ue?void 0:ue.map((function(e){return(0,y.jsx)(We.default.Option,{value:null==e?void 0:e.network_mode,children:e.name},null==e?void 0:e.network_mode)}))})})]})]})]})]}),!O.length&&(0,y.jsx)(de.Z,{image:Fe,imageStyle:{height:180,marginTop:100},description:"请添加实验环境"})]})]}),(0,y.jsxs)("div",{className:lt,children:[(0,y.jsx)(L.ZP,{onClick:function(){var e,n=function(){P.history.push("/shixuns/".concat(v,"/challenges")),p({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})};null!=d&&null!==(e=d.sideBar)&&void 0!==e&&e.confirmLeave?E.Z.confirm({title:"离开此页提示",content:"系统可能不会保存您所做的更改。",okText:"离开",cancelText:"取消",onOk:function(){n()}}):n()},style:{marginRight:40},children:"取消"}),(0,y.jsx)(L.ZP,{loading:Xe,type:"primary",disabled:!(null!=O&&O.length),onClick:function(){!function(){var e,n;if(!Gt()){if(1===(null==ne?void 0:ne.resource_type)){var t,i,s,a;if(null==se||!se.id)return void be("mirror");if(!(null!=ne&&ne.is_support_code_editor||null!=ne&&ne.is_support_vnc||null!=ne&&ne.is_support_webssh||null!=ne&&ne.is_support_thiry_party))return void be("interface");if(ne.is_support_thiry_party&&(null==ne||!ne.proxy_port))return be("port"),void Oe("请输入端口");if(ne.is_support_thiry_party&&null!=ne&&ne.proxy_port&&parseInt(null==ne?void 0:ne.proxy_port)>65535||(null==ne||null===(t=ne.proxy_port)||void 0===t?void 0:t.length)>1&&"0"===(null==ne||null===(i=ne.proxy_port)||void 0===i?void 0:i[0]))return be("port"),void Oe("请输入正确的端口");if(null==se||null===(s=se.shixun_service_configs)||void 0===s||!s.length)return void be("shixun_service_configs");var r,l,_=Ze()(null==se?void 0:se.shixun_service_configs);try{for(_.s();!(r=_.n()).done;){var o=r.value;if(null!=o&&o.open_start_command&&(null==o||!o.start_command))return void be("start_command");if(null!=o&&o.open_envs&&(null==o||!o.envs))return void be("envs")}}catch(e){_.e(e)}finally{_.f()}if(null!=ne&&ne.webssh_host&&!/^[a-z0-9\-]*$/.test(null==ne?void 0:ne.webssh_host))return void b.ZP.warning("主机名只能输入数字、小写字母、连字符");if(null!=se&&null!==(a=se.shixun_service_configs)&&void 0!==a&&null!==(a=a[0])&&void 0!==a&&a.webssh_host)if(!/^(?![0-9]+$)(?!.*--)[a-z0-9](?:[a-z0-9-]{0,60}[a-z0-9])$/.test(null==se||null===(l=se.shixun_service_configs)||void 0===l||null===(l=l[0])||void 0===l?void 0:l.webssh_host))return void an(!0)}if(2===(null==ne?void 0:ne.resource_type)){if(null==ne||!ne.operating_system)return void be("system");if(null==ne||!ne.instance_startup_template_id)return void be("template");if(!(null!=ne&&ne.private_is_support_vnc||null!=ne&&ne.private_is_support_webssh))return void be("interface");if(1===(null==ne?void 0:ne.operating_system)&&null!=ne&&ne.private_is_support_vnc&&Rt&&(null==ne||!ne.instance_startup_type))return void be("instance_startup_type")}null!=h&&null!==(e=h.detail)&&void 0!==e&&e.is_fork_from_creator&&null!=h&&null!==(n=h.detail)&&void 0!==n&&n.copy_for_exercise&&0!=A&&null!=ne&&ne.has_relation?p({type:"classroomList/setActionTabs",payload:{key:"同步修改",type:"environment",fn:function(e,n){$t(e,n)}}}):$t()}}()},children:"保存"})]}),(0,y.jsx)(sn,{identifier:v,shixun_environment_id:A,useId:null==se?void 0:se.id,visible:dn,onCancel:function(){return pn(!1)},onOk:function(e){return function(e){var n=s()(s()({},Q),{},{shixun_environment:s()(s()({},ne),{},{is_support_code_editor:e.no_used_code_editor,is_support_vnc:!1,is_support_webssh:!1,is_support_thiry_party:!1,disabled_support_vnc:e.disabled_support_vnc,disabled_support_webssh:e.disabled_support_webssh,open_start_command:e.open_start_command,start_command:e.start_command,open_envs:e.open_envs,envs:e.envs,privileged:e.privileged,add_cap:e.add_cap,drop_cap:e.drop_cap}),mirror_repository:s()(s()({},se),{},{id:e.id,name:e.name,choice_small_type:[],choice_small_mirrors:[],shixun_service_configs:e.shixun_service_configs||[],description:e.description}),small_type:e.small_type});0===xn?yn(null==n?void 0:n.mirror_repository):1===xn?Tn(null==n?void 0:n.mirror_repository):2===xn&&xt(null==n?void 0:n.mirror_repository),V(n),pn(!1),be("")}(e)},tab_type:null===(u=wt[Number(xn)])||void 0===u?void 0:u.type}),(0,y.jsx)(kn,{verifyModal:Gt,id:v,environment:O,is_published:f,dispatch:p,visible:_n,onCancel:function(){return on(!1)},onOk:function(e){pn(!1)}}),(0,y.jsx)(pt.Z,{visible:Dt,onOk:function(e){var n=null==ne?void 0:ne.resource_type;1==n&&ii(e),2==n&&function(e){var n=(0,J.cloneDeep)(_e);n[e.index]=s()(s()({},n[e.index]),{},{cpu_limit:String(null==e?void 0:e.cpu),memory_limit:String(null==e?void 0:e.memory)}),ei("new_service_configs","",n)}(e),Pt(!1)},onCancel:function(){return Pt(!1)},info:At}),(0,y.jsx)(mt.Z,{onOk:function(){zt(null==ne?void 0:ne.id)},identifier:v,visible:Ct,onCancel:function(){return Mt(!1)},info:null,isJupyter:!1})]})})),vt=t(85573),ft=t.n(vt),gt=t(3148),jt="footerWrap___Qaahm",Et=["shixunsDetail","globalSetting","loading","dispatch","onFinish"],bt=R.Z.TextArea,Dt=(0,P.connect)((function(e){var n=e.shixunsDetail,t=e.loading;return{shixunsDetail:n,globalSetting:e.globalSetting,loading:t}}))((function(e){var n=e.shixunsDetail,t=(e.globalSetting,e.loading),i=e.dispatch,s=e.onFinish,a=void 0===s?function(){}:s,l=(r()(e,Et),k.Z.useForm()),_=S()(l,1)[0],o=function(){var e=x()(m()().mark((function e(t){var s,r;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i({type:"shixunsDetail/getCustomScript",payload:{id:null===(s=n.actionTabs.params)||void 0===s?void 0:s.id,compile:t.execute,excutive:t.compile}});case 2:r=e.sent,c(),r&&a(null==r?void 0:r.shixun_script);case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),c=function(){i({type:"shixunsDetail/setActionTabs",payload:{}})};return(0,y.jsx)(E.Z,{centered:!0,title:"自定义模板",open:"Settings-UseCustomScript"===n.actionTabs.key,okText:"确定",cancelText:"取消",footer:null,onCancel:c,children:(0,y.jsxs)(k.Z,{form:_,scrollToFirstError:!0,layout:"vertical",onFinish:o,children:[(0,y.jsx)(k.Z.Item,{name:"execute",label:"执行命令:",rules:[{required:!0,message:"执行命令不能为空"}],children:(0,y.jsx)(bt,{rows:4})}),(0,y.jsx)(k.Z.Item,{name:"compile",label:"编译命令:",children:(0,y.jsx)(bt,{rows:4})}),(0,y.jsx)("div",{className:jt,children:(0,y.jsxs)(k.Z.Item,{children:[(0,y.jsx)(L.ZP,{className:"mr5",size:"middle",onClick:c,children:"取消"}),(0,y.jsx)(L.ZP,{size:"middle",type:"primary",htmlType:"submit",loading:t.effects["shixunsDetail/getCustomScript"],children:"保存"})]})})]})})})),Pt={practice:"practice___g43Av",right:"right___plViv",title:"title___fJJJd",content:"content___Aiv2H",des:"des___kaZig",mainBody:"mainBody___fTSjs",selectBox:"selectBox___omezm",smallType:"smallType___NU4X3",evaluating:"evaluating___YaR_r",evaluatingLabel:"evaluatingLabel___Cy_Vk",mask:"mask___ewIvw",evaluatingS1:"evaluatingS1___oKt4O",serviceSettingWrap:"serviceSettingWrap___Haz9b",serviceBox:"serviceBox___Oc9DS",serviceSetLeft:"serviceSetLeft___ek9V_",serviceSetTip:"serviceSetTip___t8Vpy",btns:"btns___E8bN3",popover:"popover___s3ipd",serverConfig:"serverConfig___tirr2",viewRecommendConfig:"viewRecommendConfig___vFIgu"},yt=We.default.Option,Ot=(0,P.connect)((function(e){return{practiceSetting:e.practiceSetting,globalSetting:e.globalSetting,shixunsDetail:e.shixunsDetail,user:e.user}}))((function(e){var n,t,i=e.practiceSetting,a=e.dispatch,r=e.shixunsDetail,_=(e.user,(0,l.useState)(null)),o=S()(_,2),c=o[0],u=o[1],d=(0,l.useState)([]),p=S()(d,2),h=p[0],v=p[1],f=(0,l.useState)(!0),g=S()(f,2),j=g[0],O=g[1],C=(0,l.useState)({}),M=S()(C,2),T=M[0],A=M[1],I=(0,l.useState)([]),w=S()(I,2),N=w[0],k=w[1],B=(0,l.useState)(),W=S()(B,2),K=W[0],U=W[1],z=(0,l.useState)(),F=S()(z,2),H=F[0],q=F[1],G=(0,l.useState)([]),Y=S()(G,2),Q=Y[0],V=Y[1],X=(0,l.useState)({}),$=S()(X,2),ee=$[0],ne=$[1],te=(0,l.useRef)(null),ie=(0,l.useRef)(!0),se=(0,l.useRef)({activeId:null,selectId:null,serviceConfigList:null,evaluateScript:null,evaluationScript:null}),re=(0,l.useRef)(null),le=(0,l.useState)(!1),_e=S()(le,2),oe=_e[0],ue=_e[1],pe=(0,l.useState)(!1),me=S()(pe,2),he=me[0],xe=me[1],ve=(0,l.useState)({}),fe=S()(ve,2),ge=fe[0],je=fe[1],Ee=i.id,be=i.is_published,De=ee.frequence_image,Pe=void 0===De?[]:De,ye=ee.environments,Oe=void 0===ye?[]:ye,Ce=(ee.choice_small_type,ee.other_image),Me=void 0===Ce?[]:Ce,Se=T.name,Te=T.description,Ae=(T.authorization,T.small_type),Ie=void 0===Ae?[]:Ae;(0,l.useEffect)((function(){null!==c&&(ke(),te.current.scrollTop=0)}),[c]),(0,l.useEffect)((function(){Ee&&Ne()}),[Ee]),(0,l.useEffect)((function(){if(null!==c)return we(),function(){clearTimeout(re.current)}}),[c,h,N,K,H]);var we=function(){clearTimeout(re.current),re.current=setTimeout((function(){(0,J.isEqual)(se.current.activeId,c)&&(0,J.isEqual)(se.current.selectId,h)&&(0,J.isEqual)(se.current.serviceConfigList,N)&&(0,J.isEqual)(se.current.evaluateScript,K)&&(0,J.isEqual)(se.current.evaluationScript,H)?a({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}}):a({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!0}})}),500)},Ne=function(){var e=x()(m()().mark((function e(){var n,t,i,a;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return O(!0),e.next=3,(0,D.ZP)("/api/shixuns/".concat(Ee,"/edit_environment_info.json"),{method:"get"});case 3:0===(n=e.sent).status&&(ne(s()({},n.data)),O(!1),null!=n&&null!==(t=n.data)&&void 0!==t&&t.id?(se.current.activeId=null==n||null===(i=n.data)||void 0===i?void 0:i.id,u(null==n||null===(a=n.data)||void 0===a?void 0:a.id)):u(null));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ke=function(){var e=x()(m()().mark((function e(){var n,t,i,s,a;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,D.ZP)("/api/shixuns/".concat(Ee,"/edit_environment_info.json"),{method:"get",params:{mirror_repository_id:c}});case 2:a=e.sent,A(a.data),se.current.selectId=null===(n=a.data)||void 0===n?void 0:n.choice_small_type,v(null===(t=a.data)||void 0===t?void 0:t.choice_small_type),se.current.serviceConfigList=null===(i=a.data)||void 0===i?void 0:i.shixun_service_configs,k(null===(s=a.data)||void 0===s?void 0:s.shixun_service_configs),se.current.evaluateScript=a.data.evaluate_script,U(a.data.evaluate_script),se.current.evaluationScript=a.data.choice_standard_scripts,q(a.data.choice_standard_scripts),V(a.data.standard_scripts);case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Le=function(){var e=x()(m()().mark((function e(){var n,t=arguments;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.length>0&&void 0!==t[0]&&t[0],!(0,ce.gy)(a,"不能选择/更换实验环境")){e.next=3;break}return e.abrupt("return");case 3:return n={sub_type:h,main_type:c,shixun:{mirror_script_id:H},shixun_info:{evaluate_script:K},shixun_service_configs:N.map((function(e){return{mirror_repository_id:e.mirror_repository_id,cpu_limit:e.cpu_limit,lower_cpu_limit:e.lower_cpu_limit,memory_limit:e.memory_limit,request_limit:e.request_limit,resource_limit:e.resource_limit}}))},e.next=6,(0,D.ZP)("/api/shixuns/".concat(Ee),{method:"put",body:n});case 6:0===e.sent.status&&(b.ZP.success("编辑成功"),se.current={activeId:c,selectId:h,serviceConfigList:N,evaluateScript:K,evaluationScript:H},a({type:"practiceSetting/getCommonData",payload:{id:Ee}}),a({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}}));case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Re=Ie.filter((function(e){return h.includes(e.id)})),Be=function(e,n,t){k((function(i){return i.map((function(i,a){return a===t?s()(s()({},i),{},ft()({},n,e)):i}))}))},Ze=function(){var e=x()(m()().mark((function e(n){var t;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a({type:"shixunsDetail/getScriptContent",payload:{id:Ee,script_id:n}});case 2:(t=e.sent)&&U(t.content);case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,y.jsxs)("div",{className:Pt.practice,children:[(0,y.jsx)(He.Z,{loading:j,skin:"night",className:Pt.left,dispatch:a,value:c,data:Oe,otherData:Me,tags:Pe,onChange:function(e){return u(e)},onSearchWord:function(){}}),(0,y.jsxs)("div",{className:Pt.right,children:[(0,y.jsx)("header",{children:(0,y.jsxs)("div",{className:Pt.title,children:["实验环境: ",null===c?"— —":Se]})}),(0,y.jsxs)("div",{className:Pt.content,ref:te,children:[null===c&&(0,y.jsx)(de.Z,{image:Fe,description:"请选择实验环境"}),null!==c&&(0,y.jsxs)("div",{className:Pt.des,children:[(0,y.jsx)("div",{className:Pt.mainBody,children:(0,y.jsx)(ae.Z,{value:Te})}),(0,y.jsx)("div",{className:Pt.title,children:"附带环境"}),(0,y.jsxs)("div",{className:Pt.selectBox,children:[(0,y.jsx)(We.default,{onChange:function(e,n){return function(e,n){var t=N[0]?[N[0]]:[];n.forEach((function(e){var n=N.find((function(n){return n.mirror_repository_id===Number(e.key)}));if(n)t.push(n);else{var i=Ie.find((function(n){return n.id===Number(e.key)}));if(i.mirror_name){var s={cpu_limit:1,lower_cpu_limit:.1,memory_limit:1,mirror_repository_id:Number(e.key),name:i.mirror_name,request_limit:10};t.push(s)}}})),k(t),v(e)}(e,n)},getPopupContainer:function(e){return e.parentNode},mode:"multiple",bordered:!1,value:h,optionFilterProp:"children",placeholder:"请选择附带环境",style:{width:400},maxTagCount:6,children:Ie.map((function(e,n){return(0,y.jsx)(yt,{value:e.id,children:e.type_name},e.id)}))}),(0,y.jsx)("div",{className:Pt.smallType,children:Re.map((function(e){return e.description?(0,y.jsx)("span",{children:e.description},e.id):null}))})]}),!(null!=r&&null!==(n=r.detail)&&void 0!==n&&n.is_jupyter_lab)&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{className:Pt.title,children:"评测脚本"}),(0,y.jsxs)("div",{className:Pt.evaluating,children:[(0,y.jsxs)("div",{className:Pt.evaluatingLabel,children:[be&&(0,y.jsx)("div",{onClick:function(){(0,ce.gy)(a,"不能选择/更换实验环境")},className:Pt.mask}),(0,y.jsx)(We.default,{style:{width:400},bordered:!1,getPopupContainer:function(e){return e.parentNode},value:H,placeholder:"请选择评测脚本",onChange:function(e){!function(e){var n;E.Z.confirm({centered:!0,title:"提示",okText:"确定",cancelText:"取消",content:(0,y.jsxs)("div",{className:"tc font16",children:["原有脚本将被新的脚本覆盖,无法撤销",(0,y.jsx)("br",{}),"是否确认执行覆盖操作"]}),onOk:(n=x()(m()().mark((function n(){return m()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Ze(e);case 2:E.Z.info({centered:!0,title:"提示",okText:"知道啦",content:(0,y.jsx)("div",{className:"tc font16",children:"评测脚本生成成功!"})});case 3:case"end":return n.stop()}}),n)}))),function(){return n.apply(this,arguments)})})}(e),q(e)},children:(Q||[]).map((function(e,n){return(0,y.jsx)(yt,{value:parseInt(e.id),name:e.scptname,children:e.scptname},n)}))}),(0,y.jsx)("span",{className:Pt.evaluatingS1,onClick:function(){(0,ce.gy)(a,"不能选择/更换实验环境")||a({type:"shixunsDetail/setActionTabs",payload:{key:"Settings-UseCustomScript",params:{id:Ee}}})},children:"使用自定义脚本"}),(0,y.jsx)(Dn.Z,{overlayClassName:Pt.popover,placement:"bottomLeft",content:(0,y.jsxs)("p",{className:"font12",children:["使用自定义模板,平台无法自动更新脚本,请在关卡创建完后手动更新脚本中的必填参",(0,y.jsx)("br",{}),"数和以下2个数组元素",(0,y.jsx)("br",{}),"challengeProgramNames",(0,y.jsx)("br",{}),"sourceClassNames",(0,y.jsx)("br",{}),(0,y.jsx)("br",{}),"示例有2个关卡的实训",(0,y.jsx)("br",{}),(0,y.jsx)("br",{}),"各关卡的待编译文件为:",(0,y.jsx)("br",{}),"src/step1/HelloWorld.java",(0,y.jsx)("br",{}),"src/step2/Other.java",(0,y.jsx)("br",{}),(0,y.jsx)("br",{}),"各关卡的编译后生成的执行文件为:",(0,y.jsx)("br",{}),"step1.HelloWorld",(0,y.jsx)("br",{}),"step2.Other",(0,y.jsx)("br",{}),(0,y.jsx)("br",{}),"则数组元素更新如下:",(0,y.jsx)("br",{}),'ff challengeProgramNames=("src/step1/',(0,y.jsx)("br",{}),'HelloWorld.java" "src/step2/Other.java")',(0,y.jsx)("br",{}),'sourceClassNames=("step1.HelloWorld',(0,y.jsx)("br",{}),'" "step2.Other")',(0,y.jsx)("br",{}),(0,y.jsx)("br",{}),"其它参数可按实际需求定制"]}),trigger:"click",children:(0,y.jsx)("span",{style:{marginTop:"2px"},className:"ml10 current font14",children:(0,y.jsx)(gt.Z,{})})})]}),(0,y.jsx)(On.ZP,{width:"90%",height:450,style:{border:"1px solid #ccc",background:"#f5f5f5",marginTop:"20px"},language:"shell",theme:"vs-light",value:K,onChange:function(e){ie.current?ie.current=!1:(U(e),(0,ce.gy)(a,"不能选择/更换实验环境")&&setTimeout((function(){ie.current=!0,U(se.current.evaluateScript)}),200))}})]})]}),(null===(t=r.detail)||void 0===t?void 0:t.identity)<3&&!!N.length&&(0,y.jsxs)(l.Fragment,{children:[(0,y.jsx)("div",{className:Pt.title,children:"资源配置"}),(0,y.jsx)("div",{className:Pt.serviceSettingWrap,children:null==N?void 0:N.map((function(e,n){return(0,y.jsxs)("div",{className:"mb30",children:[(0,y.jsx)("div",{className:"mb20",children:(0,y.jsx)("span",{className:"font16",children:e.name})}),(0,y.jsx)("div",{style:{color:"#333",marginBottom:4},children:"CPU和内存"}),(0,y.jsxs)(Z.Z,{align:"middle",children:[(0,y.jsx)(Z.Z,{align:"middle",wrap:!1,children:(0,y.jsxs)("div",{className:Pt.serverConfig,style:be?{color:"rgba(0, 0, 0, 0.25)",cursor:"not-allowed"}:{},onClick:function(){be||(je({index:n,cpu:null==e?void 0:e.cpu_limit,memory:null==e?void 0:e.memory_limit}),ue(!0))},children:[(0,y.jsxs)("div",{children:[(0,y.jsxs)("span",{children:[null==e?void 0:e.cpu_limit,"核"]})," ",(0,y.jsxs)("span",{children:[null==e?void 0:e.memory_limit,"GB"]})]}),(0,y.jsx)("i",{className:"iconfont icon-bianji21",style:be?{color:"rgba(0, 0, 0, 0.25)",cursor:"not-allowed"}:{}})]})}),(0,y.jsx)(Z.Z,{align:"middle",wrap:!1,children:(0,y.jsx)("div",{className:Pt.viewRecommendConfig,onClick:function(){return xe(!0)},children:"查看推荐配置"})})]}),(0,y.jsxs)("div",{className:Pt.serviceBox,children:[(0,y.jsx)("div",{className:Pt.serviceSetLeft,children:"文件大小限制"}),(0,y.jsx)(R.Z,{value:e.resource_limit,style:{width:400,height:50},disabled:be,maxLength:5,onChange:function(e){e.target.value.match(/^\d*(\.\d*)?$/)&&Be(e.target.value,"resource_limit",n)},addonAfter:"M"}),(0,y.jsx)("label",{className:Pt.serviceSetTip,children:"File size limit参数表示单个文件上传的大小限制"})]})]},n)}))})]})]})]}),(0,y.jsxs)("div",{className:Pt.btns,children:[(0,y.jsx)(L.ZP,{size:"middle",style:{marginRight:20},onClick:function(){var e,n;n=function(){P.history.push("/shixuns/".concat(Ee,"/challenges")),a({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})},null!=i&&null!==(e=i.sideBar)&&void 0!==e&&e.confirmLeave?E.Z.confirm({title:"离开此页提示",content:"系统可能不会保存您所做的更改。",okText:"离开",cancelText:"取消",onOk:function(){n()}}):n()},children:"取消"}),(0,y.jsx)(L.ZP,{size:"middle",type:"primary",disabled:null===c,onClick:function(){return Le()},children:"保存"})]})]}),(0,y.jsx)(nn.Z,{}),(0,y.jsx)(Dt,{onFinish:function(e){return U(e)}}),(0,y.jsx)(tn.Z,{}),(0,y.jsx)(pt.Z,{visible:oe,onOk:function(e){return function(e){Be(String(null==e?void 0:e.cpu),"cpu_limit",e.index),Be(String(null==e?void 0:e.memory),"memory_limit",e.index),ue(!1)}(e)},onCancel:function(){return ue(!1)},info:ge}),(0,y.jsx)(mt.Z,{identifier:Ee,visible:he,onCancel:function(){return xe(!1)},info:null,isJupyter:!0})]})})),Ct=(0,P.connect)((function(e){return{shixunsDetail:e.shixunsDetail}}))((function(e){var n,t,i,s,a=e.shixunsDetail,r=(0,l.useState)(!0),_=S()(r,2),o=_[0],c=_[1];return(0,l.useEffect)((function(){var e;"boolean"==typeof(null==a||null===(e=a.detail)||void 0===e?void 0:e.is_jupyter_lab)&&o&&c(!1)}),[null==a||null===(n=a.detail)||void 0===n?void 0:n.is_jupyter_lab,o]),console.log(null==a||null===(t=a.detail)||void 0===t?void 0:t.is_jupyter_lab,o),(0,y.jsxs)(xe.Z,{loading:o,active:!0,children:[!1===(null==a||null===(i=a.detail)||void 0===i?void 0:i.is_jupyter_lab)&&(0,y.jsx)(xt,{}),!0===(null==a||null===(s=a.detail)||void 0===s?void 0:s.is_jupyter_lab)&&(0,y.jsx)(Ot,{})]})})),Mt=t(51945),St=t(56102),Tt="dataset___dSWAV",At="header___BzxI4",It="title___cPEyN",wt="dataPath___wJ6mR",Nt="pathTitle___TOS2Z",kt="btns___jGE8o",Lt="content___s4ep8",Rt="customTable___OG3_9",Bt="row___ONd7r",Zt="empty___CgtTE",Wt="path___Cg5rX",Kt="text___SCLRV",Ut="actionsBtns___L5tdC",zt="shareModal___HedYo",Ft="fileName___x56US",Ht="renameModal___SmCAd",qt="errorDes___VLR_5",Gt="uploadFileModal___pYYDB",Yt="selectBtn___m_hrR",Qt="leftButton___F0fvG",Jt="rightButton___oCK81",Vt="centerText___jpgrt",Xt="wrap___EmsVa",$t="colorBlue___XqtfP",ei="repeatedName___yMQsm",ni=t(86054),ti=K.Z.Dragger,ii=function(e){e.dispatch;var n,t=e.id,i=e.onClose,a=e.onOK,r=e.visible,_=(e.wrapClassName,e.local),o=e.containerId,c=e.rootIdentifier,u=(0,l.useState)({}),d=S()(u,2),p=d[0],h=d[1],v=(0,l.useState)([]),g=S()(v,2),j=g[0],P=g[1],O=(0,l.useState)([]),C=S()(O,2),M=C[0],T=C[1],A=(0,l.useState)(0),I=S()(A,2),w=I[0],N=I[1],L=(0,l.useState)(!1),B=S()(L,2),Z=B[0],W=B[1],K=(0,l.useState)(!1),U=S()(K,2),z=U[0],H=U[1],q=k.Z.useForm(),G=S()(q,1)[0],Y=(0,l.useState)([]),Q=S()(Y,2),J=Q[0],X=Q[1],$=(0,l.useRef)([]);(0,l.useEffect)((function(){r&&(G.resetFields(),X([]),T([]),P([]),N(0),H(!1),W(!1))}),[r]);var ee=function(){var e=x()(m()().mark((function e(n){var i,s;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(w){e.next=8;break}return s=J.filter((function(e){return e.uid!==n.uid})),X(s),$.current=F()(s),P(j.filter((function(e){return e!==n.name}))),b.ZP.info("删除成功"),s.length||(G.setFieldsValue({file:void 0}),G.validateFields()),e.abrupt("return");case 8:if(n.response){e.next=11;break}return b.ZP.info("还未上传完成,无法进行删除操作!"),e.abrupt("return");case 11:return e.next=13,(0,D.ZP)("/api/shixuns/".concat(t,"/destroy_data_sets.json"),{method:"Delete",body:{id:[null==n||null===(i=n.response)||void 0===i?void 0:i.id]}});case 13:0===e.sent.status&&(X(J.filter((function(e){return e.uid!==n.uid}))),b.ZP.info("删除成功"));case 15:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),ne={height:300,multiple:!0,disabled:w>0,withCredentials:!0,fileList:J,action:"".concat(V.Z.API_SERVER,"/api/attachments.json"),onChange:function(e){if("done"===e.file.status||"uploading"===e.file.status){var n,t,i;if(X(e.fileList),!e.file.response)return;if(null!==(n=e.file.response)&&void 0!==n&&n.id)return void b.ZP.success("上传成功!");X(J.filter((function(n){return n.uid!==e.file.uid}))),(null===(t=e.file.response)||void 0===t?void 0:t.message)&&b.ZP.info(null===(i=e.file.response)||void 0===i?void 0:i.message)}},onRemove:ee,beforeUpload:function(e){if(null!=J&&J.some((function(n){return n.name===e.name})))return b.ZP.info("".concat(e.name,"文件已存在")),!1;if(e.size/1024/1024>500)return b.ZP.info("文件超过500M不符合上传要求"),!1;var n={name:e.name,uid:e.uid,file:e,percent:0};return J.push(n),$.current=F()(J),X(F()(J)),!1}},te=function(e,n,t,i,s){var a=new FormData;Object.keys(e).forEach((function(n){a.append(n,e[n])}));var r=new window.XMLHttpRequest;return r.withCredentials=!0,r.addEventListener("load",(function(e){var n;t(JSON.parse(null==e||null===(n=e.target)||void 0===n?void 0:n.response))}),!1),r.addEventListener("error",(function(e){s&&s(e)}),!1),r.upload.onprogress=function(e){i&&i(e)},r.open("POST",n),r.send(a),r},ie=function(e,n){if(e.lengthComputable){var t=Math.floor(e.loaded/e.total*100),i=s()(s()({},n),{},{percent:t,status:100===t?"done":"uploading"});console.log($.current,333),$.current=$.current.map((function(e){return e.uid===n.uid?i:e})),X($.current)}},se=function(e,n){var t=s()(s()({},n),{},{status:"error"});b.ZP.warning("上传失败,请重新尝试"),$.current=$.current.map((function(e){return e.uid===n.uid?t:e})),$.current.every((function(e){return"done"===e.status||"error"===e.status}))&&(H(!1),N(2)),X($.current)},ae=function(e,n){var t=s()(s()({},n),{},{status:"done"});if(0===e.status||(t=s()(s()({},n),{},{status:"error"}),b.ZP.error("上传失败!")),$.current=$.current.map((function(e){return e.uid===n.uid?t:e})),$.current.every((function(e){return"done"===e.status})))return b.ZP.success("上传完成!"),void _e(!0);$.current.every((function(e){return"done"===e.status||"error"===e.status}))&&(H(!1),N(2)),X($.current)},re=function(){var e=x()(m()().mark((function e(n){var i,s,a,r,l,o,c;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(H(!0),3!==w){e.next=4;break}return N(2),e.abrupt("return");case 4:if(2!==w&&1!==w){e.next=7;break}return le(),e.abrupt("return");case 7:if(s=(i=n||{}).commitMessage,a=void 0===s?"":s,r=i.fileOss,l=void 0===r?[]:r,!((o=(_?J:l).map((function(e){return e.name}))).filter((function(e){return-1!=e.indexOf("、")||-1!=e.indexOf(" ")})).length>0)){e.next=14;break}return b.ZP.info("数据集名称禁止有空格与、"),H(!1),e.abrupt("return");case 14:return e.next=16,(0,D.ZP)("/api/shixuns/".concat(t,"/check_data_sets"),{method:"post",body:{files_name:o}});case 16:if(-3!==(c=e.sent).status){e.next=21;break}return P(null==c?void 0:c.exist_files),H(!1),e.abrupt("return");case 21:if("{}"!==JSON.stringify(c)){e.next=25;break}return H(!1),b.ZP.error("网络已断开,请稍后重试!"),e.abrupt("return");case 25:0===c.status&&(J.forEach((function(e){var n=te({file:e.file,description:a},"".concat(V.Z.API_SERVER,"/api/shixuns/").concat(t,"/upload_data_sets.json"),(function(n){return ae(n,e)}),(function(n){return ie(n,e)}),(function(n){return se(0,e)}));M.push(n)})),N(1));case 26:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),le=function(){var e=(s()({},G.getFieldsValue())||{}).commitMessage,n=void 0===e?"":e,i=$.current.filter((function(e){return"error"===e.status})),a=$.current.map((function(e){return s()(s()({},e),{},{status:"error"===e.status?"uploading":e.status})}));X(a),i.forEach((function(e){var i=te({file:e.file,description:n},"".concat(V.Z.API_SERVER,"/api/shixuns/").concat(t,"/upload_data_sets.json"),(function(n){return ae(n,e)}),(function(n){return ie(n,e)}),(function(n){return se(0,e)}));M.push(i)}))},_e=function(e){e||(W(!0),M.forEach((function(e){e.abort()}))),a(),i()},oe=function(){return(0,y.jsxs)(l.Fragment,{children:[(0,y.jsx)("div",{children:(0,y.jsx)("i",{className:"iconfont icon-shangchuan font50 ".concat($t)})}),(0,y.jsxs)("div",{className:"font14 mt30",children:["拖拽文件或",(0,y.jsx)("span",{className:"".concat($t," ml5"),children:"点击此处上传"})]})]})};return(0,y.jsx)(E.Z,{open:r,onOk:function(){(0,f.L9)(["实践项目","设置","数据集","上传文件"]),G.submit()},centered:!0,okText:0===w?"确定":1===w?"上传中":"重新上传",okButtonProps:{loading:z},onCancel:function(){var e=(s()({},G.getFieldsValue())||{}).fileOss,n=void 0===e?[]:e,t=null==J?void 0:J.every((function(e){return"done"===e.status})),i=null==n?void 0:n.every((function(e){return"done"===e.status}));t&&i?_e():E.Z.confirm({title:"关闭弹框提示",content:"有文件未上传,是否确定离开?",okText:"离开",cancelText:"取消",onOk:function(){_e()}})},width:"1000px",title:"上传文件",children:(0,y.jsx)("div",{className:Xt,children:(0,y.jsxs)(k.Z,{className:"mt10",form:G,scrollToFirstError:!0,layout:"vertical",onFinish:re,onValuesChange:function(e){if(console.log(e,"changedValues"),"fileOss"in e){var n,t;if(null!=e&&e.fileOss.every((function(e){return"done"===e.status}))&&null!=e&&null!==(n=e.fileOss)&&void 0!==n&&n.length)return b.ZP.success("上传完成!"),void _e(!0);if(null!=e&&e.fileOss.every((function(e){return"done"===e.status||"error"===e.status}))&&null!=e&&null!==(t=e.fileOss)&&void 0!==t&&t.length)return N(3),void H(!1);P(j.filter((function(n){var t;return null==e||null===(t=e.fileOss)||void 0===t?void 0:t.some((function(e){return e.name===n}))})))}h(s()({},G.getFieldsValue()))},children:[_?(0,y.jsx)(k.Z.Item,{label:(0,y.jsxs)("div",{children:["选择文件 ",(0,y.jsx)("span",{className:"c-light-black",children:"(单个文件不超过500M)"})]}),name:"file",rules:[{required:!0,message:"请选择文件"}],children:(0,y.jsxs)(ti,s()(s()({},ne),{},{children:[" ",oe()]}))}):(0,y.jsx)(k.Z.Item,{label:(0,y.jsxs)("div",{children:["选择文件 ",(0,y.jsx)("span",{className:"c-light-black",children:"(单个文件不超过100GB)"})]}),name:"fileOss",rules:[{required:!0,message:"请选择文件"}],children:(0,y.jsx)(ni.ZP,{identifier:c,cancelUpload:Z,container_type:"Shixun",container_id:o,uploading:w<3?w:0,disabled:w>0,height:300,maxSize:107374182400,description:p.commitMessage||"",text:oe(),onComplete:function(e){console.log(e,444)},realFileName:!0})}),!!j.length&&(0,y.jsxs)("span",{className:ei,children:[j.join("、"),"已存在,请删除后再上传"]}),(0,y.jsx)(k.Z.Item,{name:"commitMessage",label:"备注:",rules:[{whitespace:!0,message:"请勿输入空格"}],children:(0,y.jsx)(R.Z,{bordered:!1,disabled:w>0,maxLength:100,suffix:"".concat((null===(n=p.commitMessage)||void 0===n?void 0:n.length)||0,"/100"),placeholder:"请填写备注信息"})})]})})})},si=t(81841),ai=t(99089),ri=t(65356),li=["globalSetting","dispatch","practiceSetting","shixunsDetail","user"],_i=(l.Fragment,Me.Z.TabPane,(0,P.connect)((function(e){var n=e.globalSetting,t=e.shixunsDetail,i=e.practiceSetting;return{globalSetting:n,shixunsDetail:t,user:e.user,practiceSetting:i}}))((function(e){var n,t,i,a,_,o,c=e.globalSetting,u=e.dispatch,d=e.practiceSetting,p=e.shixunsDetail,h=e.user,v=(r()(e,li),d.id),g=(0,l.useState)([]),j=S()(g,2),O=j[0],C=j[1],M=(0,l.useState)({}),T=S()(M,2),A=T[0],I=T[1],w=(0,l.useState)([]),N=S()(w,2),k=(N[0],N[1],(0,l.useState)(!1)),B=S()(k,2),Z=B[0],W=B[1],K=(0,l.useState)(!0),U=S()(K,2),z=U[0],H=U[1],q=(0,l.useState)(!1),G=S()(q,2),Y=G[0],Q=G[1],V=(0,l.useState)(!1),X=S()(V,2),$=X[0],ee=X[1],ne=(0,l.useState)(!1),te=S()(ne,2),ie=te[0],se=te[1],ae=(0,l.useState)(!1),re=S()(ae,2),le=re[0],_e=re[1],oe=(0,l.useState)("all"),ce=S()(oe,2),ue=ce[0],de=ce[1],pe=(0,l.useState)([]),me=S()(pe,2),he=me[0],ge=me[1],je=(0,l.useState)([]),Ee=S()(je,2),be=Ee[0],De=Ee[1],Pe=(0,l.useState)(!1),ye=S()(Pe,2),Oe=ye[0],Ce=ye[1],Me=(0,l.useState)({}),Se=S()(Me,2),Te=Se[0],Ae=Se[1],Ie=(0,l.useState)(!1),we=S()(Ie,2),Ne=we[0],ke=we[1],Le=(0,l.useState)([]),Re=S()(Le,2),Be=Re[0],Ze=Re[1],We=(0,l.useState)({page:1,limit:10,total:0}),Ue=S()(We,2),ze=Ue[0],Fe=Ue[1],He=(0,l.useState)({page:1,limit:10,search:"",order:"mine"}),qe=S()(He,2);qe[0],qe[1];(0,l.useEffect)((function(){v&&Ge()}),[v]);var Ge=function(){var e=x()(m()().mark((function e(n){var t,i,a;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={page:1,limit:10,total:0},i=n||t,W(!0),e.next=5,u({type:"shixunsDetail/getSetData",payload:s()(s()({},i),{},{id:v})});case 5:null!=(a=e.sent)&&a.data_sets&&(W(!1),C(F()(a.data_sets)),Fe(s()(s()({},i),{},{total:null==a?void 0:a.data_sets_count})),H(!1),I(s()({},a)));case 7:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),Ye={selectedRowKeys:be,columnWidth:70,onChange:function(e){console.log("selectedRowKeys changed: ",e),De(e)}},Qe=function(e){(0,f.L9)(["实践项目","设置","数据集","删除"]);var n,t=e?[e]:be;E.Z.confirm({centered:!0,title:"确定要删除文件吗?",okText:"确定",cancelText:"取消",onOk:(n=x()(m()().mark((function e(){var n;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,D.ZP)("/api/shixuns/".concat(v,"/destroy_data_sets.json"),{method:"Delete",body:{id:t}});case 2:0===e.sent.status&&(n=t.length===O.length&&ze.page>1?ze.page-1:ze.page,b.ZP.success("删除成功"),Ge(s()(s()({},ze),{},{page:n})),De([]));case 4:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})})},Je=function(){var e=x()(m()().mark((function e(){var n,t,i,a;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=Te.title,t=null,console.log(n,"title"),""!==n){e.next=7;break}return t="文件名不能为空",Ae(s()(s()({},Te),{},{errorDes:t})),e.abrupt("return");case 7:if(!n.includes(" ")){e.next=11;break}return t="文件名不能有空格",Ae(s()(s()({},Te),{},{errorDes:t})),e.abrupt("return");case 11:if(i=O.find((function(e){return e.id===(null==Te?void 0:Te.id)})).title,n!==i.substring(0,i.lastIndexOf("."))&&n!==i){e.next=16;break}return t="文件名不能重名",Ae(s()(s()({},Te),{},{errorDes:t})),e.abrupt("return");case 16:return a=i.includes(".")?i.substring(i.lastIndexOf("."),i.length):"",e.next=19,(0,D.ZP)("/api/shixuns/".concat(v,"/rename_data_sets.json"),{method:"post",body:{id:null==Te?void 0:Te.id,new_file_name:n+a}});case 19:0===e.sent.status&&(b.ZP.success("重命名成功"),Ge(ze),Q(!1),Ae({}));case 21:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ve=function(e){var n=e,t=document.createElement("input");t.value=n,document.body.appendChild(t),t.select(),document.execCommand("Copy"),t.style.display="none"},Xe=[{title:"文件",dataIndex:"title",key:"title",align:"left",ellipsis:!0,render:function(e){return(0,y.jsx)(Ke.Z,{title:e,children:(0,y.jsx)("span",{children:e})})}},{title:"数据集来源",dataIndex:"data_set_title",key:"data_set_title",align:"left",ellipsis:!0,render:function(e,n){return null!=n&&n.data_set_id?(0,y.jsx)(Ke.Z,{title:e,children:(0,y.jsx)("span",{style:{color:"#0152d9",cursor:"pointer"},onClick:function(){(0,f.xg)("/dataset/".concat(null==n?void 0:n.data_set_id,"/detail?tabId=public"))},children:e})}):"--"}},{title:"备注",dataIndex:"description",key:"description",align:"left",ellipsis:!0,render:function(e){return(0,y.jsx)(Ke.Z,{title:e,children:(0,y.jsx)("span",{children:e||"--"})})}},{title:"创建时间",dataIndex:"created_on",key:"created_on",align:"left",width:180,render:function(e,n){return wn()(n.created_on).format("YYYY-MM-DD HH:mm")}},{title:"文件路径",dataIndex:"file_path",key:"file_path",align:"left",render:function(e,n){return(0,y.jsxs)("div",{className:Wt,children:[(0,y.jsx)(Ke.Z,{title:e,children:(0,y.jsx)("span",{className:Kt,children:e})}),(0,y.jsx)(St.CopyToClipboard,{text:e,onCopy:function(){return b.ZP.success("复制成功")},children:(0,y.jsx)(Ke.Z,{title:"复制",children:(0,y.jsx)("i",{className:"iconfont icon-fuzhi6 ml5"})})})]})}},{title:"最后修改人",dataIndex:"author",key:"author",align:"left",width:120},{title:"文件大小",dataIndex:"filesize",key:"filesize",align:"left",width:100},{title:"操作",dataIndex:"operation",key:"operation",align:"left",width:200,render:function(e,n){return(0,y.jsxs)("div",{className:Ut,children:[(0,y.jsx)(Ke.Z,{title:"重命名",children:(0,y.jsx)("span",{className:"iconfont icon-zhongmingming",onClick:function(){var e;Ae((0,J.clone)(s()(s()({},n),{},{title:null!=n&&n.title.includes(".")?null==n||null===(e=n.title)||void 0===e?void 0:e.substring(0,n.title.lastIndexOf(".")):null==n?void 0:n.title}))),Q(!0),(0,f.L9)(["实践项目","设置","数据集","重命名"])}})}),(0,y.jsx)(Ke.Z,{title:"分享",children:(0,y.jsx)("span",{className:"iconfont icon-fenxiang",onClick:function(){(0,f.L9)(["实践项目","设置","数据集","分享"]),Ae((0,J.clone)(n)),ee(!0)}})}),(0,y.jsx)(Ke.Z,{title:"下载",children:(0,y.jsx)("span",{className:"iconfont icon-xiazai3",onClick:function(){(0,f.L9)(["实践项目","设置","数据集","下载"]),(0,f.Nd)(n.title,null==n?void 0:n.download_url)}})}),(0,y.jsx)(Ke.Z,{title:"同步到个人数据集中",children:(0,y.jsx)("span",{className:"iconfont icon-tongbushuju",onClick:function(){(0,f.L9)(["实践项目","设置","数据集","同步"]),_e(!0),Ze([n]),ge([n.id])}})}),(0,y.jsx)(Ke.Z,{title:"删除",children:(0,y.jsx)("span",{className:"iconfont icon-shanchu8",onClick:function(){(0,f.L9)(["实践项目","设置","数据集","删除"]),Qe(n.id)}})})]})}}];return(0,y.jsxs)("div",{className:Tt,children:[(0,y.jsxs)("div",{className:At,children:[(0,y.jsxs)("div",{className:It,children:["数据集(",ze.total,")"]}),(0,y.jsxs)("div",{className:wt,children:[(0,y.jsx)("span",{className:Nt,children:"数据集路径:"}),(0,y.jsx)("input",{value:null==A?void 0:A.folder_name,disabled:!0}),(0,y.jsx)(St.CopyToClipboard,{text:null==A?void 0:A.folder_name,onCopy:function(){return b.ZP.success("复制成功")},children:(0,y.jsx)(Ke.Z,{placement:"topLeft",title:"点击复制数据集路径",children:(0,y.jsx)("i",{className:"iconfont icon-fuzhi2 current ml5 mr40"})})})]}),(0,y.jsxs)("div",{className:kt,children:[(0,y.jsx)(L.ZP,{type:"primary",ghost:!0,onClick:function(){return Qe()},disabled:!be.length,style:{width:"60px"},children:"删除"}),(0,y.jsx)(L.ZP,{type:"primary",className:"ml10",style:{width:"60px"},ghost:!0,onClick:function(){_e(!0),ge(be),Ze(O.filter((function(e){return be.includes(e.id)})))},disabled:!be.length,children:"同步"}),(0,y.jsx)(ve.Z,{className:"ml10",disabled:2===(null==h||null===(n=h.userInfo)||void 0===n?void 0:n.user_status),dropdownRender:function(){return(0,y.jsxs)(fe.Z,{children:[(0,y.jsx)(fe.Z.Item,{onClick:function(){Ce(!0)},children:"上传数据集"},1),(0,y.jsx)(fe.Z.Item,{onClick:function(){se(!0),de("all")},children:"选择数据集"},2)]})},children:(0,y.jsx)("span",{className:Yt,children:(0,y.jsx)("span",{children:"增加数据集"})})})]})]}),(0,y.jsx)("div",{className:Lt,children:(0,y.jsx)(xe.Z,{loading:z,active:!0,paragraph:{rows:5},children:ze.total?(0,y.jsx)(Mt.Z,{rowSelection:Ye,className:Rt,dataSource:O,bordered:!1,rowKey:function(e){return e.id},rowClassName:Bt,columns:Xe,loading:Z,pagination:{pageSize:ze.limit,total:ze.total,current:ze.page,onChange:function(e){var n=s()(s()({},ze),{},{page:e});De([]),Fe(n),Ge(n)},showQuickJumper:!0,hideOnSinglePage:!0,position:["bottomCenter"]}}):(0,y.jsxs)("div",{className:Zt,children:[(0,y.jsx)("img",{src:si.x7,width:"258"}),(0,y.jsx)("span",{className:"c-grey-c",children:"暂无数据集文件~"})]})})}),(0,y.jsx)(ii,{rootIdentifier:null==p||null===(t=p.detail)||void 0===t?void 0:t.root_identifier,wrapClassName:Gt,id:v,containerId:null==p||null===(i=p.detail)||void 0===i?void 0:i.id,local:null==c||null===(a=c.setting)||void 0===a?void 0:a.is_local,dispatch:u,visible:Oe,onClose:function(){return Ce(!1)},onOK:Ge}),(0,y.jsx)(E.Z,{title:"重命名",open:Y,onOk:Je,centered:!0,wrapClassName:Ht,onCancel:function(){Q(!1),Ae({})},width:"1000px",children:(0,y.jsxs)("div",{children:[(0,y.jsxs)("div",{className:Ft,children:[(0,y.jsx)("sup",{children:"*"}),"文件名 :"]}),(0,y.jsx)(R.Z,{value:null==Te?void 0:Te.title,placeholder:"请输入文件名字",bordered:!1,onChange:function(e){Ae(s()(s()({},Te),{},{title:e.target.value,errorDes:null}))},maxLength:60,suffix:"".concat((null==Te||null===(_=Te.title)||void 0===_?void 0:_.length)||0,"/60")}),(null==Te?void 0:Te.errorDes)&&(0,y.jsx)("div",{className:qt,children:null==Te?void 0:Te.errorDes})]})}),(0,y.jsx)(E.Z,{title:"分享下载链接",open:$,onOk:function(){var e=Te.download_url;Ve(e),b.ZP.success("复制成功"),ee(!1),Ae({})},centered:!0,wrapClassName:zt,onCancel:function(){ee(!1),Ae({})},width:"1000px",okText:"复制链接",children:(0,y.jsxs)("div",{children:[(0,y.jsxs)("div",{className:Ft,children:["发送链接,别人可以通过链接下载文件",(0,y.jsx)("span",{children:"(有效期为3天)"})]}),(0,y.jsx)(R.Z,{bordered:!1,addonBefore:"链接",value:null==Te?void 0:Te.download_url})]})}),(0,y.jsx)(ai.Z,{setVisible:se,visible:ie,recordId:he,type:ue,updateData:Ge,identifier:null===(o=p.detail)||void 0===o?void 0:o.identifier}),(0,y.jsx)(E.Z,{title:"同步到个人数据集",open:le,width:400,centered:!0,keyboard:!1,onCancel:function(){return _e(!1)},maskClosable:!1,footer:(0,y.jsxs)("div",{style:{display:"flex",justifyContent:"center"},children:[(0,y.jsx)("div",{className:Qt,onClick:function(){ke(!0)},children:"生成新的数据集"}),(0,y.jsx)("div",{className:Jt,onClick:function(){_e(!1),se(!0),de("my")},children:"发送到已有数据集中"})]}),children:(0,y.jsx)("div",{className:Vt,children:"将该数据集文件同步到个人数据集中,请选择同步方式:"})}),(0,y.jsx)(ri.Z,{visible:Ne,attachmentInfo:Be,onClose:function(){return ke(!1)},onSuccess:function(e){ke(!1),P.history.push("/dataset/".concat(e,"/detail?tabId=mine"))}})]})}))),oi=t(31797),ci="wrap___VIvSS",ui="content___pqoZT",di="mainPathWrap___v3uSU",pi="colorBlue___AjQlz",mi=function(e){return null!=e&&e.length?e.filter((function(e,n){return 0!==n})).map((function(e){return e.val})).join("").substr(1):""},hi=(0,P.connect)((function(e){var n=e.shixunsDetail,t=e.loading;return{shixunsDetail:n,globalSetting:e.globalSetting,loading:t.models.index}}))((function(e){var n=e.shixunsDetail,t=(e.globalSetting,e.loading,e.dispatch),i=e.fileType,a=e.path,r=e.onFinish,_=void 0===r?function(){}:r,o=(0,P.useParams)(),c=(0,l.useState)(""),u=S()(c,2),d=u[0],p=u[1],h=(0,l.useState)([]),v=S()(h,2),f=v[0],g=v[1],j=(0,l.useState)([]),D=S()(j,2),O=D[0],C=D[1],M=[Pi.OriginalPicturePath,Pi.ExpectPicturePath,Pi.PicturePath].includes(i);(0,l.useEffect)((function(){"EditPracticeSetting-SelectFilePath"===n.actionTabs.key&&(p(a||""),T())}),[n.actionTabs.key]);var T=function(){var e=x()(m()().mark((function e(){var n,i,a,r,l=arguments;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=l.length>0&&void 0!==l[0]?l[0]:"",e.next=3,t({type:"shixunsDetail/getRepository",payload:{id:o.id,path:i}});case 3:a=e.sent,""!==i||null!=a&&null!==(n=a.trees)&&void 0!==n&&n.length||b.ZP.warning("请先去代码仓库提交文件"),null!=a&&a.trees&&(r=a.trees.map((function(e){return s()(s()({},e),{name:e.name,val:e.name})})),C(r||[]));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),A=function(){var e=x()(m()().mark((function e(){return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:_(d),I();case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),I=function(){p(""),g([]),C([]),t({type:"shixunsDetail/setActionTabs",payload:{}})},w=mi(f);return(0,y.jsx)(E.Z,{centered:!0,title:"文件路径",closable:!1,keyboard:!1,open:"EditPracticeSetting-SelectFilePath"===n.actionTabs.key,onOk:A,onCancel:I,children:(0,y.jsxs)("div",{className:ci,children:[(0,y.jsxs)("div",{className:ui,children:[(0,y.jsx)("div",{className:di,children:!(null==f||!f.length)&&f.map((function(e,n){return(0,y.jsx)("a",{onClick:function(){return function(e,n){var t=f.filter((function(e,t){return t<=n}));g(t);var i=mi(t);M&&p(i),T(i)}(0,n)},children:e.val},n)}))}),!(null==O||!O.length)&&O.map((function(e,n){return"tree"===e.type?(0,y.jsxs)("a",{onClick:function(){return function(e){if("tree"===e.type){f.length?f.push({val:"/".concat(e.val),path:e.val}):f.push({val:"根目录",path:""},{val:"/".concat(e.val),path:e.val}),g(f);var n=mi(f);M&&p(n),T(n)}}(e)},children:[(0,y.jsx)("i",{className:"iconfont icon-wenjianjia ".concat(pi)}),w?"".concat(w,"/"):w,e.name]},n):(0,y.jsxs)("a",{onClick:function(){return function(e){var n=mi(f),t="".concat(n?"".concat(n,"/"):n).concat(e);i===Pi.Path?(null==d||!d.includes("".concat(t,"")))&&p("".concat(d).concat(t,"")):i===Pi.ExecPath&&p(t)}("".concat(e.name))},children:[(0,y.jsx)("i",{className:"iconfont icon-zuoye ".concat(pi)}),w?"".concat(w,"/"):w,e.name]},n)}))]}),(0,y.jsx)("label",{className:"mt5",children:"选中的新建文件夹目录:"}),(0,y.jsx)(R.Z,{placeholder:"请输入新文件夹名/子文件夹名。src/step1",value:d,onChange:function(e){return p(e.target.value)}})]})})})),xi="wrap___AnxZp",vi="fixBtn___sQhsA",fi=t(93524),gi=["shixunsDetail","globalSetting","user","dispatch"],ji=(0,P.connect)((function(e){return{shixunsDetail:e.shixunsDetail,globalSetting:e.globalSetting,user:e.user}}))((function(e){e.shixunsDetail,e.globalSetting,e.user,e.dispatch,r()(e,gi);var n,t=(0,P.useLocation)(),i=(0,l.useRef)(null===(n=t.pathname)||void 0===n||null===(n=n.split("/"))||void 0===n?void 0:n[2]),a=k.Z.useForm(),_=S()(a,1)[0],o=(0,l.useState)(""),c=S()(o,2),u=c[0],d=c[1],p=(0,l.useState)(!1),h=S()(p,2),v=h[0],f=h[1],g=(0,l.useState)(!1),j=S()(g,2),E=j[0],O=j[1];(0,l.useEffect)((function(){i.current&&C()}),[i.current]);var C=function(){var e=x()(m()().mark((function e(){var n;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f(!0),e.next=3,(0,D.ZP)("/api/shixuns/".concat(i.current,"/get_standard_answer.json"),{method:"get",params:{from:"edit"}});case 3:0===(n=e.sent).status&&(d((null==n?void 0:n.standard_answer)||""),_.setFieldsValue({hide_answer:null==n?void 0:n.hide_answer,disable_copy:null==n?void 0:n.disable_copy}),f(!1));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),M=function(){var e=x()(m()().mark((function e(n){return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return O(!0),e.next=3,(0,D.ZP)("/api/shixuns/".concat(i.current,"/set_standard_answer.json"),{method:"post",body:s()({},n)});case 3:0===e.sent.status&&b.ZP.success("保存成功"),O(!1);case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,y.jsx)("section",{className:xi,children:(0,y.jsx)(xe.Z,{loading:v,children:(0,y.jsxs)(k.Z,{form:_,scrollToFirstError:!0,layout:"vertical",onFinish:M,children:[(0,y.jsx)(k.Z.Item,{name:"hide_answer",valuePropName:"checked",children:(0,y.jsx)(U.Z,{children:"隐藏参考答案模块"})}),(0,y.jsx)(k.Z.Item,{name:"disable_copy",valuePropName:"checked",children:(0,y.jsx)(U.Z,{children:"禁止复制参考答案"})}),(0,y.jsx)(k.Z.Item,{name:"standard_answer",label:"参考答案:",rules:[{required:!0,message:"请输入参考答案"}],children:(0,y.jsx)(N.Z,{defaultValue:u})}),(0,y.jsx)(k.Z.Item,{children:(0,y.jsx)(fi.t,{okText:"保存",loading:E,hasCancelBtn:!1,className:vi,okButtonProps:{htmlType:"submit"}})})]})})})})),Ei=t(53200),bi=t(2842),Di=t(63701),Pi=(oi.Z.Countdown,function(e){return e.Path="path",e.ExecPath="exec_path",e.OriginalPicturePath="original_picture_path",e.ExpectPicturePath="expect_picture_path",e.PicturePath="picture_path",e}({})),yi=(0,P.connect)((function(e){var n=e.loading;return{globalSetting:e.globalSetting,loading:n,practiceSetting:e.practiceSetting,shixunsDetail:e.shixunsDetail}}))((function(e){e.globalSetting,e.loading;var n,t=e.dispatch,i=(e.practiceSetting,e.shixunsDetail),a=(0,l.useState)(),r=S()(a,2),_=(r[0],r[1],(0,l.useState)()),o=S()(_,2),c=(o[0],o[1],(0,l.useRef)(),(0,l.useState)()),u=S()(c,2),d=(u[0],u[1],(0,l.useState)()),p=S()(d,2),h=(p[0],p[1],(0,l.useState)(!0)),v=S()(h,2),f=(v[0],v[1],(0,l.useState)(700)),g=S()(f,2),E=(g[0],g[1],(0,l.useState)("")),b=S()(E,2),D=b[0],O=b[1],C=(0,l.useState)("1"),M=S()(C,2),T=M[0],A=M[1],I=(0,P.useParams)();(0,l.useEffect)((function(){w()}),[]);var w=function(){var e=x()(m()().mark((function e(){var n,t,i,s;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,j.Ui)({identifier:I.id});case 2:if(null==(t=e.sent)||null===(n=t.data)||void 0===n||null===(n=n.data_list)||void 0===n||!n.length){e.next=6;break}return Ei.Z.publish("pod-restrict-data",{identifier:null==t||null===(i=t.data)||void 0===i?void 0:i.identifier,data_list:null==t||null===(s=t.data)||void 0===s?void 0:s.data_list}),e.abrupt("return");case 6:null!=t&&t.url&&O(null==t?void 0:t.url);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),N=function(e){t({type:"shixunsDetail/setActionTabs",payload:{key:"EditPracticeSetting-SelectFilePath"}})},k=function(){var e=x()(m()().mark((function e(n){return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,j.QA)({id:I.id,startup_file:n});case 2:w(),t({type:"practiceSetting/getCommonData",payload:s()({},I)});case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,y.jsx)(Me.Z,{activeKey:T,onChange:function(e){return A(e)},tabBarStyle:{paddingLeft:20},items:[{key:"1",label:"服务设置",children:(0,y.jsxs)("div",{children:[(0,y.jsxs)(Z.Z,{className:"mt20 ml20 font14",align:"middle",children:[(0,y.jsxs)(W.Z,{children:[(0,y.jsx)("span",{className:"c-red",children:"* "}),"默认打开文件:"]}),(0,y.jsx)(W.Z,{className:"mr10",children:(0,y.jsx)(Ke.Z,{title:"开启JupyterLab评测功能则默认打开文件同时也作为评测的执行文件。",placement:"bottom",children:(0,y.jsx)(bi.Z,{style:{cursor:"pointer"}})})}),(0,y.jsx)(W.Z,{flex:"300px",onClick:function(){return N(Pi.ExecPath)},children:(0,y.jsx)(R.Z,{value:D})}),(0,y.jsx)(W.Z,{flex:"1",children:(0,y.jsx)(L.ZP,{type:"primary",className:"ml10",onClick:function(){return N(Pi.ExecPath)},children:"设置"})})]}),(0,y.jsx)("iframe",{onLoad:function(e){},src:D,scrolling:"no",style:{height:"calc(100vh - 120px)"},className:"mt10",id:"frame",name:"framename",width:"100%",frameBorder:"0"}),(0,y.jsx)(hi,{fileType:"path",path:null==i||null===(n=i.detail)||void 0===n?void 0:n.startup_file,onFinish:function(e){return k(e)}})]})},{key:"2",label:"评测设置",children:"2"===T?(0,y.jsx)(Di.Z,{active:"testCase",type:"jupyterLab"}):null},{key:"3",label:"参考答案",children:(0,y.jsx)(ji,{})}]})})),Oi=["tabsActive"],Ci=function(e){var n=e.tabsActive,t=r()(e,Oi);return(0,y.jsxs)(l.Fragment,{children:["information"===n&&(0,y.jsx)(le,{}),"warehouse"===n&&(0,y.jsx)(_e.default,{}),"level"===n&&(0,y.jsx)(he,s()({},t)),"collaborate"===n&&(0,y.jsx)(Le,s()({},t)),"setting"===n&&(0,y.jsx)(Re.Z,{}),"environment"===n&&(0,y.jsx)(Ct,s()({},t)),"dataset"===n&&(0,y.jsx)(_i,{}),"service"===n&&(0,y.jsx)(yi,s()({},t))]})},Mi="sidebar___OW5LG",Si="items___j856O",Ti="item___Zn_qr",Ai="name___ZfhoC",Ii="itemActive___sW_Ri",wi="question___yfIcY";Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var Ni="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbC1ydWxlPSJub256ZXJvIiBmaWxsPSJub25lIj48cGF0aCBkPSJNOCAwYTggOCAwIDEgMS04IDggOC4wMSA4LjAxIDAgMCAxIDgtOFoiIGZpbGw9IiNGRUIzMDAiLz48cGF0aCBkPSJNOC4xMTEgMTJhLjc4Ljc4IDAgMSAwIC4wMDYtMS41Ni43OC43OCAwIDAgMC0uMDA2IDEuNTZaTTcuNTU2IDRhLjIxLjIxIDAgMCAwLS4yMTIuMjE4bC4yNDQgNS4xMzNhLjExNy4xMTcgMCAwIDAgLjExNi4xMWguODE1YS4xMTguMTE4IDAgMCAwIC4xMTctLjExbC4yNDMtNS4xMzNBLjIwOC4yMDggMCAwIDAgOC42NjYgNGgtMS4xMVoiIGZpbGw9IiNGRkYiLz48L2c+PC9zdmc+",ki=["globalSetting","loading","dispatch","shixunsDetail","practiceSetting"],Li=[{name:"基本信息",icon:(0,y.jsx)("i",{className:"icon iconfont icon-jibenxinxi1"}),tabId:"information"},{name:"代码仓库",icon:(0,y.jsx)("i",{className:"icon iconfont icon-daimacangku"}),tabId:"warehouse"},{name:"任务关卡",icon:(0,y.jsx)("i",{className:"icon iconfont icon-renwuguanka"}),tabId:"level"},{name:"实验环境",icon:(0,y.jsx)("i",{className:"icon iconfont icon-shiyanhuanjing"}),tabId:"environment"},{name:"数据集",icon:(0,y.jsx)("i",{className:"icon iconfont icon-shujuji",style:{fontSize:25}}),tabId:"dataset"},{name:"服务与评测",icon:(0,y.jsx)("i",{className:"icon iconfont icon-renwuguanka"}),tabId:"service"},{name:"合作人员",icon:(0,y.jsx)("i",{className:"icon iconfont icon-hezuochengyuan"}),tabId:"collaborate"},{name:"设置",icon:(0,y.jsx)("i",{className:"icon iconfont icon-shezhi5"}),tabId:"setting"}],Ri=(0,P.connect)((function(e){var n=e.loading,t=e.globalSetting,i=e.shixunsDetail;return{globalSetting:t,loading:n,practiceSetting:e.practiceSetting,shixunsDetail:i}}))((function(e){e.globalSetting,e.loading;var n,t=e.dispatch,i=e.shixunsDetail,a=e.practiceSetting,_=(r()(e,ki),a.base_info_warning),o=a.challenges_warning,c=a.id,u=a.repository_warning,d=a.sideBar,p=a.service_warning,m=(0,P.useLocation)(),h=(0,P.useParams)(),x=(0,P.useSearchParams)(),v=S()(x,1)[0];(0,l.useEffect)((function(){var e,n=v.get("tabId"),s=m.pathname.split("/").length,a=(null!=i&&null!==(e=i.detail)&&void 0!==e&&e.windows_vnc?Li.filter((function(e){return"dataset"!==e.tabId})):Li).map((function(e){return e.tabId})).includes(n);n&&a?t({type:"practiceSetting/setSideBarTabs",payload:{tabsActive:n}}):s>4?t({type:"practiceSetting/setSideBarTabs",payload:{tabsActive:"level"}}):(!n||n&&!a)&&t({type:"practiceSetting/setSideBarTabs",payload:{tabsActive:"information"}})}),[null==i||null===(n=i.detail)||void 0===n?void 0:n.windows_vnc]),(0,l.useEffect)((function(){return function(){t({type:"practiceSetting/setSideBarTabs",payload:s()(s()({},a.sideBar),{},{selectPath:""})})}}),[h.id]);var f;return(0,y.jsxs)("div",{className:Mi,children:[(0,y.jsx)("div",{className:Si,children:(null!=i&&null!==(f=i.detail)&&void 0!==f&&f.windows_vnc?Li.filter((function(e){return"dataset"!==e.tabId})):Li).filter((function(e){var n;return null!=i&&null!==(n=i.detail)&&void 0!==n&&n.is_jupyter_lab?"level"!==e.tabId:"service"!==e.tabId})).map((function(e){var n=e.name,i=e.icon,s=e.tabId;return(0,y.jsxs)("div",{className:"".concat(a.sideBar.tabsActive===s?Ii:Ti," font12"),onClick:function(){return function(e){var n;if(e!==d.tabsActive){var i=function(){P.history.push("/shixuns/".concat(c,"/edit?tabId=").concat(e)),t({type:"practiceSetting/setSideBarTabs",payload:{tabsActive:e,selectPath:"",confirmLeave:!1}})};null!=a&&null!==(n=a.sideBar)&&void 0!==n&&n.confirmLeave?E.Z.confirm({title:"离开此页提示",content:"系统可能不会保存您所做的更改。",okText:"离开",cancelText:"取消",onOk:function(){i()}}):i()}}(s)},children:[i,(0,y.jsx)("span",{className:Ai,children:n}),"information"===s&&_&&(0,y.jsx)(Ke.Z,{title:"请完善基本信息",children:(0,y.jsx)("img",{src:Ni,alt:""})}),"level"===s&&o&&(0,y.jsx)(Ke.Z,{title:"请创建任务关卡",children:(0,y.jsx)("img",{src:Ni,alt:""})}),"service"===s&&p&&(0,y.jsx)(Ke.Z,{title:"请设置默认打开文件",children:(0,y.jsx)("img",{src:Ni,alt:""})}),"warehouse"===s&&u&&(0,y.jsx)(Ke.Z,{title:"请开启代码仓库",children:(0,y.jsx)("img",{src:Ni,alt:""})})]},s)}))}),(0,y.jsx)("div",{className:wi,children:(0,y.jsx)(Ke.Z,{placement:"right",title:"常见问题",children:(0,y.jsx)("span",{style:{cursor:"pointer"},onClick:function(){return window.open("https://www.educoder.net/forums/4692")},children:(0,y.jsx)("img",{src:si.Pt,height:44,width:44,alt:""})})})})]})})),Bi="bottom___AZ7c_",Zi="yes___iDEVN",Wi="no___E02he",Ki=(0,P.connect)((function(e){var n=e.classroomList,t=e.loading,i=e.shixunsDetail;return{classroomList:n,loading:t.effects,shixunsDetail:i}}))((function(e){var n,t,i=e.classroomList,a=e.loading,r=e.dispatch,_=(e.shixunsDetail,(0,P.useParams)()),o=((0,P.useLocation)(),(0,l.useState)(!1)),c=S()(o,2),u=c[0],d=c[1],p=(0,l.useState)(!1),h=S()(p,2),v=h[0],f=h[1],g=i.actionTabs,j=k.Z.useForm(),O=S()(j,1)[0],C=(0,l.useState)({name:"string"}),M=S()(C,2),T=M[0],A=M[1],I=(0,l.useState)(),w=S()(I,2),N=w[0];w[1];(0,l.useEffect)((function(){console.log(_),"重名修改"===i.actionTabs.key&&(T.name=null==g?void 0:g.name),A(s()({},T)),O.setFieldsValue({name:null==g?void 0:g.name})}),[i.actionTabs.key]);return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(E.Z,{centered:!0,title:"提示",open:"同步修改"===i.actionTabs.key,width:460,zIndex:(null==i||null===(n=i.actionTabs)||void 0===n?void 0:n.zIndex)||1e3,footer:null,onOk:x()(m()().mark((function e(){var n,t,a;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(123123),e.abrupt("return");case 4:return n=O.getFieldValue(),t="post",d(!0),a="/api/course_second_categories/".concat(i.actionTabs.selectArrs.category_id,"/rename_category.json"),g.selectArrs.main_id&&(a="/api/course_modules/".concat(i.actionTabs.selectArrs.main_id,"/rename_module.json")),"board"!==i.actionTabs.selectArrs.category_type&&"board"!==i.actionTabs.selectArrs.type||(a="/api/boards/".concat(i.actionTabs.selectArrs.category_id,".json"),t="put"),e.next=12,(0,D.ZP)(a,{method:t,body:s()({},n)});case 12:0===e.sent.status&&(b.ZP.success("修改成功"),r({type:"classroomList/setActionTabs",payload:{key:"同步修改成功"}}),r({type:"classroomList/getClassroomLeftMenus",payload:{id:_.coursesId}}),g.cb&&g.cb()),d(!1);case 15:case"end":return e.stop()}}),e)}))),onCancel:function(){r({type:"classroomList/setActionTabs",payload:{}})},children:[(0,y.jsx)("div",{children:(0,y.jsxs)("p",{children:["本实训为创建作业/考试时复制生成的,",{information:"请确认是否将本次修改的基本信息同步至原实训中",wareHouse:"请确认是否将本次代码仓库修改内容同步到原实训中",environment:"请确认是否将本次修改的实验环境同步至原实训中",taskLevel:"请确认是否将本次修改的任务关卡同步至原实训中",setting:"请确认是否将本次修改的设置同步至原实训中"}[i.actionTabs.type],""]})}),(0,y.jsxs)("div",{className:Bi,children:[(0,y.jsx)(L.ZP,{loading:a["shixunsDetail/saveCopyForExercise"]&&v,className:Wi,onClick:x()(m()().mark((function e(){var n;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f(!0),null!==(n=i.actionTabs)&&void 0!==n&&n.value?i.actionTabs.fn(i.actionTabs.value,!0,2):i.actionTabs.fn(!0,2);case 2:case"end":return e.stop()}}),e)}))),children:"同步修改原实训"}),(0,y.jsx)(L.ZP,{loading:a["shixunsDetail/saveCopyForExercise"]&&!v,className:Zi,onClick:x()(m()().mark((function e(){var n;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f(!1),null!==(n=i.actionTabs)&&void 0!==n&&n.value?i.actionTabs.fn(i.actionTabs.value,!1,1):i.actionTabs.fn(!1,1);case 2:case"end":return e.stop()}}),e)}))),children:"仅保存本实训"})]})]}),(0,y.jsx)(E.Z,{centered:!0,title:"提示",open:"重名修改"===i.actionTabs.key,okText:"保存名称",cancelText:"不更换名称",destroyOnClose:!0,width:550,confirmLoading:u,onOk:x()(m()().mark((function e(){var n,t,s,a;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,O.validateFields();case 2:return n=O.getFieldValue(),d(!0),e.next=6,(0,D.ZP)("/api/shixuns/".concat(null==_?void 0:_.id,"/update_shixun_name.json"),{method:"post",body:{shixun_name:n.name}});case 6:t=e.sent,d(!1),0===t.status&&(b.ZP.success("修改成功"),r({type:"practiceSetting/getCommonData",payload:{id:_.id}}),null!==(s=i.actionTabs)&&void 0!==s&&s.getBaseInfo&&(null===(a=i.actionTabs)||void 0===a||a.getBaseInfo())),r({type:"classroomList/setActionTabs",payload:{}});case 10:case"end":return e.stop()}}),e)}))),onCancel:function(){r({type:"classroomList/setActionTabs",payload:{}})},children:(0,y.jsxs)("div",{children:[(0,y.jsx)("p",{children:"你管理的实训中有同名实训,建议更换实训名称(如:添加日期、用途等文案)"}),(0,y.jsx)(k.Z,{form:O,initialValues:ft()({},"name",N),onChange:function(){A(O.getFieldValue())},children:(0,y.jsx)(k.Z.Item,{name:"name",rules:[{required:!0,message:"请输入实训名称"}],children:(0,y.jsxs)(Z.Z,{className:"mt30",align:"middle",children:[(0,y.jsx)(W.Z,{className:"font14",children:"实训名称:"}),(0,y.jsx)(W.Z,{flex:"1",children:(0,y.jsx)(R.Z,{maxLength:60,defaultValue:null==g?void 0:g.name,suffix:(0,y.jsxs)("span",{children:[(null==T||null===(t=T.name)||void 0===t?void 0:t.length)||0,"/",60]})})})]})})})]})})]})})),Ui=["globalSetting","loading","dispatch","practiceSetting"],zi=(0,P.connect)((function(e){var n=e.loading;return{globalSetting:e.globalSetting,loading:n,practiceSetting:e.practiceSetting}}))((function(e){e.globalSetting,e.loading;var n=e.dispatch,t=e.practiceSetting,i=r()(e,Ui),a=(t.sideBar.tabsActive,(0,P.useParams)());return(0,l.useEffect)((function(){return n({type:"globalSetting/headerFooterToggle",payload:!1}),n({type:"shixunsDetail/getShixunsDetail",payload:s()(s()({},a),{},{shixun_managed:!0})}),function(){n({type:"globalSetting/headerFooterToggle",payload:!0}),n({type:"practiceSetting/setParams",payload:{id:""}})}}),[]),(0,y.jsxs)("div",{className:_,children:[(0,y.jsx)("div",{className:o,children:(0,y.jsx)(C,{})}),(0,y.jsxs)("div",{className:c,children:[(0,y.jsx)("div",{className:u,children:(0,y.jsx)(Ri,{})}),(0,y.jsx)("div",{className:d,children:(0,y.jsx)(Ci,s()(s()({},i),{},{tabsActive:t.sideBar.tabsActive}))})]}),(0,y.jsx)(Ki,{})]})}))},10462:function(e,n){"use strict";n.Z={titlesize:"titlesize___RiFfV",labelWrap:"labelWrap___gNw3Q",label:"label___uujJZ",labelContent:"labelContent___QsIDL",selectSchool:"selectSchool___HL1ax",dataPicker:"dataPicker___Ux1tp",itemWrap:"itemWrap___Q0uQz",img:"img___bqnNM",itemContent:"itemContent___FvPMp",nameWrap:"nameWrap___ALKio",name:"name___Q7c5Q",actionGroup:"actionGroup___qiWs0",schoolWrap:"schoolWrap___dXuoo",school:"school___CW5RX",colorOrange:"colorOrange___EkZAA",colorYellow:"colorYellow___evRzy",graaytitle:"graaytitle___LUmPS"}},46400:function(e,n,t){"use strict";t.d(n,{Z:function(){return k}});var i=t(46906),s=t(21884),a=t(53043),r=t(90584),l=t(85456),_=t(92310),o=t.n(_),c=t(16934),u=t(47413),d=t(59301),p=t(92343),m=t(36355),h=t(17313),x=t(83116);const v=(e,n,t,i,s)=>({backgroundColor:e,border:`${i.lineWidth}px ${i.lineType} ${n}`,[`${s}-icon`]:{color:t}}),f=e=>{const{componentCls:n,motionDurationSlow:t,marginXS:i,marginSM:s,fontSize:a,fontSizeLG:r,lineHeight:l,borderRadiusLG:_,motionEaseInOutCirc:o,withDescriptionIconSize:c,colorText:u,colorTextHeading:d,withDescriptionPadding:p,defaultPadding:m}=e;return{[n]:Object.assign(Object.assign({},(0,h.Wf)(e)),{position:"relative",display:"flex",alignItems:"center",padding:m,wordWrap:"break-word",borderRadius:_,[`&${n}-rtl`]:{direction:"rtl"},[`${n}-content`]:{flex:1,minWidth:0},[`${n}-icon`]:{marginInlineEnd:i,lineHeight:0},"&-description":{display:"none",fontSize:a,lineHeight:l},"&-message":{color:d},[`&${n}-motion-leave`]:{overflow:"hidden",opacity:1,transition:`max-height ${t} ${o}, opacity ${t} ${o},\n padding-top ${t} ${o}, padding-bottom ${t} ${o},\n margin-bottom ${t} ${o}`},[`&${n}-motion-leave-active`]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0}}),[`${n}-with-description`]:{alignItems:"flex-start",padding:p,[`${n}-icon`]:{marginInlineEnd:s,fontSize:c,lineHeight:0},[`${n}-message`]:{display:"block",marginBottom:i,color:d,fontSize:r},[`${n}-description`]:{display:"block",color:u}},[`${n}-banner`]:{marginBottom:0,border:"0 !important",borderRadius:0}}},g=e=>{const{componentCls:n,colorSuccess:t,colorSuccessBorder:i,colorSuccessBg:s,colorWarning:a,colorWarningBorder:r,colorWarningBg:l,colorError:_,colorErrorBorder:o,colorErrorBg:c,colorInfo:u,colorInfoBorder:d,colorInfoBg:p}=e;return{[n]:{"&-success":v(s,i,t,e,n),"&-info":v(p,d,u,e,n),"&-warning":v(l,r,a,e,n),"&-error":Object.assign(Object.assign({},v(c,o,_,e,n)),{[`${n}-description > pre`]:{margin:0,padding:0}})}}},j=e=>{const{componentCls:n,iconCls:t,motionDurationMid:i,marginXS:s,fontSizeIcon:a,colorIcon:r,colorIconHover:l}=e;return{[n]:{"&-action":{marginInlineStart:s},[`${n}-close-icon`]:{marginInlineStart:s,padding:0,overflow:"hidden",fontSize:a,lineHeight:`${a}px`,backgroundColor:"transparent",border:"none",outline:"none",cursor:"pointer",[`${t}-close`]:{color:r,transition:`color ${i}`,"&:hover":{color:l}}},"&-close-text":{color:r,transition:`color ${i}`,"&:hover":{color:l}}}}},E=e=>[f(e),g(e),j(e)];var b=(0,x.Z)("Alert",(e=>[E(e)]),(e=>({withDescriptionIconSize:e.fontSizeHeading3,defaultPadding:`${e.paddingContentVerticalSM}px 12px`,withDescriptionPadding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`}))),D=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)n.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(t[i[s]]=e[i[s]])}return t};const P={success:i.Z,info:l.Z,error:s.Z,warning:r.Z},y=e=>{const{icon:n,prefixCls:t,type:i}=e,s=P[i]||null;return n?(0,p.wm)(n,d.createElement("span",{className:`${t}-icon`},n),(()=>({className:o()(`${t}-icon`,{[n.props.className]:n.props.className})}))):d.createElement(s,{className:`${t}-icon`})},O=e=>{const{isClosable:n,prefixCls:t,closeIcon:i,handleClose:s}=e,r=!0===i||void 0===i?d.createElement(a.Z,null):i;return n?d.createElement("button",{type:"button",onClick:s,className:`${t}-close-icon`,tabIndex:0},r):null};var C=e=>{const{description:n,prefixCls:t,message:i,banner:s,className:a,rootClassName:r,style:l,onMouseEnter:_,onMouseLeave:p,onClick:h,afterClose:x,showIcon:v,closable:f,closeText:g,closeIcon:j,action:E}=e,P=D(e,["description","prefixCls","message","banner","className","rootClassName","style","onMouseEnter","onMouseLeave","onClick","afterClose","showIcon","closable","closeText","closeIcon","action"]),[C,M]=d.useState(!1);const S=d.useRef(null),{getPrefixCls:T,direction:A,alert:I}=d.useContext(m.E_),w=T("alert",t),[N,k]=b(w),L=n=>{var t;M(!0),null===(t=e.onClose)||void 0===t||t.call(e,n)},R=d.useMemo((()=>void 0!==e.type?e.type:s?"warning":"info"),[e.type,s]),B=d.useMemo((()=>!!g||("boolean"==typeof f?f:!1!==j&&null!=j)),[g,j,f]),Z=!(!s||void 0!==v)||v,W=o()(w,`${w}-${R}`,{[`${w}-with-description`]:!!n,[`${w}-no-icon`]:!Z,[`${w}-banner`]:!!s,[`${w}-rtl`]:"rtl"===A},null==I?void 0:I.className,a,r,k),K=(0,u.Z)(P,{aria:!0,data:!0});return N(d.createElement(c.default,{visible:!C,motionName:`${w}-motion`,motionAppear:!1,motionEnter:!1,onLeaveStart:e=>({maxHeight:e.offsetHeight}),onLeaveEnd:x},(t=>{let{className:s,style:a}=t;return d.createElement("div",Object.assign({ref:S,"data-show":!C,className:o()(W,s),style:Object.assign(Object.assign(Object.assign({},null==I?void 0:I.style),l),a),onMouseEnter:_,onMouseLeave:p,onClick:h,role:"alert"},K),Z?d.createElement(y,{description:n,icon:e.icon,prefixCls:w,type:R}):null,d.createElement("div",{className:`${w}-content`},i?d.createElement("div",{className:`${w}-message`},i):null,n?d.createElement("div",{className:`${w}-description`},n):null),E?d.createElement("div",{className:`${w}-action`},E):null,d.createElement(O,{isClosable:B,prefixCls:w,closeIcon:g||j,handleClose:L}))})))},M=t(19243),S=t(16177),T=t(74258),A=t(35796);let I=function(e){(0,T.Z)(t,e);var n=(0,A.Z)(t);function t(){var e;return(0,M.Z)(this,t),(e=n.apply(this,arguments)).state={error:void 0,info:{componentStack:""}},e}return(0,S.Z)(t,[{key:"componentDidCatch",value:function(e,n){this.setState({error:e,info:n})}},{key:"render",value:function(){const{message:e,description:n,children:t}=this.props,{error:i,info:s}=this.state,a=s&&s.componentStack?s.componentStack:null,r=void 0===e?(i||"").toString():e,l=void 0===n?a:n;return i?d.createElement(C,{type:"error",message:r,description:d.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},l)}):t}}]),t}(d.Component);var w=I;const N=C;N.ErrorBoundary=w;var k=N},44e3:function(e,n,t){"use strict";var i=t(84966),s=t(86737);const a=i.ZP;a.Header=i.h4,a.Footer=i.$_,a.Content=i.VY,a.Sider=s.Z,n.Z=a},51581:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(n,t,i){return t&&e(n.prototype,t),i&&e(n,i),n}}(),s=t(59301),a=l(s),r=l(t(12708));function l(e){return e&&e.__esModule?e:{default:e}}var _=function(e){function n(e){!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n);var t=function(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?e:n}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.scrollListener=t.scrollListener.bind(t),t.eventListenerOptions=t.eventListenerOptions.bind(t),t.mousewheelListener=t.mousewheelListener.bind(t),t}return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}(n,e),i(n,[{key:"componentDidMount",value:function(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function(){if(this.props.isReverse&&this.loadMore){var e=this.getParentElement(this.scrollComponent);e.scrollTop=e.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var e=!1,n={get passive(){e=!0}};try{document.addEventListener("test",null,n),document.removeEventListener("test",null,n)}catch(e){}return e}},{key:"eventListenerOptions",value:function(){var e=this.props.useCapture;return this.isPassiveSupported()&&(e={useCapture:this.props.useCapture,passive:!0}),e}},{key:"setDefaultLoader",value:function(e){this.defaultLoader=e}},{key:"detachMousewheelListener",value:function(){var e=window;!1===this.props.useWindow&&(e=this.scrollComponent.parentNode),e.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var e=window;!1===this.props.useWindow&&(e=this.getParentElement(this.scrollComponent)),e.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),e.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(e){var n=this.props.getScrollParent&&this.props.getScrollParent();return null!=n?n:e&&e.parentNode}},{key:"filterProps",value:function(e){return e}},{key:"attachScrollListener",value:function(){var e=this.getParentElement(this.scrollComponent);if(this.props.hasMore&&e){var n=window;!1===this.props.useWindow&&(n=e),n.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),n.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),n.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}}},{key:"mousewheelListener",value:function(e){1!==e.deltaY||this.isPassiveSupported()||e.preventDefault()}},{key:"scrollListener",value:function(){var e=this.scrollComponent,n=window,t=this.getParentElement(e),i=void 0;if(this.props.useWindow){var s=document.documentElement||document.body.parentNode||document.body,a=void 0!==n.pageYOffset?n.pageYOffset:s.scrollTop;i=this.props.isReverse?a:this.calculateOffset(e,a)}else i=this.props.isReverse?t.scrollTop:e.scrollHeight-t.scrollTop-t.clientHeight;i<Number(this.props.threshold)&&e&&null!==e.offsetParent&&(this.detachScrollListener(),this.beforeScrollHeight=t.scrollHeight,this.beforeScrollTop=t.scrollTop,"function"==typeof this.props.loadMore&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function(e,n){return e?this.calculateTopPosition(e)+(e.offsetHeight-n-window.innerHeight):0}},{key:"calculateTopPosition",value:function(e){return e?e.offsetTop+this.calculateTopPosition(e.offsetParent):0}},{key:"render",value:function(){var e=this,n=this.filterProps(this.props),t=n.children,i=n.element,s=n.hasMore,r=(n.initialLoad,n.isReverse),l=n.loader,_=(n.loadMore,n.pageStart,n.ref),o=(n.threshold,n.useCapture,n.useWindow,n.getScrollParent,function(e,n){var t={};for(var i in e)n.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}(n,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]));o.ref=function(n){e.scrollComponent=n,_&&_(n)};var c=[t];return s&&(l?r?c.unshift(l):c.push(l):this.defaultLoader&&(r?c.unshift(this.defaultLoader):c.push(this.defaultLoader))),a.default.createElement(i,o,c)}}]),n}(s.Component);_.propTypes={children:r.default.node.isRequired,element:r.default.node,hasMore:r.default.bool,initialLoad:r.default.bool,isReverse:r.default.bool,loader:r.default.node,loadMore:r.default.func.isRequired,pageStart:r.default.number,ref:r.default.func,getScrollParent:r.default.func,threshold:r.default.number,useCapture:r.default.bool,useWindow:r.default.bool},_.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},n.default=_,e.exports=n.default},26724:function(e,n,t){e.exports=t(51581)}}]);