|
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[68827],{7556:function(e,n,s){s.r(n),s.d(n,{default:function(){return qe}});var t=s(37205),i=s.n(t),a=s(7557),r=s.n(a),c=s(82242),l=s.n(c),o=s(41498),u=s.n(o),d=s(79800),p=s.n(d),m=s(39647),f=s.n(m),h=s(59301),x=s(80608),g=s(78241),v=s(8591),j=s(43418),y=s(95237),_=s(43604),b=s(6848),k=s(3113),N=s(24650),w=s(28103),Z=s(66999),I=s(5112),S=s(29747),C=s(33329),D=s(27876),T=s(61186),P=s.n(T),R="icons___fU5ZJ",A="shixuns___HhH4T",L="buttons___Xd62N",O="addStage___Ap4gr",E="color4CA___dMAG4",F="actionTabs___x3cPl",z="tab___BFnIn",V="s1___O6K2P",G="tabActive___v3_qF",M="total___oZdqK",J=s(43428),q=s(24905),B=s(86859),H=s(49105),U=s(3579),K=s(75916),Q="drawer___UVA9h",X="menu___s5Hi1",W="actived___GavBb",Y="listItem___OyHb7",$="info___UU9rA",ee="title___CmRLc",ne="titleLeft___xWCXz",se="search___CzPOL",te="description___TEI_C",ie=s(37712),ae=N.Z.Search,re=[{id:"type",name:"筛选",children:[{name:"全部实训",id:"all",type:"type"},{name:"我的实训",id:"mine",type:"type"}]},{id:"diff",name:"难度",children:[{name:"全部",id:"",type:"diff"},{name:"初级",id:1,type:"diff"},{name:"中级",id:2,type:"diff"},{name:"中高级",id:3,type:"diff"},{name:"高级",id:4,type:"diff"}]}],ce=(0,x.connect)((function(e){return{classroomList:e.classroomList,loading:e.loading}}))((function(e){var n,s=e.classroomList,t=(e.loading,e.dispatch),a=e.cb,c=e.shixunIds,o=void 0===c?[]:c,d=(0,x.useParams)(),m=((0,x.useLocation)(),s.actionTabs,g.Z.useForm()),f=(p()(m,1)[0],s.shixunLists),j=(0,h.useState)([]),y=p()(j,2),_=y[0],N=y[1],Z=(0,h.useState)([]),I=p()(Z,2),S=I[0],C=I[1],D=(0,h.useState)({page:1,type:"all",diff:0,status:"all",order:"desc",limit:20,sort:"myshixuns_count",group_id:null}),T=p()(D,2),P=T[0],R=T[1];(0,h.useEffect)((function(){"选用实践项目"===s.actionTabs.key&&(P.page=1,t({type:"classroomList/getShixunLists",payload:l()({},P)}))}),[s.actionTabs.key]),(0,h.useEffect)((function(){A()}),[d]);var A=function(){var e=u()(r()().mark((function e(){var n;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,H.ZP)("/api/users/user_setting_groups.json",{method:"get",params:{type:"Shixun"}});case 2:n=e.sent,N([{id:null,name:"全部"},{id:-1,name:"未加入目录"}].concat(i()((null==n?void 0:n.groups)||[])));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),L=function(){t({type:"classroomList/setActionTabs",payload:{}}),R({page:1,type:"all",diff:0,status:"all",order:"desc",limit:20,sort:"myshixuns_count",group_id:null})};return"选用实践项目"!==s.actionTabs.key?null:(0,ie.jsxs)(J.Z,{placement:"bottom",height:"100%",closable:!1,open:"选用实践项目"===s.actionTabs.key,rootClassName:Q,footer:(0,ie.jsxs)("div",{className:"tc",children:[(0,ie.jsx)(k.ZP,{size:"middle",onClick:function(){L(),C([]),a("取消")},style:{marginRight:8},children:"取消"}),(0,ie.jsx)(k.ZP,{size:"middle",onClick:u()(r()().mark((function e(){var n,t,c,l;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=r()().mark((function e(){var n,s;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=S[c],!o.includes(n)){e.next=4;break}return v.ZP.info("请勿重复选择:".concat(null==f||null===(s=f.shixun_list)||void 0===s||null===(s=s.find((function(e){return e.id===n})))||void 0===s?void 0:s.title)),e.abrupt("return",{v:void 0});case 4:case"end":return e.stop()}}),e)})),c=0;case 2:if(!(c<(null==S?void 0:S.length))){e.next=10;break}return e.delegateYield(n(),"t0",4);case 4:if(!(t=e.t0)){e.next=7;break}return e.abrupt("return",t.v);case 7:c++,e.next=2;break;case 10:return e.next=12,(0,U.Ep)({id:s.actionTabs.id,course_id:s.actionTabs.course_id,shixun_ids:i()(S)});case 12:l=e.sent,C([]),null!=l&&l.shixuns_list&&(L(),a(l.shixuns_list));case 15:case"end":return e.stop()}}),e)}))),type:"primary",children:"确定"})]}),children:[(0,ie.jsx)("section",{className:"tc",children:(0,ie.jsx)(ae,{placeholder:"实训信息/院校名称/创建者",enterButton:"搜索",size:"middle",className:se,onSearch:function(e){P.keyword=e,P.page=1,t({type:"classroomList/getShixunLists",payload:l()({},P)})}})}),(0,ie.jsxs)("section",{className:"edu-container",children:[re.map((function(e,n){var s;return(0,ie.jsxs)("ul",{className:X,children:[(0,ie.jsx)("li",{children:e.name}),null==e||null===(s=e.children)||void 0===s?void 0:s.map((function(n,s){return(0,ie.jsx)("li",{className:P[e.id]==n.id?W:"",onClick:function(){P[e.id]=n.id,P.page=1,R(l()({},P)),t({type:"classroomList/getShixunLists",payload:l()({},P)})},children:(0,ie.jsx)("strong",{children:n.name})})}))]},n)})),"mine"===P.type&&(0,ie.jsxs)("ul",{className:X,children:[(0,ie.jsx)("li",{children:"目录"}),null==_?void 0:_.map((function(e,n){return(0,ie.jsx)("li",{className:P.group_id==e.id?W:"",onClick:function(){P.group_id=e.id,P.page=1,R(l()({},P)),t({type:"classroomList/getShixunLists",payload:l()({},P)})},children:(0,ie.jsx)("strong",{children:e.name})},e.name)}))]}),null==f||null===(n=f.shixun_list)||void 0===n?void 0:n.map((function(e,n){return(0,ie.jsxs)("div",{className:Y,children:[(0,ie.jsx)(q.Z,{checked:S.includes(e.id),value:e.id,onChange:function(n){S.indexOf(e.id);S.indexOf(e.id)>-1?C(S.filter((function(n){return n!==e.id}))):C(S.concat(e.id))}}),(0,ie.jsxs)("div",{className:$,children:[(0,ie.jsx)("div",{className:ee,children:(0,ie.jsxs)("div",{className:ne,children:[(0,ie.jsx)("a",{className:"c-black",href:"/shixuns/".concat(null==e?void 0:e.identifier,"/challenges"),target:"_blank",children:(0,ie.jsx)("strong",{className:"font16",dangerouslySetInnerHTML:{__html:e.title}})}),(0,K.Ny)()&&1===(null==e?void 0:e.mark_status)&&(0,ie.jsx)(b.Z,{title:null==e?void 0:e.mark_content,children:(0,ie.jsx)("span",{style:{marginRight:"auto",background:"#2FA34F"},className:"tag-style current ml10",children:"正常"})}),(0,K.Ny)()&&2===(null==e?void 0:e.mark_status)&&(0,ie.jsx)(b.Z,{title:null==e?void 0:e.mark_content,children:(0,ie.jsx)("span",{style:{marginRight:"auto",background:"#FF8C29"},className:"tag-style current ml10",children:"需完善"})}),(0,K.Ny)()&&3===(null==e?void 0:e.mark_status)&&(0,ie.jsx)(b.Z,{title:null==e?void 0:e.mark_content,children:(0,ie.jsx)("span",{style:{marginRight:"auto",background:"#E53333"},className:"tag-style current ml10",children:"无法使用"})})]})}),(0,ie.jsx)("div",{className:"flex-wrp mt10 font14 c-light-black",children:(0,ie.jsx)("span",{className:te,dangerouslySetInnerHTML:{__html:e.description}})}),(0,ie.jsx)("div",{className:"flex-wrp mt15",children:e.challenge_names.map((function(e,n){return(0,ie.jsxs)("span",{className:"mr30 font12",children:["第",n+1,"关 ",e," "]},n)}))}),(0,ie.jsx)(w.Z,{dashed:!0}),(0,ie.jsxs)("div",{className:"c-light-black mt20 font12",children:[(0,ie.jsx)("span",{children:e.author_name}),(0,ie.jsx)("span",{className:"ml15 mr15",children:"|"}),(0,ie.jsx)("span",{children:e.author_school_name}),(0,ie.jsx)("span",{className:"ml15 mr15",children:"|"}),(0,ie.jsxs)("span",{children:["难度系数:",e.level]}),(0,ie.jsx)("span",{className:"ml15 mr15",children:"|"}),(0,ie.jsx)("span",{children:"学习人数:"}),(0,ie.jsx)("span",{children:e.study_count})]})]})]},n)})),(0,ie.jsx)("p",{})]}),(0,ie.jsx)("div",{className:"tc",children:(0,ie.jsx)(B.Z,{current:P.page||1,hideOnSinglePage:!0,showSizeChanger:!1,defaultPageSize:20,showQuickJumper:!0,total:null==f?void 0:f.shixuns_count,onChange:function(e){P.page=e,t({type:"classroomList/getShixunLists",payload:l()({},P)})}})})]},"bottom")})),le=s(10283),oe=s(93948),ue="wrap___UWG0f",de="name___LIQSC",pe="button___CSggN",me="progress___AQo_Y",fe="havaLearn___fq9Cb",he=function(e){var n=e.data,s=void 0===n?{}:n,t=e.dispatch,i=void 0===t?function(){}:t,a=e.onReloadData,c=void 0===a?function(){}:a,l=function e(n){var s,t;n=null!==(s=n)&&void 0!==s&&s.includes(".json")?n:"".concat(n,".json"),j.Z.confirm({centered:!0,title:"提示",okText:"确定",cancelText:"取消",content:(0,ie.jsx)("div",{className:"tc font16",children:"实训已经更新了,正在为您重置!"}),onOk:(t=u()(r()().mark((function s(){var t,i;return r()().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,(0,C.$Q)({url:n});case 2:if(t=s.sent){s.next=5;break}return s.abrupt("return");case 5:return v.ZP.success("重置成功,正在进入实践项目!"),s.next=8,(0,C.Ir)({id:t.shixun_identifier});case 8:if(null==(i=s.sent)||!i.game_identifier){s.next=13;break}return(0,D.xg)("/tasks/".concat(i.game_identifier)),c(),s.abrupt("return");case 13:2===(null==i?void 0:i.status)?e(null==i?void 0:i.message):3===(null==i?void 0:i.status)&&o(null==i?void 0:i.message);case 14:case"end":return s.stop()}}),s)}))),function(){return t.apply(this,arguments)})})},o=function(e){j.Z.confirm({centered:!0,title:"提示",okText:"确定",cancelText:"取消",content:(0,ie.jsxs)("div",{className:"tc font16",children:["目前该实践项目尚在内测中,将于",e,"之后开放,谢谢!"]})})},d=function(){var e=u()(r()().mark((function e(n){var s;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.Ir)({id:n});case 2:if(null==(s=e.sent)||!s.game_identifier){e.next=7;break}return(0,D.xg)("/tasks/".concat(s.game_identifier)),c(),e.abrupt("return");case 7:2===(null==s?void 0:s.status)?l(null==s?void 0:s.message):3===(null==s?void 0:s.status)&&o(null==s?void 0:s.message);case 8:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,ie.jsx)("section",{children:!(0,K.GJ)()&&(0,ie.jsx)(ie.Fragment,{children:null!=s&&s.start_learning?(0,ie.jsxs)(y.Z,{className:ue,align:"middle",children:[(0,ie.jsxs)(_.Z,{flex:"1",children:[(0,ie.jsx)("div",{className:"mt5 ".concat(fe),children:(0,ie.jsxs)("span",{children:["已学",null==s?void 0:s.learned,"%"]})}),(0,ie.jsx)("div",{className:"mt5 ".concat(me),children:(0,ie.jsx)(oe.Z,{percent:null==s?void 0:s.learned,showInfo:!1})}),(0,ie.jsxs)("div",{className:"mt5",children:[(0,ie.jsx)("span",{className:"font16",children:"上次学习内容"}),(0,ie.jsx)("span",{className:"ml20 c-blue-4ca",children:null==s?void 0:s.last_shixun})]})]}),(0,ie.jsx)(_.Z,{children:(0,ie.jsx)(k.ZP,{className:pe,type:"primary",onClick:function(){return d(null==s?void 0:s.last_shixun_identifier)},children:"开始学习"})})]}):(0,ie.jsxs)(y.Z,{className:ue,align:"middle",children:[(0,ie.jsx)(_.Z,{flex:"1",children:(0,ie.jsx)("span",{className:de,children:"还未开始学习"})}),(0,ie.jsx)(_.Z,{children:(0,ie.jsx)(k.ZP,{className:pe,type:"primary",onClick:function(){if((0,le.tJ)(i)&&!(0,K.Jd)()){for(var e,n=0;n<(null==s||null===(t=s.stages)||void 0===t?void 0:t.length);n++){var t,a,r,c=null==s||null===(a=s.stages)||void 0===a?void 0:a[n],l=null==c||null===(r=c.shixuns_list)||void 0===r?void 0:r.find((function(e){return"暂未公开"!==(null==e?void 0:e.shixun_status)}));if(l){e=l.identifier;break}}e?d(e):v.ZP.info("实训暂未公开!")}},children:"开始学习"})})]})})})},xe=(s(43516),s(33511)),ge=s(62449),ve=s(44866),je=s(71681),ye=s(93428),_e=s(74063),be=s(6638),ke=s(94001),Ne=s(77036),we=s(3634),Ze=(0,x.connect)((function(e){var n=e.shixunsDetail,s=e.loading;return{shixunsDetail:n,globalSetting:e.globalSetting,loading:s.models.index}}))((function(e){e.user;var n=e.onReplyDiscuss,s=(e.dispatch,e.id),t=e.activeDiscussIndex,i=e.params,a=(0,h.useState)(""),r=p()(a,2),c=r[0],l=r[1];return console.log(i,"params33"),(0,ie.jsxs)("div",{className:"discuss-item-editor",style:{display:t===s?"block":"none",width:"100%"},children:[(0,ie.jsx)(Ne.Z,{miniToolbar:!0,startInit:t===s,defaultValue:c,id:s,noStorage:!0,watch:!1,height:155,placeholder:"我要回复",showResizeBar:!0,onChange:function(e){l(e)}}),(0,ie.jsx)("a",{onClick:function(){c?(n(s,c),l("")):v.ZP.info("回复内容不能为空!")},className:"btn-send",children:"发送"})]},s)})),Ie=(0,x.connect)((function(e){var n=e.shixunsDetail,s=e.loading;return{shixunsDetail:n,globalSetting:e.globalSetting,loading:s.models.index}}))((function(e){var n=e.user,s=e.upDataList,t=e.params,i=(e.page,e.getTypeNumber,e.dispatch,e.keywords),a=function(){var e=u()(r()().mark((function e(n,t){var a;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,we.ke)({id:n,content:t});case 2:0===(null==(a=e.sent)?void 0:a.status)&&s(1,i);case 4:case"end":return e.stop()}}),e)})));return function(n,s){return e.apply(this,arguments)}}();return(0,ie.jsxs)("div",{className:"discuss-item-container bg-white",children:[(0,ie.jsx)("a",{href:"/users/".concat(n.login),target:"_blank",children:(0,ie.jsx)("img",{alt:"用户头像",height:"50",src:"".concat(je.Z.IMG_SERVER,"/images/").concat(n.image_url),width:"50"})}),(0,ie.jsx)("section",{children:(0,ie.jsx)(Ze,{id:t.pathId,params:t,activeDiscussIndex:t.pathId,onReplyDiscuss:a})})]})})),Se=s(72637);function Ce(e,n){return(0,H.v_)("/discusses/".concat(e,"/top_or_down_discuss.json"),{top:n})}function De(e,n){return(0,H.v_)("/discusses/".concat(e,"/plus.json"),{container_type:"Discuss",type:n?1:0})}function Te(e,n){return(0,H.v_)("/discusses/".concat(e,"/hidden.json"),n)}function Pe(e,n){return(0,H.v_)("/discusses/".concat(e,"/reward_code.json"),n)}function Re(e){return(0,H.ZP)("/api/discusses/".concat(e,".json"),{method:"delete"})}function Ae(e,n){return(0,H.v_)("/discusses/".concat(e,"/reply.json"),{container_type:"Shixun",content:n})}var Le=s(4585),Oe=(s(41129),s(87684));function Ee(e){var n=e.data,s=e.index,t=e.adminOrOperator,i=e.parentDiscussIndex,a=e.shixunIdentifier,r=(e.isDelete,e.user,e.onSetRewardData),c=e.onSetActionType,l=(e.params,e.deleteCommentAlert),o=e.shixunName,u=e.keywords,d=n.author,p=(n.can_delete,n.manage),m=n.content,f=n.hidden,h=n.id,x=n.reward,g=n.time;return(0,ie.jsxs)("div",{className:"second-level-discuss",children:[(0,ie.jsxs)("div",{className:"discuss-info-body",children:[(0,ie.jsxs)("div",{className:"discuss-info",children:[(0,ie.jsx)("a",{href:"/users/".concat(d.login),target:"_blank",children:d.name}),(0,ie.jsx)("span",{className:"grey",children:g}),x?(0,ie.jsxs)("a",{className:"c-orange gift",title:"已奖励金币".concat(x),children:[(0,ie.jsx)("i",{className:"iconfont icon-gift c-orange "}),(0,ie.jsx)("span",{children:x})]}):null]}),(0,ie.jsxs)("div",{className:u?"hidden":"btn-group",children:[t?(0,ie.jsx)("a",{onClick:function(){r({id:h,index:s,user_id:d.user_id,parentDiscussIndex:i})},title:"给TA奖励金币",children:(0,ie.jsx)("i",{className:"iconfont icon-jiangli"})}):null,t?(0,ie.jsx)("a",{onClick:function(){c({id:h,index:s,params:{hidden:f?"0":"1",container_identifier:a},type:"hidden-discuss",parentDiscussIndex:i,message:f?"确定要取消隐藏该条回复吗":"确定要隐藏该条回复吗"})},title:f?"取消隐藏":"隐藏评论",children:(0,ie.jsx)("i",{className:f?"iconfont icon-yincangbiyan":"fa fa-eye"})}):null,p?(0,ie.jsx)("a",{onClick:function(){l?j.Z.info({title:"提示",content:(0,ie.jsxs)("div",{className:"tc",children:[" ","该条评论来自《",o,"》实践项目,您不是该实践项目的管理者,不能删除评论!"]}),onOk:function(){}}):c({id:h,index:s,type:"delete-discuss",parentDiscussIndex:i,message:"确定要删除该条回复吗"})},title:"删除",children:(0,ie.jsx)("i",{className:"iconfont icon-shanchu"})}):null]})]}),(0,ie.jsx)(Le.Z,{className:"discuss-content",value:m,highlightKeywords:u})]})}var Fe=function(e){var n=e.data,s=e.index,t=e.shixunIdentifier,i=e.adminOrOperator,a=e.identity,r=(e.onTopOrDownDiscuss,e.onPlusDiscuss),c=e.onSetActionType,l=e.onSetRewardData,o=e.user,u=e.isDelete,d=e.activeDiscussIndex,p=e.onReplyDiscuss,m=e.onSetActiveDiscussIndex,f=e.params,h=e.keywords,x=n.content,g=n.children,v=n.game_url,y=n.hidden,_=n.id,b=n.position,k=n.praise_count,N=n.reward,w=(n.sticky,n.time),Z=n.user_praise,I=n.game_passed,S=n.delete_comment_alert,C=n.author,D=n.shixun_name,T=n.manage;var P=function(e){var n=e.target,s=n.nodeName,t=n.src;"IMG"===s&&(Oe.Z.publish("preview-image",t),console.log("src:",t))};return(0,ie.jsxs)("div",{className:"discuss-item-container",children:[(0,ie.jsx)("a",{href:"/users/".concat(C.login),target:"_blank",children:(0,ie.jsx)("img",{alt:"用户头像",height:"50",src:"".concat(je.Z.IMG_SERVER,"/images/").concat(C.image_url),width:"50"})}),(0,ie.jsxs)("section",{children:[(0,ie.jsxs)("div",{className:"discuss-info",children:[(0,ie.jsx)("a",{href:"/users/".concat(C.login),target:"_blank",children:C.name}),(0,ie.jsx)("span",{className:"grey",children:w}),b?(0,ie.jsxs)("span",{className:"c-green",children:[" [第",b,"关] "]}):null,v?(0,ie.jsx)("a",{href:v,target:"_blank",className:"view-code",title:"点击查看TA的代码页面",children:"查看"}):null,N?(0,ie.jsxs)("a",{className:"c-orange gift",title:"已奖励金币".concat(N),children:[(0,ie.jsx)("i",{className:"iconfont icon-gift c-orange "}),(0,ie.jsx)("span",{children:N})]}):null,a<=5?(0,ie.jsx)("span",{style:{flex:"1",textAlign:"right",color:1===I?"#29bd8b":""},children:I||0===I?1===I?"已通关":"未通关":""}):null]}),(0,ie.jsx)("div",{onClick:P,children:(0,ie.jsx)(Le.Z,{className:"discuss-content",value:x,highlightKeywords:h})}),g&&g.length>0?(0,ie.jsx)("div",{className:"reply-discuss-container",onClick:P,children:g.map((function(e,n){return(0,ie.jsx)(Ee,{data:e,index:n,deleteCommentAlert:S,shixunName:D,shixunIdentifier:t,adminOrOperator:i,user:o,isDelete:u,onSetRewardData:l,onSetActionType:c,parentDiscussIndex:s,keywords:h},e.id)}))}):null,(0,ie.jsxs)("div",{className:h?"hidden":"btn-group",children:[i?(0,ie.jsx)("a",{onClick:function(){l({id:_,index:s,user_id:C.user_id})},title:"给TA奖励金币",children:(0,ie.jsx)("i",{className:"iconfont icon-jiangli"})}):null,i?(0,ie.jsx)("a",{onClick:function(){c({id:_,index:s,params:{hidden:y?"0":"1",container_identifier:t},type:"hidden-discuss",message:y?"确定要取消隐藏该条回复吗":"确定要隐藏该条回复吗"})},title:y?"取消隐藏":"隐藏评论",children:(0,ie.jsx)("i",{className:y?"iconfont icon-yincangbiyan":"fa fa-eye"})}):null,T&&(!g||0==g.length)&&(0,ie.jsx)("a",{onClick:function(){S?j.Z.info({title:"提示",content:(0,ie.jsxs)("div",{className:"tc",children:[" ","该条评论来自《",D,"》实践项目,您不是该实践项目的管理者,不能删除评论!"]}),onOk:function(){}}):c({id:_,index:s,type:"delete-discuss",message:"确定要删除该条回复吗"})},title:"删除",children:(0,ie.jsx)("i",{className:"iconfont icon-shanchu"})}),(0,ie.jsx)("a",{onClick:function(){m(_)},title:"回复",children:(0,ie.jsx)("i",{className:"iconfont icon-huifu1"})}),(0,ie.jsxs)("a",{onClick:function(){r(_,!Z,s)},className:Z?"c-orange":"",children:[(0,ie.jsx)("i",{className:Z?"iconfont icon-dianzan mr3":"iconfont icon-dianzan-xian mr3 "}),(0,ie.jsx)("span",{children:k||""})]})]}),(0,ie.jsx)(Ze,{id:_,params:f,activeDiscussIndex:d,onReplyDiscuss:p})]})]},_)},ze={showRewardDialog:!1,data:null,page:1,loading:!1,actionType:null,activeDiscussIndex:null};function Ve(e,n){switch(n.type){case Se.tD:return l()(l()({},e),{},{loading:!0});case Se.RS:return l()(l()({},e),{},{showRewardDialog:!0});case Se.t2:return l()(l()({},e),{},{showRewardDialog:!1});case Se.GR:case Se.u8:case Se.rM:case Se.yS:case Se.Vn:case Se.SX:return l()(l()({},e),n.payload);default:throw new Error}}var Ge=function(e){var n=e.shixunIdentifier,s=e.identity,t=e.activeIndex,i=e.user,a=e.isShixunDetail,c=void 0!==a&&a,o=e.isDelete,d=e.getTypeNumber,m=e.params,f=e.getData,x=e.isNotDiscuss,g=e.keywords,v=e.setTypeCount,y=(0,h.useReducer)(Ve,ze),_=p()(y,2),b=_[0],k=_[1],N=b.page,w=b.loading,Z=b.data,I=b.actionType,S=b.showRewardDialog,C=b.activeDiscussIndex,D=(0,h.useRef)(),T=(0,h.useRef)();function P(e){return R.apply(this,arguments)}function R(){return(R=u()(r()().mark((function e(n){var s;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!w){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,k({type:Se.tD}),e.next=6,(0,we.Mu)({coursesId:null==m?void 0:m.pathId,page:n,keywords:g});case 6:s=e.sent,v(null==s?void 0:s.disscuss_count),k({type:Se.GR,payload:{activeDiscussIndex:null,page:n,data:s,loading:!1}}),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(2),console.log(e.t0);case 14:case"end":return e.stop()}}),e,null,[[2,11]])})))).apply(this,arguments)}function A(e){document.body.scrollIntoView(),P(e)}function L(e,n,s){return O.apply(this,arguments)}function O(){return(O=u()(r()().mark((function e(n,s,t){var i;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,De(n,s);case 3:i=e.sent,Q[t].user_praise=s,Q[t].praise_count=i.praise_count,k({type:Se.rM,payload:{data:l()(l()({},Z),{},{comments:Q})}}),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),console.log(e.t0);case 12:case"end":return e.stop()}}),e,null,[[0,9]])})))).apply(this,arguments)}function E(e,n,s){return F.apply(this,arguments)}function F(){return(F=u()(r()().mark((function e(n,s,t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ce(n,s);case 3:Q[t].sticky=s,k({type:Se.u8,payload:{data:l()(l()({},Z),{},{comments:Q})}}),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.log(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function z(){return z=u()(r()().mark((function e(){var n,s,t,i,a,c,o,u;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=I.id,s=I.params,t=I.type,i=I.index,a=I.parentDiscussIndex,"hidden-discuss"!==t){e.next=6;break}return e.next=4,Te(n,s);case 4:a?Q[a].children[i].hidden=1==s.hidden:Q[i].hidden=1==s.hidden,k({type:Se.yS,payload:{actionType:null,data:l()(l()({},Z),{},{comments:Q})}});case 6:if("delete-discuss"!==t){e.next=31;break}return e.next=9,Re(n);case 9:if(!a&&0!==a){e.next=22;break}c=Q[a].children,o=c.length-1;case 12:if(!(o>=0)){e.next=19;break}if(c[o].id!==n){e.next=16;break}return c.splice(o,1),e.abrupt("break",19);case 16:o--,e.next=12;break;case 19:Q[a].children=c,e.next=30;break;case 22:u=Q.length-1;case 23:if(!(u>=0)){e.next=30;break}if(Q[u].id!==n){e.next=27;break}return Q.splice(u,1),e.abrupt("break",30);case 27:u--,e.next=23;break;case 30:k({type:Se.yS,payload:{actionType:null,data:l()(l()({},Z),{},{comments:Q})}});case 31:case"end":return e.stop()}}),e)}))),z.apply(this,arguments)}function V(e){k({type:Se.yS,payload:{actionType:e}})}function G(){return(G=u()(r()().mark((function e(){var n,s,t,i,a,c,o;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=D.current,s=n.id,t=n.index,i=n.score,a=n.user_id,c=n.parentDiscussIndex,e.next=3,Pe(s,{container_type:"Discusses",score:i,user_id:a});case 3:o=e.sent,c?Q[c].children[t].reward=o.code:Q[t].reward=o.code,k({type:Se.Vn,payload:{showRewardDialog:!1,data:l()(l()({},Z),{},{comments:Q})}}),D.current=null;case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function M(e){D.current=e,k({type:Se.RS})}function J(e,n){return q.apply(this,arguments)}function q(){return(q=u()(r()().mark((function e(n,s){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ae(n,s);case 3:P(N),f(),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.log(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function H(e){k(C===e?{type:Se.SX,payload:{activeDiscussIndex:null}}:{type:Se.SX,payload:{activeDiscussIndex:e}})}if((0,h.useEffect)((function(){function e(){return(e=u()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(3!==t||Z||!n){e.next=3;break}return e.next=3,P(N);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[m.pathId,g]),(0,h.useEffect)((function(){P()}),[g]),!Z)return!c&&(0,ie.jsx)(ye.Z,{});var U=Z.disscuss_count,Q=Z.comments,X=(Z.all,Z.can_hidden);return(0,ie.jsxs)(h.Fragment,{children:[(0,ie.jsxs)("div",{className:"discuss-container discuss-warp-container",ref:T,children:[!c&&w?(0,ie.jsx)(ye.Z,{}):null,0===U?(0,ie.jsx)("div",{style:{display:"flex"},children:(0,ie.jsx)(be.Z,{})}):null,(0,K.bg)()&&!x&&!g&&(0,ie.jsx)(Ie,{getTypeNumber:d,upDataList:P,page:N,user:i,params:m,keywords:g}),(0,ie.jsx)("aside",{className:"bg-white",children:null==Q?void 0:Q.map((function(e,t){return(0,ie.jsx)(Fe,{user:i,data:e,index:t,identity:s,onPaginationChange:A,shixunIdentifier:n,isDelete:o,onSetActionType:V,onTopOrDownDiscuss:E,adminOrOperator:X,onPlusDiscuss:L,onSetRewardData:M,activeDiscussIndex:C,onSetActiveDiscussIndex:H,onReplyDiscuss:J,keywords:g},e.id)}))}),U>10?(0,ie.jsx)("div",{className:"pagination-container tc",children:(0,ie.jsx)(B.Z,{showQuickJumper:!0,showSizeChanger:!1,onChange:A,current:N,total:U})}):null]}),(0,ie.jsxs)(_e.Z,{children:[(0,ie.jsx)(j.Z,{centered:!0,title:"提示",open:!!I,onOk:function(){return z.apply(this,arguments)},onCancel:function(){k({type:Se.yS,payload:{actionType:null}})},children:(0,ie.jsx)("p",{children:I?I.message:""})}),(0,ie.jsx)(j.Z,{centered:!0,width:400,title:"奖励设置",open:S,onCancel:function(){k({type:Se.t2})},onOk:function(){return G.apply(this,arguments)},children:(0,ie.jsx)(ke.Z,{placeholder:"请输入奖励的金币数量",min:1,onChange:function(e){D.current.score=e},style:{width:"228px"}})})]})]})},Me=s(48410),Je=["classroomList","user","globalSetting","loading","dispatch"],qe=(0,x.connect)((function(e){var n=e.classroomList,s=e.user,t=e.loading;return{classroomList:n,user:s,globalSetting:e.globalSetting,loading:t.models.index}}))((function(e){var n,s=e.classroomList,t=e.user,a=e.globalSetting,c=(e.loading,e.dispatch),o=(f()(e,Je),(0,x.useParams)()),d=s.detailTopBanner,m=(0,h.useState)([]),C=p()(m,2),D=C[0],T=C[1],J=(0,h.useState)({}),q=p()(J,2),B=q[0],Q=q[1],X=(0,h.useState)(-1),W=p()(X,2),Y=W[0],$=W[1],ee=(0,h.useState)(!1),ne=p()(ee,2),se=ne[0],te=ne[1],ae=(0,h.useState)({name:"",is_jupyter:!1}),re=p()(ae,2),oe=re[0],ue=re[1],de=g.Z.useForm(),pe=p()(de,1)[0],me=g.Z.useForm(),fe=p()(me,1)[0],ye=g.Z.useForm(),_e=p()(ye,1)[0],ke=(0,h.useState)(!1),Ne=p()(ke,2),we=Ne[0],Ze=Ne[1],Ie=(0,h.useState)(),Se=p()(Ie,2),Ce=Se[0],De=Se[1],Te=(0,h.useState)([]),Pe=p()(Te,2),Re=Pe[0],Ae=Pe[1],Le=(0,h.useState)(),Oe=p()(Le,2),Ee=Oe[0],Fe=Oe[1],ze=(0,h.useState)("All"),Ve=p()(ze,2),qe=Ve[0],Be=Ve[1],He=(0,h.useState)(!0),Ue=p()(He,2),Ke=Ue[0],Qe=Ue[1],Xe=(0,h.useState)(0),We=p()(Xe,2),Ye=We[0],$e=We[1],en=(0,h.useState)(""),nn=p()(en,2),sn=nn[0],tn=nn[1],an=(0,h.useState)(0),rn=p()(an,2),cn=rn[0],ln=rn[1],on=(0,h.useState)([{name:"全部",totalName:"课程学习",type:"All",number:0},{name:"实践项目",totalName:"实践项目",type:"Shixun",number:0},{name:"视频项目",totalName:"视频项目",type:"VideoItem",number:0},{name:"教学课件",totalName:"教学课件",type:"Attachment",number:0},{name:"讨论",totalName:"讨论",type:"Discusses",number:0}]),un=p()(on,2),dn=un[0],pn=un[1];(0,h.useEffect)((function(){jn()}),[null==o?void 0:o.coursesId]),(0,h.useEffect)((function(){"目录重命名成功"===s.actionTabs.key&&jn()}),[s.actionTabs.key]),(0,h.useEffect)((function(){fn()}),[B]),(0,h.useEffect)((function(){var e=D.map((function(e){return e.items})),n=0;e.map((function(e){e.map((function(e){!new RegExp(sn,"ig").test(e.name)||e.item_type!==qe&&"All"!==qe||n++}))})),n>dn.find((function(e){return e.type===qe})).number&&(n=dn.find((function(e){return e.type===qe})).number),ln(n)}),[D,qe,sn]);var mn=function(){var e=u()(r()().mark((function e(n){var s;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,U.Ex)(l()({},n));case 2:return s=e.sent,D[Y].items=n.list,e.abrupt("return",s);case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),fn=function(){var e=B.shixuns_count,n=void 0===e?0:e,s=B.videos_count,t=void 0===s?0:s,i=B.pdf_attachments_count,a=void 0===i?0:i,r=B.disscuss_count,c={All:n+t+a,Shixun:n,VideoItem:t,Attachment:a,Discusses:void 0===r?0:r},o=dn.map((function(e){return l()(l()({},e),{},{number:c[e.type]})}));pn(o)},hn=function(){Y===D.length-1&&Ce&&(Cn(),T(D.filter((function(e,n){return n!==D.length-1})))),jn(),$(-1)},xn=function(e,n){In()&&($(e),pe.setFieldsValue({name:n.stage_name,description:n.stage_description}))},gn=function(e){var n;setTimeout((function(){document.documentElement.scrollTop=Ye}),300),"取消"!==e&&(D[Y].items=null===(n=D[Y].items)||void 0===n?void 0:n.concat(e),T(i()(D)))},vn=function(){var e=u()(r()().mark((function e(n){var s,t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,U.A2)(l()({id:D[Y].stage_id,course_id:o.coursesId},n));case 2:return(s=e.sent).id&&(Fe(!1),t=[l()({},s)],D[Y].items=D[Y].items.concat(t),T(i()(D))),e.abrupt("return",s);case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),jn=function(){var e=u()(r()().mark((function e(){var n;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Qe(!0),e.next=3,(0,U.R7)({coursesId:null==o?void 0:o.coursesId});case 3:(null==(n=e.sent)?void 0:n.stages)&&T(null!=n&&n.stages?i()(null==n?void 0:n.stages):[]),Q(n?l()({},n):{}),console.log("---------",B),Qe(!1),Cn(),$(-1);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),yn=function(){var e=u()(r()().mark((function e(n,s){var t,i,a,c;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=n&&n.name){e.next=2;break}return e.abrupt("return",v.ZP.info("请先输入章节名称!"));case 2:if(Cn(),i=[],null===(t=D[Y][s||"shixuns_list"])||void 0===t||t.map((function(e){i.push({type:e.item_type,id:e.id})})),!Ce){e.next=12;break}return e.next=8,(0,U.CI)(l()(l()({},n),{},{coursesId:o.coursesId,list:i}));case 8:(a=e.sent)&&(D[Y]=l()(l()({},D[Y]),a)),e.next=16;break;case 12:return e.next=14,(0,U.xn)(l()(l()({},n),{},{id:D[Y].stage_id,type:Array.from(new Set(i.map((function(e){return e.type})))),list:i}));case 14:(c=e.sent)&&(D[Y]=l()(l()({},D[Y]),c));case 16:case"end":return e.stop()}}),e)})));return function(n,s){return e.apply(this,arguments)}}(),_n=function(e,n){j.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确定删除该实训吗?",onOk:function(){D[Y][n||"shixuns_list"].splice(e,1),v.ZP.success("删除成功"),T(i()(D)),yn(pe.getFieldsValue(),n)}})},bn=function(e){var n;j.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确定删除该章节吗?",onOk:(n=u()(r()().mark((function n(){return r()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,U.WW)(l()({},e));case 2:0===n.sent.status&&($(-1),v.ZP.success("删除成功"),jn());case 4:case"end":return n.stop()}}),n)}))),function(){return n.apply(this,arguments)})})},kn=function(){ue({name:"",is_jupyter:!1}),fe.setFieldsValue({name:"",is_jupyter:!1}),te(!1)},Nn=function(e,n){if(e.destination){var s=function(e,n,s){var t=Array.from(e),i=t.splice(n,1),a=p()(i,1)[0];return t.splice(s,0,a),t}(D[Y][n||"shixuns_list"],e.source.index,e.destination.index);D[Y][n||"shixuns_list"]=s,T(i()(D)),yn(pe.getFieldsValue(),n)}},wn=function(){var e=u()(r()().mark((function e(n){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(In()){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,(0,U.ms)({id:n});case 4:0===e.sent.status&&jn();case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),Zn=function(){var e=u()(r()().mark((function e(n){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(In()){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,(0,U.yy)({id:n});case 4:0===e.sent.status&&jn();case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),In=function(){return-1===Y||(j.Z.info({centered:!0,width:400,okText:"知道啦",icon:null,title:"提示",content:(0,ie.jsx)("div",{className:"tc font14",children:"当前单元有未保存的修改记录,请先保存!"}),onOk:function(){var e="Edit_".concat(Y),n=document.getElementById(e);n&&setTimeout((function(){return n.scrollIntoView({block:"start",behavior:"smooth"})}))}}),!1)},Sn=function(){yn(pe.getFieldsValue())},Cn=function(){De(!1)},Dn=function(e,n){var s,d,p,m,f;if("All"!==qe&&(null===(s=e.stage_tag)||void 0===s||!s.includes(qe)))return null;var h=e.items.filter((function(e){return new RegExp(sn,"ig").test(e.name)&&(e.item_type===qe||"All"===qe)}));return sn&&null!=h&&h.length||!sn?(0,ie.jsxs)("section",{className:"bg-white pt30 mb20 pb20 pl10 pr10",children:[(0,ie.jsxs)("aside",{className:"pl20 pr20",children:[(0,ie.jsxs)(y.Z,{gutter:[5,20],align:"middle",style:{lineHeight:"16px"},children:[(0,ie.jsx)(_.Z,{flex:"22px",children:(0,ie.jsx)("span",{className:R,children:(0,ie.jsx)("i",{className:"iconfont icon-zhangjie2 font18"})})}),(0,ie.jsx)(_.Z,{flex:1,className:"tl font18 bold c-grey-333",children:e.stage_name||"第".concat(null==D?void 0:D.length,"部分")}),(0,ie.jsxs)(_.Z,{children:[(0,K.GJ)()&&Y===n&&!Ce&&(0,ie.jsx)(b.Z,{title:"删除",children:(0,ie.jsx)("span",{onClick:function(){var n,s;n=e.stage_id,j.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确定删除该章节吗?",onOk:(s=u()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,U._V)({id:n});case 2:0===e.sent.status&&($(-1),v.ZP.success("删除成功"),jn());case 4:case"end":return e.stop()}}),e)}))),function(){return s.apply(this,arguments)})})},className:"iconfont icon-shanchu c-grey-c"})}),(0,K.GJ)()&&Y!==n&&"All"===qe&&!sn&&(0,ie.jsxs)("div",{children:[n>0&&(0,ie.jsx)(b.Z,{title:"向上移动",children:(0,ie.jsx)("span",{onClick:function(){return wn(e.stage_id)},className:"iconfont icon-xiangshangyi c-light-green font18 current"})}),n<D.length-1&&(0,ie.jsx)(b.Z,{title:"向下移动",children:(0,ie.jsx)("span",{onClick:function(){return Zn(e.stage_id)},className:"iconfont icon-xiangxiayi c-light-green font18 current ml5"})}),!Ce&&(0,ie.jsx)(b.Z,{title:"编辑",children:(0,ie.jsx)("span",{onClick:function(){return xn(n,e)},className:"iconfont icon-bianjidaibeijing c-light-green font20 current ml5"})})]})]})]}),(0,ie.jsx)(y.Z,{gutter:[5,20],style:{marginTop:12},children:(0,ie.jsx)(_.Z,{span:24,children:(0,ie.jsx)("div",{dangerouslySetInnerHTML:{__html:null===(d=e.stage_description)||void 0===d?void 0:d.replace(/[\r|\n]/gi,"<br/>")}})})})]}),Y===n&&(0,ie.jsxs)("div",{className:"pl20 pr20 pt20",children:[(0,ie.jsxs)("aside",{children:[(0,ie.jsx)(g.Z.Item,{name:"name",label:"名称",rules:[{required:!0,message:"名称不能为空"}],children:(0,ie.jsx)(N.Z,{size:"middle",maxLength:60,placeholder:"请输入第".concat(null==D?void 0:D.length,"阶段名称,最大限制60个字符"),onBlur:Sn})}),(0,ie.jsx)(g.Z.Item,{name:"description",label:"描述",rules:[{required:!0,message:"描述不能为空"}],children:(0,ie.jsx)(N.Z.TextArea,{rows:5,maxLength:300,placeholder:"请输入第".concat(null==D?void 0:D.length,"阶段描述"),onBlur:Sn})})]}),(0,ie.jsxs)("aside",{style:{display:"flex",justifyContent:"space-evenly"},children:[(0,ie.jsxs)(k.ZP,{size:"middle",className:"mt10",onClick:function(){if(!D[Y].stage_id)return v.ZP.info("请先输入章节名称!");(0,le.tJ)(c)&&(0,le.xY)()&&(te(!0),fe.setFieldsValue({name:"",is_jupyter:!1}))},children:[(0,ie.jsx)("span",{className:"iconfont icon-tianjiafangda mr5 "}),"新建实践项目"]}),(0,ie.jsx)("br",{}),(0,ie.jsxs)(k.ZP,{size:"middle",className:"mt10",onClick:function(){var n;if(!D[Y].stage_id)return v.ZP.info("请先输入章节名称!");$e(document.documentElement.scrollTop),c({type:"classroomList/setActionTabs",payload:{key:"选用实践项目",id:D[Y].stage_id,course_id:o.coursesId}}),Ae(null==e||null===(n=e.shixuns_list)||void 0===n?void 0:n.map((function(e){return e.id})))},children:[(0,ie.jsx)("span",{className:"iconfont icon-tianjiafangda mr5"}),"选用实践项目"]}),(0,ie.jsx)("br",{}),!(null!=a&&null!==(p=a.setting)&&void 0!==p&&p.is_local)&&(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsxs)(k.ZP,{size:"middle",className:"mt10",onClick:function(){var e,n;if(!D[Y].stage_id)return v.ZP.info("请先输入章节名称!");(null!==(e=t.userInfo)&&void 0!==e&&e.admin||null!==(n=t.userInfo)&&void 0!==n&&n.is_teacher&&(0,le.O5)())&&Fe(!0)},children:[(0,ie.jsx)("span",{className:"iconfont icon-tianjiafangda mr5 "}),"新建视频项目"]}),(0,ie.jsx)("br",{})]}),(0,ie.jsxs)(k.ZP,{size:"middle",className:"mt10",onClick:function(){if(!D[Y].stage_id)return v.ZP.info("请先输入章节名称!");(0,le.tJ)(c)&&(0,le.xY)()&&(Ze(!0),_e.resetFields())},children:[(0,ie.jsx)("span",{className:"iconfont icon-tianjiafangda mr5 "}),"新建教学课件"]}),(0,ie.jsx)("br",{})]}),(0,ie.jsx)("aside",{className:"c-light-black mt10 pb20",id:"Edit_".concat(n),children:"下面实训可以通过拖拽进行排序调整"})]}),!(null===(m=e.attachments_list)||void 0===m||!m.length)&&(0,ie.jsx)(w.Z,{}),(0,ie.jsx)("aside",{className:A,children:Y===n?(0,ie.jsx)(S.Z5,{onDragEnd:function(e){return Nn(e,"attachments_list")},children:(0,ie.jsx)(S.bK,{droppableId:"droppable-id2",children:function(s,t){var i;return(0,ie.jsx)("div",l()(l()({className:"mt20",ref:s.innerRef},s.droppableProps),{},{onScroll:function(){},children:null===(i=e.attachments_list)||void 0===i?void 0:i.map((function(e,s){return(0,ie.jsx)(S._l,{draggableId:"".concat(e.id.toString(),"-").concat(n,"-").concat(s),index:s,children:function(t,i){return(0,ie.jsx)("div",l()(l()(l()({ref:t.innerRef},t.draggableProps),t.dragHandleProps),{},{children:(0,ie.jsxs)(y.Z,{className:"list-item-row",align:"middle",gutter:[5,10],children:[(0,ie.jsx)(_.Z,{children:(0,ie.jsx)("i",{className:"iconfont icon-kejian1 c-cyan-blue font20"})}),(0,ie.jsx)(_.Z,{flex:"1",children:(0,ie.jsx)("a",{className:"c-grey-333",href:je.Z.IMG_SERVER+e.url,target:"_blank",children:e.name})}),(0,ie.jsx)(_.Z,{children:Y===n&&(0,ie.jsx)("div",{children:(0,ie.jsx)(b.Z,{title:"删除",children:(0,ie.jsx)("span",{onClick:function(){_n(s,"attachments_list")},className:"iconfont icon-shanchu c-grey-c"})})})})]},s)}))}},e.id)}))}))}})}):(0,ie.jsx)("div",{className:"mt20",children:null===(f=e.attachments_list)||void 0===f?void 0:f.map((function(e,n){return(0,ie.jsx)("div",{children:(0,ie.jsxs)(y.Z,{className:"list-item-row",align:"middle",gutter:[5,10],children:[(0,ie.jsx)(_.Z,{children:(0,ie.jsx)("i",{className:"iconfont icon-kejian1 c-cyan-blue font20"})}),(0,ie.jsx)(_.Z,{children:(0,ie.jsx)("a",{className:"c-grey-333",href:je.Z.IMG_SERVER+e.url,target:"_blank",children:e.name})})]},n)})}))})}),!(null==h||!h.length)&&(0,ie.jsx)(ve.Z,{visibleType:qe,data:i()(h),stage_id:e.stage_id,disabled:Y!==n,deleteStages:bn,updateSort:mn,subject_id:null==B?void 0:B.subject_id,course_id:null==o?void 0:o.coursesId,index:n,cust_seq:!0,hiddenEditBtn:!0,keywords:sn,showVideoPlay:!0}),Y===n&&(0,ie.jsxs)("aside",{className:L,children:[(0,ie.jsx)(k.ZP,{onClick:hn,type:"primary",size:"middle",ghost:!0,children:"取消"}),(0,ie.jsx)(k.ZP,{onClick:hn,size:"middle",type:"primary",children:"保存"})]})]},n):null},Tn=d.start_date,Pn=d.course_end||P()(P()().format("L")).valueOf()<P()(Tn).valueOf();console.log(Pn,444);var Rn=function(){};return(0,ie.jsxs)("section",{className:"mb50",children:[(0,ie.jsx)(he,{data:B,dispatch:c,onReloadData:jn}),(0,ie.jsxs)("aside",{style:{justifyContent:"space-between",display:"flex",background:"#fff",alignItems:"center",paddingRight:"20px"},children:[(0,ie.jsx)("div",{className:F,children:dn.map((function(e,n){if(null!=D&&D.some((function(n){var s;return null===(s=n.stage_tag)||void 0===s?void 0:s.includes(e.type)}))||"All"==e.type||"Discusses"===e.type)return(0,ie.jsx)("div",{className:e.type===qe?G:z,onClick:function(){-1===Y?(Be(e.type),$(-1)):v.ZP.warning("请先取消编辑状态")},children:(0,ie.jsx)("div",{className:V,children:e.name})},n)}))}),(0,ie.jsxs)("div",{style:{display:"flex",justifyContent:"center"},children:[(0,ie.jsx)(Me.t7,{style:{width:222,marginTop:"-3px"},className:(0,K.G5)()?"mr20":"",placeholder:"请输入名称进行搜索",onChange:function(e){var n;-1===Y?(tn(null===(n=decodeURIComponent(e))||void 0===n?void 0:n.trim()),$(-1)):v.ZP.warning("请先取消编辑状态")}}),(0,K.G5)()&&(0,ie.jsx)(k.ZP,{type:"primary",onClick:u()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:j.Z.confirm({title:"提示",content:"同步开放课程资源后,会造成在线学习内所有资源强制同步为最新开放课程内容,是否继续同步?",okText:"同步",cancelText:"取消",onOk:function(){var e=u()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,H.ZP)("/api/courses/sync_stages.json",{method:"post",body:{classroom_identifier:null==o?void 0:o.coursesId}});case 2:0===e.sent.status&&jn();case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()});case 1:case"end":return e.stop()}}),e)}))),children:"更新"})]})]}),(0,ie.jsxs)("div",{className:M,children:["共",(0,ie.jsx)("span",{children:sn?cn:dn.find((function(e){return e.type===qe})).number}),"个",dn.find((function(e){return e.type===qe})).totalName]}),sn&&0===cn&&"Discusses"!==qe&&(0,ie.jsx)(be.Z,{styles:{margin:"0 auto",padding:"100px 0",backgroundColor:"#fff"}}),(0,ie.jsx)(Z.Z,{loading:Ke,active:!0,avatar:{size:40},paragraph:{rows:5},className:"mt30",children:"Discusses"!==qe&&(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(g.Z,{form:pe,onFinish:yn,children:null==D?void 0:D.map((function(e,n){return(0,ie.jsx)("div",{children:Dn(e,n)},n)}))}),(0,K.GJ)()&&!Ce&&"All"===qe&&-1===Y&&!sn&&(0,ie.jsxs)("div",{className:O,onClick:function(){var e={shixuns_list:[],items:[]};xn(D.length,e),T([].concat(i()(D),[e])),De(!0)},children:[(0,ie.jsx)("span",{className:E,children:"+点击新建阶段"}),"(添加一个或多个实训/视频项目,组成一个阶段)"]})]})}),"Discusses"===qe&&(0,ie.jsx)("aside",{style:{paddingTop:25,background:"#fff"},children:(0,ie.jsx)(Ge,{activeIndex:3,isNotDiscuss:Pn,getData:jn,shixunIdentifier:11,coursesId:null==o?void 0:o.coursesId,params:{pathId:null==o?void 0:o.coursesId},identity:null===(n=t.userInfo)||void 0===n?void 0:n.role,getTypeNumber:fn,user:t.userInfo,isShixunDetail:!0,keywords:sn,setTypeCount:ln})}),(0,ie.jsx)(j.Z,{centered:!0,title:"新建实践项目",open:se,onOk:u()(r()().mark((function e(){var n;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fe.validateFields();case 2:return e.next=4,(0,U.vf)(l()({id:D[Y].stage_id,course_id:o.coursesId},oe));case 4:n=e.sent,kn(),n.id&&(v.ZP.success("添加成功"),gn([n]));case 7:case"end":return e.stop()}}),e)}))),onCancel:kn,children:(0,ie.jsxs)(g.Z,{form:fe,onValuesChange:function(e){ue(l()(l()({},oe),e))},children:[(0,ie.jsx)(g.Z.Item,{label:"实训类型",name:"is_jupyter",rules:[{required:!0,message:"请选择实训类型"}],children:(0,ie.jsxs)(I.ZP.Group,{children:[(0,ie.jsx)(I.ZP,{defaultChecked:!0,value:!1,children:"普通实训"}),(0,ie.jsx)(I.ZP,{value:!0,children:"jupyter实训"})]})}),(0,ie.jsx)(g.Z.Item,{label:"实训名称",name:"name",rules:[{required:!0,message:"请输入实训名称"}],children:(0,ie.jsx)(N.Z,{maxLength:60,suffix:(0,ie.jsxs)("span",{children:[oe.name.length,"/60"]})})})]})}),(0,ie.jsx)(j.Z,{centered:!0,title:"新建教学课件",open:we,onOk:u()(r()().mark((function e(){var n;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_e.validateFields();case 2:return e.next=4,_e.getFieldsValue();case 4:return n=e.sent,e.next=7,(0,U.s0)({id:D[Y].stage_id,course_id:o.coursesId,attachment_ids:n.files.map((function(e){return e.response.id}))});case 7:0===e.sent.status&&(v.ZP.success("添加成功"),Ze(!1),s=i()(n.files),t=void 0,s.map((function(e){return e.type="Attachment",e.id=e.id||e.response.id,e.url="/api/attachments/".concat(e.id||e.response.id),e})),D[Y].items=null===(t=D[Y].items)||void 0===t?void 0:t.concat(s),T(i()(D)));case 9:case"end":return e.stop()}var s,t}),e)}))),onCancel:function(){return Ze(!1)},children:(0,ie.jsxs)(g.Z,{form:_e,children:[(0,ie.jsx)(g.Z.Item,{label:"课件内容",name:"files",rules:[{required:!0,message:"请上传课件内容"}],children:(0,ie.jsx)(ge.Z,{maxSize:100,accept:"application/pdf",number:10})}),(0,ie.jsx)(g.Z.Item,{label:"知识标签",name:"test_lyl",children:(0,ie.jsx)(N.Z,{onClick:function(){return Rn}})}),(0,ie.jsxs)("div",{children:[(0,ie.jsx)("span",{className:"c-red",children:"注意:"}),(0,ie.jsx)("br",{}),"1、上传课件,即表示您已同意",(0,ie.jsx)(x.Link,{target:"_blank",to:"/users/mmipb3zhj/videos/protocol",children:"上传内容协议"}),",不得上传未经他人授权的作品;",(0,ie.jsx)("br",{}),"2、不支持断点续传,单个文件大小请勿超过100M;",(0,ie.jsx)("br",{}),"3、当前仅限支持pdf文件;",(0,ie.jsx)("br",{}),"4、文件名将被自动读取为系统内该课件的名称,上传前请注意这一点;",(0,ie.jsx)("br",{}),"5、一次最多上传10个文件。"]})]})}),(0,ie.jsx)(ce,{shixunIds:Re,cb:gn}),(0,ie.jsx)(xe.Z,{visible:Ee,onCancel:function(){return Fe(!1)},onOk:vn})]})}))}}]); |