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.
1 line
30 KiB
1 line
30 KiB
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[18307],{7406:function(e,n,t){var r=t(82242),o=t.n(r),i=(t(59301),t(93314)),s=t(3113),a=t(37712);n.Z=function(e){var n=e.img,t=e.buttonProps,r=void 0===t?{}:t,c=e.styles,l=void 0===c?{}:c,u=e.customText,d=e.ButtonText,p=e.ButtonClick,_=e.Buttonclass,x=e.ButtonTwo,h=e.imgStyles,m=e.loading,f=void 0!==m&&m;return(0,a.jsxs)("section",{className:"tc animated fadeIn",style:o()(o()({},{color:"#999",margin:"100px auto",visibility:f?"hidden":"visible"}),l),children:[(0,a.jsx)("img",{src:n||i,style:o()(o()({},h),{},{pointerEvents:"none",userSelect:"none"})}),(0,a.jsx)("p",{className:"mt20 font14",children:u||"暂时还没有相关数据哦!"}),d&&(0,a.jsx)(s.ZP,o()(o()({className:_,onClick:p},r),{},{children:d})),x&&x]})}},14515:function(e,n,t){t.r(n),t.d(n,{default:function(){return se}});var r=t(7557),o=t.n(r),i=t(82242),s=t.n(i),a=t(37205),c=t.n(a),l=t(41498),u=t.n(l),d=t(79800),p=t.n(d),_=t(39647),x=t.n(_),h=t(59301),m=t(7880),f=t(43418),g=t(8591),v=t(6848),j=t(87876),y=t(88590),w=t(8772),b=t(3113),Z=t(24905),N=t(95237),k=t(43604),C={flex_box_center:"flex_box_center___wA4I5",flex_space_between:"flex_space_between___r6nwi",flex_box_vertical_center:"flex_box_vertical_center___Wefy1",flex_box_center_end:"flex_box_center_end___Vp84k",flex_box_column:"flex_box_column___fcUbn",wrap:"wrap___MiRCb",midWrap:"midWrap___o5A2g",color999:"color999___kvLjS",orderWrap:"orderWrap___h5SIu",orderIconWrap:"orderIconWrap___IYG5m",orderAsc:"orderAsc___gyCKC",orderDesc:"orderDesc___wkX1B",color0152d9:"color0152d9___yLS1b",h10:"h10___T4vHk",cursorPointer:"cursorPointer___6JPpk",orderTextWrap:"orderTextWrap___oqfoU",cardWrap:"cardWrap___tGc2X",countWrap:"countWrap___MMe2I",colorFEB300:"colorFEB300___wW27n",modalContent:"modalContent___MMaQo",type:"type___EdWvO",group:"group___jtM4s",add:"add___rC163"},S=t(7406),I=t(18889),P=t(85062),W={flex_box_center:"flex_box_center___fhaQT",flex_space_between:"flex_space_between___IKRgA",flex_box_vertical_center:"flex_box_vertical_center___lbozn",flex_box_center_end:"flex_box_center_end___pDq44",flex_box_column:"flex_box_column___RZzgu",wrap:"wrap___G5hQ4",createIconWrap:"createIconWrap___e9K9f",createIcon:"createIcon___koLsC",leftIcon:"leftIcon___y91Ne",rightIcon:"rightIcon___UQ4Fq",createTextWrap:"createTextWrap___fTr2V",createText:"createText___JMNOe",tagWrap:"tagWrap___rr9RH",tagName:"tagName___g6Ruo",tagJupyterWrap:"tagJupyterWrap___BkdHH",tagJupyterNameWrap:"tagJupyterNameWrap___Z6iCu",tagJupyterName:"tagJupyterName___reott",imgWrap:"imgWrap___xDlh5",cardBottom:"cardBottom___r9Ujh",bottomName:"bottomName___XyvlX",bottomCountProgressWrap:"bottomCountProgressWrap___vM84t",bottomCount:"bottomCount___K_YvT",action:"action___muO9d",colorFF8E02:"colorFF8E02___istLu",sign:"sign___pwX3C",bottomNameWrap:"bottomNameWrap___cWaZc"},T=t(6457),E=t(96908),O=t(57177),D=t(81378),R=t(37712),A=function(e){var n=e.data,t=e.params,r=void 0===t?{}:t,i=e.user,s=e.onCancelCollect,a=void 0===s?function(){}:s,c=e.onRemove,l=void 0===c?function(){}:c;return(0,R.jsx)(h.Fragment,{children:n&&n.map((function(e,n){var t,s;return(0,R.jsx)("a",{className:W.wrap,onClick:u()(o()().mark((function n(){var t,r;return o()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,P.Ee)({id:e.identifier});case 2:null!=(r=n.sent)&&null!==(t=r.exercise)&&void 0!==t&&t.length?f.Z.info({title:"考试场景告知",content:(0,R.jsxs)(N.Z,{children:[(0,R.jsx)(k.Z,{children:"当前实训已被考试调用,且您正在参加本次考试。考试场景下必须从试卷中进入并答题,否则答题结果不计入成绩。请点击试卷名称进入考试。"}),(0,R.jsx)(k.Z,{children:(0,R.jsx)("aside",{className:"mt10",children:null==r?void 0:r.exercise.map((function(e,n){return(0,R.jsx)("div",{children:(0,R.jsx)("a",{href:"/classrooms/".concat(e.course_id,"/exercise/").concat(e.id,"/detail?random=").concat(e.random),children:e.name})})}))})})]})}):(0,T.xg)("/shixuns/".concat(e.identifier,"/challenges"));case 4:case"end":return n.stop()}}),n)}))),children:(0,R.jsxs)(I.Z,{className:"animated fadeIn ".concat(W.cardWrap),children:["collect"===r.category&&(0,R.jsx)("div",{className:"".concat(W.action," user-shixun-items"),onClick:function(n){n.stopPropagation(),a(e.id)},children:(0,R.jsx)(v.Z,{title:"取消收藏",children:(0,R.jsx)("i",{className:"iconfont icon-shoucang3 font24 mr5 ".concat(W.colorFF8E02)})})}),"study"===r.category&&r.username===(null===(t=i.userInfo)||void 0===t?void 0:t.login)&&(0,R.jsx)("div",{className:"".concat(W.action," user-shixun-items"),onClick:function(n){n.stopPropagation(),l(e.identifier)},children:(0,R.jsx)(v.Z,{title:"移除",children:(0,R.jsx)("i",{className:"iconfont icon-shanchu21 font24 mr5 c-white"})})}),e.tag&&(0,R.jsx)("div",{className:W.tagWrap,children:(0,R.jsx)("span",{className:W.tagName,children:e.tag})}),e.is_jupyter&&(0,R.jsx)("img",{className:W.sign,src:E}),e.is_jupyter_lab&&(0,R.jsx)("img",{className:W.sign,src:O}),e.is_unity_3d&&(0,R.jsx)("img",{className:W.sign,src:D}),(0,R.jsx)("span",{className:W.imgWrap,children:(0,R.jsx)("img",{alt:e.name,src:"".concat(e.image_url)})}),(0,R.jsxs)("div",{className:W.cardBottom,children:[(0,R.jsxs)("p",{className:W.bottomNameWrap,children:[(0,R.jsx)("span",{title:e.name,className:W.bottomName,children:e.name||"实践项目名称-未填写"}),!(null===(s=e.schools)||void 0===s||!s.length)&&(0,R.jsx)(v.Z,{title:"该实践项目面向指定单位开放",children:(0,R.jsx)("i",{className:"iconfont icon-zhidinggongkai1 ml10 c-orange"})})]}),!!e.challenges_count&&(0,R.jsxs)(h.Fragment,{children:[(0,R.jsx)("div",{className:W.bottomCountProgressWrap,children:(0,R.jsx)("p",{style:{width:"".concat(100*parseFloat(parseInt(e.finished_challenges_count)/parseInt(e.challenges_count)).toFixed(2),"%")}})}),(0,R.jsxs)("p",{className:W.bottomCount,children:["已完成 ",e.finished_challenges_count," / ",e.challenges_count]})]})]})]})},e.id)}))})},F=t(38854),z=t(20834),B=t(52306),G=t(99232),M=t.n(G),V=t(8876),L=function(e){var n=e.data,t=(e.number,e.params),r=e.user,i=e.isCurrent,s=e.setParams,a=e.getShixuns,c=e.onCancelCollect,l=void 0===c?function(){}:c,d=e.onRemove,_=void 0===d?function(){}:d,x=e.setGroupIds,m=void 0===x?function(){}:x,j=e.setUnGrouplists,y=void 0===j?function(){}:j,w=(0,h.useState)([]),b=p()(w,2),Z=b[0],C=b[1];(0,h.useEffect)((function(){if(n){var e=[];null==n||n.map((function(n,t){var r=n;r.key=n.id,e.push(r)})),C([].concat(e))}}),[n]);var S=[{title:"实践项目名称",dataIndex:"name",width:236,key:"name",sorter:!0,sortOrder:"name"===t.sort_by?"desc"===t.sort_direction?"descend":"ascend":null,render:function(e,n){var t;return(0,R.jsxs)("p",{className:W.bottomNameWrap,children:[!(null===(t=n.schools)||void 0===t||!t.length)&&(0,R.jsx)(v.Z,{title:"该实践项目面向指定单位开放",children:(0,R.jsx)("i",{className:"iconfont icon-zhidinggongkai1 mr5 c-orange translateY1 inline-block"})}),(0,R.jsx)(v.Z,{title:e||"实践项目名称-未填写",children:(0,R.jsx)("span",{children:e||"实践项目名称-未填写"})})]})}},{title:"管理员",dataIndex:"owner",key:"owner",width:100,ellipsis:!0,render:function(e){return(0,R.jsx)(v.Z,{title:e||"--",placement:"bottomLeft",children:(0,R.jsx)("span",{children:e||"--"})})}},{title:"合作者",dataIndex:"members",key:"members",width:110,ellipsis:!0,render:function(e){return(0,R.jsx)(v.Z,{title:e.join("、"),placement:"bottomLeft",children:(0,R.jsx)("span",{children:e.join("、")})})}},{title:"最近修改",dataIndex:"updated_at",width:106,key:"updated_at",sorter:!0,sortOrder:"updated_at"===t.sort_by?"desc"===t.sort_direction?"descend":"ascend":null,render:function(e){return(0,R.jsx)("span",{className:"c-grey-666",children:M()(e).format("YYYY-MM-DD")})}},{title:"引用次数",dataIndex:"used_count",width:90,sorter:!0,align:"center",sortOrder:"used_count"===t.sort_by?"desc"===t.sort_direction?"descend":"ascend":null,key:"used_count",render:function(e){return(0,R.jsx)("span",{className:"c-grey-666",children:e})}},{title:"操作",dataIndex:"name",key:"name",width:110,align:"right",render:function(e,n){var s,a;return(0,R.jsxs)("div",{children:[(0,R.jsx)("span",{className:"current-primary",onClick:function(){var e=u()(o()().mark((function e(t){var r,i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.stopPropagation(),e.next=3,(0,P.Ee)({id:n.identifier});case 3:null!=(i=e.sent)&&null!==(r=i.exercise)&&void 0!==r&&r.length?f.Z.info({title:"考试场景告知",content:(0,R.jsxs)(N.Z,{children:[(0,R.jsx)(k.Z,{children:"当前实训已被考试调用,且您正在参加本次考试。考试场景下必须从试卷中进入并答题,否则答题结果不计入成绩。请点击试卷名称进入考试。"}),(0,R.jsx)(k.Z,{children:(0,R.jsx)("aside",{className:"mt10",children:null==i?void 0:i.exercise.map((function(e,n){return(0,R.jsx)("div",{children:(0,R.jsx)("a",{href:"/classrooms/".concat(e.course_id,"/exercise/").concat(e.id,"/detail?random=").concat(e.random),children:e.name})},n)}))})})]})}):(0,T.xg)("/shixuns/".concat(n.identifier,"/challenges"));case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:"详情"}),"study"!=t.category&&"collect"!=t.category&&i&&(null==n||null===(s=n.groups)||void 0===s?void 0:s.length)>0&&(0,R.jsx)("span",{onClick:function(e){var t;e.stopPropagation(),(null==n||null===(t=n.groups)||void 0===t?void 0:t.length)<=0?g.ZP.info("该实践项目暂无目录"):y(n.groups,n.id)},className:"current-primary ml10",children:"撤销目录"}),"study"===t.category&&(null===(a=r.userInfo)||void 0===a?void 0:a.login)===t.username&&(0,R.jsx)(F.Z,{dropdownRender:function(){var e;return(0,R.jsxs)(z.Z,{children:[(0,R.jsx)(z.Z.Item,{children:(0,R.jsx)("span",{onClick:function(e){e.stopPropagation(),f.Z.confirm({content:"是否确认删除",onOk:function(){return _(n.identifier)}})},className:"ml10 current",children:"删除"})}),(null==n||null===(e=n.groups)||void 0===e?void 0:e.length)>0&&(0,R.jsx)(z.Z.Item,{children:(0,R.jsx)("span",{onClick:function(e){var t;e.stopPropagation(),(null==n||null===(t=n.groups)||void 0===t?void 0:t.length)<=0?g.ZP.info("该实践项目暂无目录"):y(n.groups,n.id)},className:" current",children:"撤销目录"})})]})},children:(0,R.jsxs)("span",{onClick:function(e){e.stopPropagation()},className:"c-blue current ml10",children:["更多 ",(0,R.jsx)(V.Z,{})]})}),"collect"===t.category&&i&&(0,R.jsx)(F.Z,{dropdownRender:function(){return(0,R.jsxs)(z.Z,{children:[(0,R.jsx)(z.Z.Item,{children:(0,R.jsx)("span",{onClick:function(e){e.stopPropagation(),l(n.id)},className:"current",children:"取消收藏"})}),(0,R.jsx)(z.Z.Item,{children:(0,R.jsx)("span",{onClick:function(e){var t;e.stopPropagation(),(null==n||null===(t=n.groups)||void 0===t?void 0:t.length)<=0?g.ZP.info("该实践项目暂无目录"):y(n.groups,n.id)},className:" current",children:"撤销目录"})})]})},children:(0,R.jsxs)("span",{onClick:function(e){e.stopPropagation()},className:"c-blue current ml10",children:["更多 ",(0,R.jsx)(V.Z,{})]})})]})}}];return(0,R.jsx)(R.Fragment,{children:i?(0,R.jsx)(B.Z,{rowSelection:{type:"checkbox",columnWidth:25,onChange:function(e,n){m(e)}},onChange:function(e,n,r){r.field&&(t.sort_by=r.field),r.order||(t.sort_direction="asc"),"ascend"===r.order&&(t.sort_direction="asc"),"descend"===r.order&&(t.sort_direction="desc"),r.order||(t.sort_direction="asc"),s(t),a(t)},onRow:function(e){return{onClick:(n=u()(o()().mark((function n(t){var r,i;return o()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,P.Ee)({id:e.identifier});case 2:null!=(i=n.sent)&&null!==(r=i.exercise)&&void 0!==r&&r.length?f.Z.info({title:"考试场景告知",content:(0,R.jsxs)(N.Z,{children:[(0,R.jsx)(k.Z,{children:"当前实训已被考试调用,且您正在参加本次考试。考试场景下必须从试卷中进入并答题,否则答题结果不计入成绩。请点击试卷名称进入考试。"}),(0,R.jsx)(k.Z,{children:(0,R.jsx)("aside",{className:"mt10",children:null==i?void 0:i.exercise.map((function(e,n){return(0,R.jsx)("div",{children:(0,R.jsx)("a",{href:"/classrooms/".concat(e.course_id,"/exercise/").concat(e.id,"/detail?random=").concat(e.random),children:e.name})},n)}))})})]})}):(0,T.xg)("/shixuns/".concat(e.identifier,"/challenges"));case 4:case"end":return n.stop()}}),n)}))),function(e){return n.apply(this,arguments)})};var n},pagination:!1,dataSource:Z,columns:S}):(0,R.jsx)(B.Z,{style:{cursor:"pointer"},onRow:function(e){return{onClick:(n=u()(o()().mark((function n(t){var r,i;return o()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,P.Ee)({id:e.identifier});case 2:null!=(i=n.sent)&&null!==(r=i.exercise)&&void 0!==r&&r.length?f.Z.info({title:"考试场景告知",content:(0,R.jsxs)(N.Z,{children:[(0,R.jsx)(k.Z,{children:"当前实训已被考试调用,且您正在参加本次考试。考试场景下必须从试卷中进入并答题,否则答题结果不计入成绩。请点击试卷名称进入考试。"}),(0,R.jsx)(k.Z,{children:(0,R.jsx)("aside",{className:"mt10",children:null==i?void 0:i.exercise.map((function(e,n){return(0,R.jsx)("div",{children:(0,R.jsx)("a",{href:"/classrooms/".concat(e.course_id,"/exercise/").concat(e.id,"/detail?random=").concat(e.random),children:e.name})},n)}))})})]})}):(0,T.xg)("/shixuns/".concat(e.identifier,"/challenges"));case 4:case"end":return n.stop()}}),n)}))),function(e){return n.apply(this,arguments)})};var n},pagination:!1,dataSource:Z,columns:S})})},q=t(37231),J=t(51136),Y="groupWrap___AXrh6",U="directionItemWrap___YnUMa",H="directionItem____jxOq",Q="groupActionWrap___xgw7Q",X="active___AjCIl",K="directionContentWrap___fsRsV",$="minWidth43___cPjWW",ee="minWidth48___sqmWu",ne=function(e){e.dispatch;var n=e.isPreviewSelect,t=void 0!==n&&n,r=e.groupIds,i=void 0===r?[]:r,s=e.item_banks_groups,a=e.getItem,c=void 0===a?function(){}:a,l=e.user,d=e.onChangeGroup,p=void 0===d?function(){}:d,_=(0,h.useRef)(),x=function(){var e=u()(o()().mark((function e(n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:_.current=n.name,f.Z.confirm({centered:!0,width:424,okText:"确定",cancelText:"取消",title:"编辑目录",icon:null,className:"custom-modal-divider",content:(0,R.jsx)("div",{className:"font14",children:(0,R.jsx)(w.Z,{maxLength:20,placeholder:"请输入不超过20字的名称",className:"mt10",defaultValue:_.current,onChange:function(e){return _.current=e.target.value}})}),onOk:function(){return new Promise(function(){var e=u()(o()().mark((function e(t,r){var i,s;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(_.current){e.next=3;break}return g.ZP.info("请输入目录名称"),e.abrupt("return",r());case 3:return e.next=5,(0,J.ZP)("/api/users/".concat(null==l||null===(i=l.userInfo)||void 0===i?void 0:i.login,"/user_setting_groups/").concat(n.id,".json"),{method:"put",body:{name:null==_?void 0:_.current}});case 5:0===(null==(s=e.sent)?void 0:s.status)&&c(),t();case 8:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}())}});case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return!(null==s||!s.length)&&(0,R.jsxs)("div",{className:Y,children:[(0,R.jsx)("span",{className:"".concat($),style:{color:"#9096A3",marginTop:2,marginRight:6},children:"目录"}),(0,R.jsx)("span",{children:(0,R.jsx)("li",{className:"mb10 ".concat(ee," ").concat(H," ").concat(null!=i&&i.length?"":X),onClick:function(){return p([])},style:{marginRight:26},children:"全部"})}),(0,R.jsxs)("div",{className:K,children:[(0,R.jsx)("li",{className:"mb10 mr32 ".concat(H," ").concat(null!=i&&i.includes(-1)?X:""),onClick:function(){return p([-1])},children:"未加入目录"}),null==s?void 0:s.map((function(e){return(0,R.jsxs)("div",{className:U,children:[(0,R.jsx)("li",{onClick:function(){return p([e.id])},className:"".concat(H," mb10 ").concat(null!=i&&i.includes(e.id)?X:""),children:e.name},e.id),!t&&(0,R.jsxs)("span",{className:Q,children:[(0,R.jsx)("i",{className:"iconfont icon-xiugai mr1 c-light-primary font15 current",onClick:function(n){n.stopPropagation(),x(e)}}),(0,R.jsx)("i",{className:"iconfont icon-shanchu4 mr1 c-red font15 current",onClick:function(n){var t,r,i,a;n.stopPropagation(),t=e.id,a=null==s||null===(r=s.find((function(e){return e.id===t})))||void 0===r?void 0:r.name,f.Z.confirm({centered:!0,width:424,okText:"确定",cancelText:"取消",title:"删除目录",content:(0,R.jsxs)("div",{className:"font14",children:["你正在删除【",a,"】目录,本操作将导致只加入该目录的实训项目重新分配到【未加入目录】目录中",(0,R.jsx)("br",{}),"确认删除吗?"]}),onOk:(i=u()(o()().mark((function e(){var n,r;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,J.ZP)("/api/users/".concat(null==l||null===(n=l.userInfo)||void 0===n?void 0:n.login,"/user_setting_groups/").concat(t,".json"),{method:"Delete"});case 2:0===(null==(r=e.sent)?void 0:r.status)&&c();case 4:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)})})}})]})]})}))]})]})},te=t(90963),re=t(89918),oe=t(14661),ie=["user","userDetail","globalSetting","loading","dispatch"],se=(0,m.connect)((function(e){var n=e.user,t=e.userDetail,r=e.loading;return{user:n,userDetail:t,globalSetting:e.globalSetting,loading:r.effects}}))((function(e){var n,t,r,i,a,l,d=e.user,_=(e.userDetail,e.globalSetting,e.loading),I=e.dispatch,W=(x()(e,ie),(0,m.useSearchParams)()),E=p()(W,1)[0],O=(0,m.useLocation)(),D=(0,h.useRef)(),F=(0,h.useState)({}),z=p()(F,2),B=z[0],G=z[1],M=(0,h.useState)(0),V=p()(M,2),Y=V[0],U=V[1],H=(0,h.useState)([]),Q=p()(H,2),X=Q[0],K=Q[1],$=(0,h.useState)(),ee=p()($,2),se=ee[0],ae=ee[1],ce=(0,h.useState)(!1),le=p()(ce,2),ue=(le[0],le[1],(0,h.useState)([{label:(0,R.jsx)("span",{className:"icon-juxingfenbu font14"}),value:1},{label:(0,R.jsx)("span",{className:"icon-liebiaofenbu font14"}),value:2}])),de=p()(ue,2),pe=(de[0],de[1],(0,h.useState)(parseInt(localStorage.getItem("ShixunShowType"))||1)),_e=p()(pe,2),xe=_e[0],he=_e[1],me=(0,h.useState)(!1),fe=p()(me,2),ge=fe[0],ve=fe[1],je=(0,h.useState)(!1),ye=p()(je,2),we=ye[0],be=ye[1],Ze=(0,h.useState)(!1),Ne=p()(Ze,2),ke=Ne[0],Ce=Ne[1],Se=(0,h.useState)([]),Ie=p()(Se,2),Pe=Ie[0],We=Ie[1],Te=(0,h.useState)([]),Ee=p()(Te,2),Oe=Ee[0],De=Ee[1],Re=(0,h.useState)([]),Ae=p()(Re,2),Fe=Ae[0],ze=Ae[1],Be=(0,h.useState)(""),Ge=p()(Be,2),Me=Ge[0],Ve=Ge[1],Le=(0,h.useState)([]),qe=p()(Le,2),Je=qe[0],Ye=qe[1],Ue=(0,h.useState)([]),He=p()(Ue,2),Qe=He[0],Xe=He[1],Ke=(0,h.useState)([]),$e=p()(Ke,2),en=$e[0],nn=$e[1],tn=(0,h.useState)([]),rn=p()(tn,2),on=rn[0],sn=rn[1];function an(){return cn.apply(this,arguments)}function cn(){return(cn=u()(o()().mark((function e(){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=We,e.next=3,(0,J.ZP)("/api/users/".concat(null===(n=d.userInfo)||void 0===n?void 0:n.login,"/user_setting_groups.json"),{method:"Get",params:{type:"Shixun"}});case 3:e.t1=e.sent,(0,e.t0)(e.t1);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(0,h.useEffect)((function(){var e;D.current=null===(e=O.pathname.split("/"))||void 0===e?void 0:e[2];var n={category:E.get("category")||"",status:"manage"===E.get("category")?hn.map((function(e){return e.id})).includes(E.get("status"))?E.get("status"):"":("study"===E.get("category")||"collect"===E.get("category"))&&xn.map((function(e){return e.id})).includes(E.get("status"))?E.get("status"):"",page:1,per_page:15,sort_by:"updated_at",sort_direction:"desc",username:D.current,search:"",group_id:E.get("group_id")||""};De(E.get("group_id")||""),G(n),un(n)}),[O.pathname]),(0,h.useEffect)((function(){var e;ae((null===(e=d.userInfo)||void 0===e?void 0:e.login)===D.current)}),[null===(n=d.userInfo)||void 0===n?void 0:n.login,D.current]),(0,h.useEffect)((function(){var e;null!==(e=d.userInfo)&&void 0!==e&&e.login&&an()}),[null===(t=d.userInfo)||void 0===t?void 0:t.login]);var ln=function(){var e=u()(o()().mark((function e(n){var t,r,i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==(t=window.location.href.toString())&&void 0!==t&&t.includes("group_id")?(0,T.jz)("group_id",(null==n?void 0:n.length)>0?n[0]:""):window.history.replaceState(null,"",window.location.href.indexOf("?")>-1?window.location.href+"&group_id=".concat((null==n?void 0:n.length)>0?n[0]:""):"?group_id=".concat((null==n?void 0:n.length)>0?n[0]:"")),De(c()(n)),B.page=1,B.group_id="",!((null==n?void 0:n.length)>0)){e.next=11;break}return e.next=7,I({type:"userDetail/getShixuns",payload:s()(s()({},B),{},{group_id:n[0]})});case 7:(r=e.sent)&&(U(r.count||0),K(r.shixuns||[])),e.next=15;break;case 11:return e.next=13,I({type:"userDetail/getShixuns",payload:s()({},B)});case 13:(i=e.sent)&&(U(i.count||0),K(i.shixuns||[]));case 15:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),un=function(){var e=u()(o()().mark((function e(n){var t,r,i,a=arguments;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=a.length>1&&void 0!==a[1]&&a[1],!((null==Oe?void 0:Oe.length)>0)){e.next=8;break}return e.next=4,I({type:"userDetail/getShixuns",payload:s()(s()({},n),{},{group_id:t?null:Oe[0]})});case 4:(r=e.sent)&&(U(r.count||0),K(r.shixuns||[])),e.next=12;break;case 8:return e.next=10,I({type:"userDetail/getShixuns",payload:n});case 10:(i=e.sent)&&(U(i.count||0),K(i.shixuns||[]));case 12:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),dn=function(e){var n;f.Z.confirm({width:416,centered:!0,okText:"确定",cancelText:"取消",title:"取消收藏",icon:null,content:(0,R.jsxs)("div",{className:"tc font14 ".concat(C.modalContent),children:[(0,R.jsx)("i",{className:"iconfont icon-jingshi1 font14 mr5 ".concat(C.colorFEB300)}),"你确定要取消收藏该实践项目?"]}),onOk:(n=u()(o()().mark((function n(){var t;return o()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,P.rs)({container_id:e,container_type:"Shixun"});case 2:0===(null==(t=n.sent)?void 0:t.status)&&(g.ZP.success("已取消收藏"),un(B));case 4:case"end":return n.stop()}}),n)}))),function(){return n.apply(this,arguments)})})},pn=function(e){var n;f.Z.confirm({width:416,centered:!0,okText:"确定",cancelText:"取消",title:"移除实践项目",icon:null,content:(0,R.jsxs)("div",{className:"tc font14 ".concat(C.modalContent),children:[(0,R.jsx)("i",{className:"iconfont icon-jingshi1 font14 mr5 ".concat(C.colorFEB300)}),"确定将该实践项目从学习列表中移除?"]}),onOk:(n=u()(o()().mark((function n(){var t;return o()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,q.dE)({identifier:e});case 2:0===(null==(t=n.sent)?void 0:t.status)&&(g.ZP.success("已移除"),un(B));case 4:case"end":return n.stop()}}),n)}))),function(){return n.apply(this,arguments)})})},_n=[{id:"",name:"全部"},{id:"manage",name:"".concat(se?"我":"TA","管理的")},{id:"study",name:"".concat(se?"我":"TA","学习的")},{id:"collect",name:"".concat(se?"我":"TA","收藏的")}],xn=[{id:"",name:"全部"},{id:"processing",name:"未通关"},{id:"passed",name:"已通关"}],hn=[{id:"",name:"全部"},{id:"editing",name:"编辑中"},{id:"applying",name:"待审核"},{id:"published",name:"已发布"},{id:"publiced",name:"已公开"},{id:"closed",name:"已关闭"}],mn="manage"===B.category?hn:"study"===(null==B?void 0:B.category)||"collect"===(null==B?void 0:B.category)?xn:[];return(0,R.jsxs)("div",{className:C.wrap,children:[(0,R.jsx)(te.YG,{value:B.category,onChange:function(e){var n;B.category=e,B.status="",B.page=1,null!==(n=window.location.href.toString())&&void 0!==n&&n.includes("category")?((0,T.jz)("category",e),(0,T.jz)("status","")):window.history.replaceState(null,"",window.location.href.indexOf("?")>-1?window.location.href+"&category=".concat(e):"?category=".concat(e)),De([]),G(B),un(B,!0)},tabBarExtraContent:(0,R.jsx)(te.t7,{style:{width:303},placeholder:"搜索实践项目",value:B.search,onChange:function(e){B.search=e,B.page=1,G(B),un(B)},onInputChange:function(e){B.search=e,G(B)}}),className:"mb25",dataSource:_n}),se&&!!B.category&&(0,R.jsx)(te.qp,{title:"状态",value:B.status,onChange:function(e){var n;B.status=e,B.page=1,null!==(n=window.location.href.toString())&&void 0!==n&&n.includes("status")?((0,T.jz)("status",e),(0,T.jz)("group_id","")):window.history.replaceState(null,"",window.location.href.indexOf("?")>-1?window.location.href+"&status=".concat(e):"?status=".concat(e)),G(B),un(B,!0),De([])},dataSource:mn,titleWidth:28}),se&&(0,R.jsxs)("div",{className:C.group,children:[(0,R.jsx)(ne,{item_banks_groups:null==Pe?void 0:Pe.groups,getItem:an,user:d,groupIds:Oe,onChangeGroup:ln}),(0,R.jsx)("div",{className:C.add,style:{border:(null==Pe||null===(r=Pe.groups)||void 0===r?void 0:r.length)<=0&&"none",textAlign:(null==Pe||null===(i=Pe.groups)||void 0===i?void 0:i.length)<=0&&"left"},onClick:function(){var e;20!==(null==Pe||null===(e=Pe.groups)||void 0===e?void 0:e.length)?ve(!0):g.ZP.info("目录数最大为20")},children:"新建目录"})]}),(0,R.jsxs)("div",{className:C.midWrap,children:[(0,R.jsx)(te.cq,{sortValue:B.sort_direction,dropValue:B.sort_by,onSort:function(e){B.sort_direction=e,G(B),un(B)},onDrop:function(e){B.sort_by=e,B.sort_direction="desc",G(B),un(B)}}),(0,R.jsxs)("div",{className:C.type,children:[(0,R.jsx)(v.Z,{title:"图片模式",children:(0,R.jsx)("i",{className:1===xe?"iconfont icon-fenbu ".concat(C.cursorPointer," ").concat(C.color0152d9):"iconfont icon-fenbu ".concat(C.cursorPointer),onClick:function(){he(1),localStorage.setItem("ShixunShowType","1")}})}),(0,R.jsx)("span",{className:C.orderDesc,children:(0,R.jsx)(v.Z,{title:"列表模式",children:(0,R.jsx)("i",{className:2===xe?"iconfont icon-fenbu-2 ".concat(C.cursorPointer," ").concat(C.color0152d9," "):"iconfont icon-fenbu-2 ".concat(C.cursorPointer),onClick:function(){he(2),localStorage.setItem("ShixunShowType","2")}})})})]}),se&&(0,R.jsx)(v.Z,{title:1===xe?"请在列表模式中选中实训项目加入目录":"请选择实践项目",children:(0,R.jsx)("a",{onClick:function(){var e;1!==xe&&((null==Fe?void 0:Fe.length)<=0?g.ZP.info(1===xe?"请在列表模式中选中实训项目加入目录":"请选择实践项目"):(null==Pe||null===(e=Pe.groups)||void 0===e?void 0:e.length)<=0?g.ZP.info("您尚未创建任何目录"):be(!0))},style:{marginLeft:8,color:1===xe?"#00000040":"#3061d0",cursor:1===xe&&"no-drop"},children:"加入目录"})}),!("student"===(null===(a=d.userInfo)||void 0===a?void 0:a.identity)&&!(0,re.Ny)())&&(0,R.jsx)(te.op,{style:{marginLeft:"auto"},className:C.btn,onClick:function(){return m.history.push("/shixuns/new")},children:"新建实践项目"})]}),(0,R.jsxs)(j.Z,{loading:_["userDetail/getShixuns"],active:!0,paragraph:{rows:5},children:[1===xe&&(0,R.jsxs)("div",{className:C.cardWrap,children:[!(null!=X&&X.length)&&(B.category||B.search)&&(0,R.jsx)(S.Z,{}),(0,R.jsx)(A,{data:X,params:B,user:d,onRemove:pn,onCancelCollect:dn})]}),1!=xe&&(0,R.jsx)("div",{className:"mt10",style:{minHeight:400},children:(0,R.jsx)(L,{number:(B.page-1)*B.per_page,onRemove:pn,user:d,isCurrent:se,onCancelCollect:dn,setGroupIds:function(e){ze(c()(e))},setUnGrouplists:function(e,n){nn(c()(e)),sn([n]),Ce(!0)},params:B,data:X,setParams:G,getShixuns:un})}),Y>0&&(0,R.jsx)("div",{className:C.countWrap,children:(0,R.jsx)(y.Z,{showQuickJumper:!0,showSizeChanger:!0,pageSizeOptions:["10","20","50","100","200"],hideOnSinglePage:!0,total:Y,onChange:function(e,n){!function(e,n){B.page=e,B.per_page=n,G(B),un(B)}(e,n)},pageSize:B.per_page,current:B.page})})]}),(0,R.jsx)(f.Z,{open:ge,title:"新建目录",wrapClassName:oe.Z.CustomCss,onCancel:function(){ve(!1)},onOk:u()(o()().mark((function e(){var n,t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,J.ZP)("/api/users/".concat(null==d||null===(n=d.userInfo)||void 0===n?void 0:n.login,"/user_setting_groups.json"),{method:"post",body:{type:"Shixun",name:Me}});case 2:0===(null==(t=e.sent)?void 0:t.status)&&(g.ZP.info("创建目录成功"),ve(!1),Ve(""),an());case 4:case"end":return e.stop()}}),e)}))),children:(0,R.jsx)(w.Z,{value:Me,onChange:function(e){Ve(e.target.value)},placeholder:"请输入不超过20个字的目录名称",maxLength:20})}),(0,R.jsx)(f.Z,{open:we,title:"加入目录",onCancel:function(){be(!1)},footer:(0,R.jsx)("div",{style:{textAlign:"end"},children:(0,R.jsx)(b.ZP,{type:"primary",onClick:u()(o()().mark((function e(){var n,t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((null==Je?void 0:Je.length)<=0)){e.next=3;break}return g.ZP.info("请选择要加入的目录"),e.abrupt("return");case 3:return e.next=5,(0,J.ZP)("/api/users/".concat(null==d||null===(n=d.userInfo)||void 0===n?void 0:n.login,"/user_setting_groups/join.json"),{method:"post",body:{type:"Shixun",group_ids:Je,item_ids:Fe}});case 5:0===(null==(t=e.sent)?void 0:t.status)&&g.ZP.info("加入成功"),ln(Oe),Ye([]),be(!1),ze([]);case 11:case"end":return e.stop()}}),e)}))),children:"确认"})}),children:(0,R.jsxs)("div",{children:[(0,R.jsx)("span",{children:"请选择需要加入的目录"}),(0,R.jsx)("br",{}),(0,R.jsx)(Z.Z.Group,{value:Je,onChange:function(e){Ye(c()(e))},style:{marginTop:"20px"},children:(0,R.jsx)(N.Z,{style:{width:"400px"},children:null==Pe||null===(l=Pe.groups)||void 0===l?void 0:l.map((function(e,n){return(0,R.jsx)(k.Z,{span:6,style:{marginTop:"10px"},children:(0,R.jsx)(Z.Z,{value:e.id,style:{fontSize:"14px"},children:e.name})})}))})})]})}),(0,R.jsx)(f.Z,{open:ke,title:"撤销目录",onCancel:function(){Ce(!1)},footer:(0,R.jsx)("div",{style:{textAlign:"end"},children:(0,R.jsx)(b.ZP,{type:"primary",onClick:u()(o()().mark((function e(){var n,t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((null==Qe?void 0:Qe.length)<=0)){e.next=3;break}return g.ZP.info("请选择要撤销的目录"),e.abrupt("return");case 3:return e.next=5,(0,J.ZP)("/api/users/".concat(null==d||null===(n=d.userInfo)||void 0===n?void 0:n.login,"/user_setting_groups/cancel.json"),{method:"post",body:{type:"Shixun",group_ids:Qe,item_ids:on}});case 5:0===(null==(t=e.sent)?void 0:t.status)&&g.ZP.info("撤销成功"),un(B),Xe([]),Ce(!1),sn([]);case 11:case"end":return e.stop()}}),e)}))),children:"确认"})}),children:(0,R.jsxs)("div",{children:[(0,R.jsx)("span",{children:"请选择需要撤销的目录"}),(0,R.jsx)("br",{}),(0,R.jsx)(Z.Z.Group,{value:Qe,onChange:function(e){Xe(c()(e))},style:{marginTop:"20px"},children:(0,R.jsx)(N.Z,{style:{width:"400px"},children:null==en?void 0:en.map((function(e,n){return(0,R.jsx)(k.Z,{span:6,style:{marginTop:"10px"},children:(0,R.jsx)(Z.Z,{value:e.id,style:{fontSize:"14px"},children:e.name})})}))})})]})})]})}))},14661:function(e,n){n.Z={flex_box_center:"flex_box_center___vG4eV",flex_space_between:"flex_space_between___qVVxe",flex_box_vertical_center:"flex_box_vertical_center___P8Z8s",flex_box_center_end:"flex_box_center_end___VMme3",flex_box_column:"flex_box_column___VMHwm",dropdownmenus:"dropdownmenus___oVzoj",popupClassNames:"popupClassNames___OcZq7",selectdown:"selectdown___mmcA8"}}}]); |