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],{92224:function(e,n,t){t.r(n),t.d(n,{default:function(){return ae}});var r=t(7557),o=t.n(r),i=t(82242),a=t.n(i),s=t(37205),c=t.n(s),l=t(41498),u=t.n(l),d=t(79800),p=t.n(d),_=t(39647),x=t.n(_),h=t(59301),m=t(65363),f=t(43418),g=t(8591),v=t(6848),j=t(96865),y=t(27092),w=t(73782),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(13261),I=t(18889),P=t(18620),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(15309),E=t(27627),R=t(96908),O=t(57177),D=t(81378),A=t(37712),F=function(e){var n=e.data,t=e.params,r=void 0===t?{}:t,i=e.user,a=e.onCancelCollect,s=void 0===a?function(){}:a,c=e.onRemove,l=void 0===c?function(){}:c;return(0,A.jsx)(h.Fragment,{children:n&&n.map((function(e,n){var t,a;return(0,A.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,A.jsxs)(N.Z,{children:[(0,A.jsx)(k.Z,{children:"当前实训已被考试调用,且您正在参加本次考试。考试场景下必须从试卷中进入并答题,否则答题结果不计入成绩。请点击试卷名称进入考试。"}),(0,A.jsx)(k.Z,{children:(0,A.jsx)("aside",{className:"mt10",children:null==r?void 0:r.exercise.map((function(e,n){return(0,A.jsx)("div",{children:(0,A.jsx)("a",{href:"/classrooms/".concat(e.course_id,"/exercise/").concat(e.id,"/detail?random=").concat(e.random),children:e.name})})}))})})]})}):(0,E.xg)("/shixuns/".concat(e.identifier,"/challenges"));case 4:case"end":return n.stop()}}),n)}))),children:(0,A.jsxs)(I.Z,{className:"animated fadeIn ".concat(W.cardWrap),children:["collect"===r.category&&(0,A.jsx)("div",{className:"".concat(W.action," user-shixun-items"),onClick:function(n){n.stopPropagation(),s(e.id)},children:(0,A.jsx)(v.Z,{title:"取消收藏",children:(0,A.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,A.jsx)("div",{className:"".concat(W.action," user-shixun-items"),onClick:function(n){n.stopPropagation(),l(e.identifier)},children:(0,A.jsx)(v.Z,{title:"移除",children:(0,A.jsx)("i",{className:"iconfont icon-shanchu21 font24 mr5 c-white"})})}),e.tag&&(0,A.jsx)("div",{className:W.tagWrap,children:(0,A.jsx)("span",{className:W.tagName,children:e.tag})}),e.is_jupyter&&(0,A.jsx)("img",{className:W.sign,src:R}),e.is_jupyter_lab&&(0,A.jsx)("img",{className:W.sign,src:O}),e.is_unity_3d&&(0,A.jsx)("img",{className:W.sign,src:D}),(0,A.jsx)("span",{className:W.imgWrap,children:null!=e&&e.cover_image_id?(0,A.jsx)("img",{alt:e.name,src:T.Z.API_SERVER+"/api/attachments/"+(null==e?void 0:e.cover_image_id)}):(0,A.jsx)("img",{alt:e.name,src:"".concat(T.Z.IMG_SERVER,"/").concat(e.image_url)})}),(0,A.jsxs)("div",{className:W.cardBottom,children:[(0,A.jsxs)("p",{className:W.bottomNameWrap,children:[(0,A.jsx)("span",{title:e.name,className:W.bottomName,children:e.name||"实践项目名称-未填写"}),!(null===(a=e.schools)||void 0===a||!a.length)&&(0,A.jsx)(v.Z,{title:"该实践项目面向指定单位开放",children:(0,A.jsx)("i",{className:"iconfont icon-zhidinggongkai1 ml10 c-orange"})})]}),!!e.challenges_count&&(0,A.jsxs)(h.Fragment,{children:[(0,A.jsx)("div",{className:W.bottomCountProgressWrap,children:(0,A.jsx)("p",{style:{width:"".concat(100*parseFloat(parseInt(e.finished_challenges_count)/parseInt(e.challenges_count)).toFixed(2),"%")}})}),(0,A.jsxs)("p",{className:W.bottomCount,children:["已完成 ",e.finished_challenges_count," / ",e.challenges_count]})]})]})]})},e.id)}))})},z=t(38854),G=t(20834),M=t(61998),V=t(61186),L=t.n(V),B=t(78386),q=function(e){var n=e.data,t=(e.number,e.params),r=e.user,i=e.isCurrent,a=e.setParams,s=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,A.jsxs)("p",{className:W.bottomNameWrap,children:[!(null===(t=n.schools)||void 0===t||!t.length)&&(0,A.jsx)(v.Z,{title:"该实践项目面向指定单位开放",children:(0,A.jsx)("i",{className:"iconfont icon-zhidinggongkai1 mr5 c-orange translateY1 inline-block"})}),(0,A.jsx)(v.Z,{title:e||"实践项目名称-未填写",children:(0,A.jsx)("span",{children:e||"实践项目名称-未填写"})})]})}},{title:"管理员",dataIndex:"owner",key:"owner",width:100,ellipsis:!0,render:function(e){return(0,A.jsx)(v.Z,{title:e||"--",placement:"bottomLeft",children:(0,A.jsx)("span",{children:e||"--"})})}},{title:"合作者",dataIndex:"members",key:"members",width:110,ellipsis:!0,render:function(e){return(0,A.jsx)(v.Z,{title:e.join("、"),placement:"bottomLeft",children:(0,A.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,A.jsx)("span",{className:"c-grey-666",children:L()(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,A.jsx)("span",{className:"c-grey-666",children:e})}},{title:"操作",dataIndex:"name",key:"name",width:110,align:"right",render:function(e,n){var a,s;return(0,A.jsxs)("div",{children:[(0,A.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,A.jsxs)(N.Z,{children:[(0,A.jsx)(k.Z,{children:"当前实训已被考试调用,且您正在参加本次考试。考试场景下必须从试卷中进入并答题,否则答题结果不计入成绩。请点击试卷名称进入考试。"}),(0,A.jsx)(k.Z,{children:(0,A.jsx)("aside",{className:"mt10",children:null==i?void 0:i.exercise.map((function(e,n){return(0,A.jsx)("div",{children:(0,A.jsx)("a",{href:"/classrooms/".concat(e.course_id,"/exercise/").concat(e.id,"/detail?random=").concat(e.random),children:e.name})},n)}))})})]})}):(0,E.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===(a=n.groups)||void 0===a?void 0:a.length)>0&&(0,A.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===(s=r.userInfo)||void 0===s?void 0:s.login)===t.username&&(0,A.jsx)(z.Z,{dropdownRender:function(){var e;return(0,A.jsxs)(G.Z,{children:[(0,A.jsx)(G.Z.Item,{children:(0,A.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,A.jsx)(G.Z.Item,{children:(0,A.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,A.jsxs)("span",{onClick:function(e){e.stopPropagation()},className:"c-blue current ml10",children:["更多 ",(0,A.jsx)(B.Z,{})]})}),"collect"===t.category&&i&&(0,A.jsx)(z.Z,{dropdownRender:function(){return(0,A.jsxs)(G.Z,{children:[(0,A.jsx)(G.Z.Item,{children:(0,A.jsx)("span",{onClick:function(e){e.stopPropagation(),l(n.id)},className:"current",children:"取消收藏"})}),(0,A.jsx)(G.Z.Item,{children:(0,A.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,A.jsxs)("span",{onClick:function(e){e.stopPropagation()},className:"c-blue current ml10",children:["更多 ",(0,A.jsx)(B.Z,{})]})})]})}}];return(0,A.jsx)(A.Fragment,{children:i?(0,A.jsx)(M.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"),a(t),s(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,A.jsxs)(N.Z,{children:[(0,A.jsx)(k.Z,{children:"当前实训已被考试调用,且您正在参加本次考试。考试场景下必须从试卷中进入并答题,否则答题结果不计入成绩。请点击试卷名称进入考试。"}),(0,A.jsx)(k.Z,{children:(0,A.jsx)("aside",{className:"mt10",children:null==i?void 0:i.exercise.map((function(e,n){return(0,A.jsx)("div",{children:(0,A.jsx)("a",{href:"/classrooms/".concat(e.course_id,"/exercise/").concat(e.id,"/detail?random=").concat(e.random),children:e.name})},n)}))})})]})}):(0,E.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,A.jsx)(M.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,A.jsxs)(N.Z,{children:[(0,A.jsx)(k.Z,{children:"当前实训已被考试调用,且您正在参加本次考试。考试场景下必须从试卷中进入并答题,否则答题结果不计入成绩。请点击试卷名称进入考试。"}),(0,A.jsx)(k.Z,{children:(0,A.jsx)("aside",{className:"mt10",children:null==i?void 0:i.exercise.map((function(e,n){return(0,A.jsx)("div",{children:(0,A.jsx)("a",{href:"/classrooms/".concat(e.course_id,"/exercise/").concat(e.id,"/detail?random=").concat(e.random),children:e.name})},n)}))})})]})}):(0,E.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})})},J=t(4271),Y=t(79311),U="groupWrap___AXrh6",H="directionItemWrap___YnUMa",Q="directionItem____jxOq",X="groupActionWrap___xgw7Q",K="active___AjCIl",$="directionContentWrap___fsRsV",ee="minWidth43___cPjWW",ne="minWidth48___sqmWu",te=function(e){e.dispatch;var n=e.isPreviewSelect,t=void 0!==n&&n,r=e.groupIds,i=void 0===r?[]:r,a=e.item_banks_groups,s=e.getItem,c=void 0===s?function(){}:s,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,A.jsx)("div",{className:"font14",children:(0,A.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,a;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,Y.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==(a=e.sent)?void 0:a.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==a||!a.length)&&(0,A.jsxs)("div",{className:U,children:[(0,A.jsx)("span",{className:"".concat(ee),style:{color:"#9096A3",marginTop:2,marginRight:6},children:"目录"}),(0,A.jsx)("span",{children:(0,A.jsx)("li",{className:"mb10 ".concat(ne," ").concat(Q," ").concat(null!=i&&i.length?"":K),onClick:function(){return p([])},style:{marginRight:26},children:"全部"})}),(0,A.jsxs)("div",{className:$,children:[(0,A.jsx)("li",{className:"mb10 mr32 ".concat(Q," ").concat(null!=i&&i.includes(-1)?K:""),onClick:function(){return p([-1])},children:"未加入目录"}),null==a?void 0:a.map((function(e){return(0,A.jsxs)("div",{className:H,children:[(0,A.jsx)("li",{onClick:function(){return p([e.id])},className:"".concat(Q," mb10 ").concat(null!=i&&i.includes(e.id)?K:""),children:e.name},e.id),!t&&(0,A.jsxs)("span",{className:X,children:[(0,A.jsx)("i",{className:"iconfont icon-xiugai mr1 c-light-primary font15 current",onClick:function(n){n.stopPropagation(),x(e)}}),(0,A.jsx)("i",{className:"iconfont icon-shanchu4 mr1 c-red font15 current",onClick:function(n){var t,r,i,s;n.stopPropagation(),t=e.id,s=null==a||null===(r=a.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,A.jsxs)("div",{className:"font14",children:["你正在删除【",s,"】目录,本操作将导致只加入该目录的实训项目重新分配到【未加入目录】目录中",(0,A.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,Y.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)})})}})]})]})}))]})]})},re=t(54178),oe=t(9070),ie=["user","userDetail","globalSetting","loading","dispatch"],ae=(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,s,l,d,_,I=e.user,W=(e.userDetail,e.globalSetting),T=e.loading,R=e.dispatch,O=(x()(e,ie),(0,m.useSearchParams)()),D=p()(O,1)[0],z=(0,m.useLocation)(),G=(0,h.useRef)(),M=(0,h.useState)({}),V=p()(M,2),L=V[0],B=V[1],U=(0,h.useState)(0),H=p()(U,2),Q=H[0],X=H[1],K=(0,h.useState)([]),$=p()(K,2),ee=$[0],ne=$[1],ae=(0,h.useState)(),se=p()(ae,2),ce=se[0],le=se[1],ue=(0,h.useState)(!1),de=p()(ue,2),pe=(de[0],de[1],(0,h.useState)([{label:(0,A.jsx)("span",{className:"icon-juxingfenbu font14"}),value:1},{label:(0,A.jsx)("span",{className:"icon-liebiaofenbu font14"}),value:2}])),_e=p()(pe,2),xe=(_e[0],_e[1],(0,h.useState)(parseInt(localStorage.getItem("ShixunShowType"))||1)),he=p()(xe,2),me=he[0],fe=he[1],ge=(0,h.useState)(!1),ve=p()(ge,2),je=ve[0],ye=ve[1],we=(0,h.useState)(!1),be=p()(we,2),Ze=be[0],Ne=be[1],ke=(0,h.useState)(!1),Ce=p()(ke,2),Se=Ce[0],Ie=Ce[1],Pe=(0,h.useState)([]),We=p()(Pe,2),Te=We[0],Ee=We[1],Re=(0,h.useState)([]),Oe=p()(Re,2),De=Oe[0],Ae=Oe[1],Fe=(0,h.useState)([]),ze=p()(Fe,2),Ge=ze[0],Me=ze[1],Ve=(0,h.useState)(""),Le=p()(Ve,2),Be=Le[0],qe=Le[1],Je=(0,h.useState)([]),Ye=p()(Je,2),Ue=Ye[0],He=Ye[1],Qe=(0,h.useState)([]),Xe=p()(Qe,2),Ke=Xe[0],$e=Xe[1],en=(0,h.useState)([]),nn=p()(en,2),tn=nn[0],rn=nn[1],on=(0,h.useState)([]),an=p()(on,2),sn=an[0],cn=an[1];function ln(){return un.apply(this,arguments)}function un(){return(un=u()(o()().mark((function e(){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=Ee,e.next=3,(0,Y.ZP)("/api/users/".concat(null===(n=I.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;G.current=null===(e=z.pathname.split("/"))||void 0===e?void 0:e[2];var n={category:D.get("category")||"",status:"manage"===D.get("category")?fn.map((function(e){return e.id})).includes(D.get("status"))?D.get("status"):"":("study"===D.get("category")||"collect"===D.get("category"))&&mn.map((function(e){return e.id})).includes(D.get("status"))?D.get("status"):"",page:1,per_page:15,sort_by:"updated_at",sort_direction:"desc",username:G.current,search:"",group_id:D.get("group_id")||""};Ae(D.get("group_id")||""),B(n),pn(n)}),[z.pathname]),(0,h.useEffect)((function(){var e;le((null===(e=I.userInfo)||void 0===e?void 0:e.login)===G.current)}),[null===(n=I.userInfo)||void 0===n?void 0:n.login,G.current]),(0,h.useEffect)((function(){var e;null!==(e=I.userInfo)&&void 0!==e&&e.login&&ln()}),[null===(t=I.userInfo)||void 0===t?void 0:t.login]);var dn=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,E.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]:"")),Ae(c()(n)),L.page=1,L.group_id="",!((null==n?void 0:n.length)>0)){e.next=11;break}return e.next=7,R({type:"userDetail/getShixuns",payload:a()(a()({},L),{},{group_id:n[0]})});case 7:(r=e.sent)&&(X(r.count||0),ne(r.shixuns||[])),e.next=15;break;case 11:return e.next=13,R({type:"userDetail/getShixuns",payload:a()({},L)});case 13:(i=e.sent)&&(X(i.count||0),ne(i.shixuns||[]));case 15:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),pn=function(){var e=u()(o()().mark((function e(n){var t,r,i,s=arguments;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=s.length>1&&void 0!==s[1]&&s[1],!((null==De?void 0:De.length)>0)){e.next=8;break}return e.next=4,R({type:"userDetail/getShixuns",payload:a()(a()({},n),{},{group_id:t?null:De[0]})});case 4:(r=e.sent)&&(X(r.count||0),ne(r.shixuns||[])),e.next=12;break;case 8:return e.next=10,R({type:"userDetail/getShixuns",payload:n});case 10:(i=e.sent)&&(X(i.count||0),ne(i.shixuns||[]));case 12:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),_n=function(e){var n;f.Z.confirm({width:416,centered:!0,okText:"确定",cancelText:"取消",title:"取消收藏",icon:null,content:(0,A.jsxs)("div",{className:"tc font14 ".concat(C.modalContent),children:[(0,A.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("已取消收藏"),pn(L));case 4:case"end":return n.stop()}}),n)}))),function(){return n.apply(this,arguments)})})},xn=function(e){var n;f.Z.confirm({width:416,centered:!0,okText:"确定",cancelText:"取消",title:"移除实践项目",icon:null,content:(0,A.jsxs)("div",{className:"tc font14 ".concat(C.modalContent),children:[(0,A.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,J.dE)({identifier:e});case 2:0===(null==(t=n.sent)?void 0:t.status)&&(g.ZP.success("已移除"),pn(L));case 4:case"end":return n.stop()}}),n)}))),function(){return n.apply(this,arguments)})})},hn=[{id:"",name:"全部"},{id:"manage",name:"".concat(ce?"我":"TA","管理的")},{id:"study",name:"".concat(ce?"我":"TA","学习的")},{id:"collect",name:"".concat(ce?"我":"TA","收藏的")}],mn=[{id:"",name:"全部"},{id:"processing",name:"未通关"},{id:"passed",name:"已通关"}],fn=[{id:"",name:"全部"},{id:"editing",name:"编辑中"},{id:"applying",name:"待审核"},{id:"published",name:"已发布"},{id:"publiced",name:"已公开"},{id:"closed",name:"已关闭"}],gn="manage"===L.category?fn:"study"===(null==L?void 0:L.category)||"collect"===(null==L?void 0:L.category)?mn:[];return(0,A.jsxs)("div",{className:C.wrap,children:[(0,A.jsx)(re.YG,{value:L.category,onChange:function(e){var n;L.category=e,L.status="",L.page=1,null!==(n=window.location.href.toString())&&void 0!==n&&n.includes("category")?((0,E.jz)("category",e),(0,E.jz)("status","")):window.history.replaceState(null,"",window.location.href.indexOf("?")>-1?window.location.href+"&category=".concat(e):"?category=".concat(e)),Ae([]),B(L),pn(L,!0)},tabBarExtraContent:(0,A.jsx)(re.t7,{style:{width:303},placeholder:"搜索实践项目",value:L.search,onChange:function(e){L.search=e,L.page=1,B(L),pn(L)}}),className:"mb25",dataSource:hn}),ce&&!!L.category&&(0,A.jsx)(re.qp,{title:"状态",value:L.status,onChange:function(e){var n;L.status=e,L.page=1,null!==(n=window.location.href.toString())&&void 0!==n&&n.includes("status")?((0,E.jz)("status",e),(0,E.jz)("group_id","")):window.history.replaceState(null,"",window.location.href.indexOf("?")>-1?window.location.href+"&status=".concat(e):"?status=".concat(e)),B(L),pn(L,!0),Ae([])},dataSource:gn,titleWidth:28}),ce&&(0,A.jsxs)("div",{className:C.group,children:[(0,A.jsx)(te,{item_banks_groups:null==Te?void 0:Te.groups,getItem:ln,user:I,groupIds:De,onChangeGroup:dn}),(0,A.jsx)("div",{className:C.add,style:{border:(null==Te||null===(r=Te.groups)||void 0===r?void 0:r.length)<=0&&"none",textAlign:(null==Te||null===(i=Te.groups)||void 0===i?void 0:i.length)<=0&&"left"},onClick:function(){var e;20!==(null==Te||null===(e=Te.groups)||void 0===e?void 0:e.length)?ye(!0):g.ZP.info("目录数最大为20")},children:"新建目录"})]}),(0,A.jsxs)("div",{className:C.midWrap,children:[(0,A.jsx)(re.cq,{sortValue:L.sort_direction,dropValue:L.sort_by,onSort:function(e){L.sort_direction=e,B(L),pn(L)},onDrop:function(e){L.sort_by=e,L.sort_direction="desc",B(L),pn(L)}}),(0,A.jsxs)("div",{className:C.type,children:[(0,A.jsx)(v.Z,{title:"图片模式",children:(0,A.jsx)("i",{className:1===me?"iconfont icon-fenbu ".concat(C.cursorPointer," ").concat(C.color0152d9):"iconfont icon-fenbu ".concat(C.cursorPointer),onClick:function(){fe(1),localStorage.setItem("ShixunShowType","1")}})}),(0,A.jsx)("span",{className:C.orderDesc,children:(0,A.jsx)(v.Z,{title:"列表模式",children:(0,A.jsx)("i",{className:2===me?"iconfont icon-fenbu-2 ".concat(C.cursorPointer," ").concat(C.color0152d9," "):"iconfont icon-fenbu-2 ".concat(C.cursorPointer),onClick:function(){fe(2),localStorage.setItem("ShixunShowType","2")}})})})]}),ce&&(0,A.jsx)(v.Z,{title:1===me?"请在列表模式中选中实训项目加入目录":"请选择实践项目",children:(0,A.jsx)("a",{onClick:function(){var e;1!==me&&((null==Ge?void 0:Ge.length)<=0?g.ZP.info(1===me?"请在列表模式中选中实训项目加入目录":"请选择实践项目"):(null==Te||null===(e=Te.groups)||void 0===e?void 0:e.length)<=0?g.ZP.info("您尚未创建任何目录"):Ne(!0))},style:{marginLeft:8,color:1===me?"#00000040":"#3061d0",cursor:1===me&&"no-drop"},children:"加入目录"})}),"学生"!==(null===(s=I.userInfo)||void 0===s?void 0:s.user_identity)&&!(null!=W&&null!==(l=W.setting)&&void 0!==l&&l.hide_shixun)&&(null==I||null===(d=I.userInfo)||void 0===d?void 0:d.is_shixun_marker)&&(0,A.jsx)(re.op,{style:{marginLeft:"auto"},className:C.btn,onClick:function(){return m.history.push("/shixuns/new")},children:"新建实践项目"})]}),(0,A.jsxs)(j.Z,{loading:T["userDetail/getShixuns"],active:!0,paragraph:{rows:5},children:[1===me&&(0,A.jsxs)("div",{className:C.cardWrap,children:[!(null!=ee&&ee.length)&&(L.category||L.search)&&(0,A.jsx)(S.Z,{}),(0,A.jsx)(F,{data:ee,params:L,user:I,onRemove:xn,onCancelCollect:_n})]}),1!=me&&(0,A.jsx)("div",{className:"mt10",style:{minHeight:400},children:(0,A.jsx)(q,{number:(L.page-1)*L.per_page,onRemove:xn,user:I,isCurrent:ce,onCancelCollect:_n,setGroupIds:function(e){Me(c()(e))},setUnGrouplists:function(e,n){rn(c()(e)),cn([n]),Ie(!0)},params:L,data:ee,setParams:B,getShixuns:pn})}),Q>0&&(0,A.jsx)("div",{className:C.countWrap,children:(0,A.jsx)(y.Z,{showQuickJumper:!0,showSizeChanger:!0,pageSizeOptions:["10","20","50","100","200"],hideOnSinglePage:!0,total:Q,onChange:function(e,n){!function(e,n){L.page=e,L.per_page=n,B(L),pn(L)}(e,n)},pageSize:L.per_page,current:L.page})})]}),(0,A.jsx)(f.Z,{open:je,title:"新建目录",wrapClassName:oe.Z.CustomCss,onCancel:function(){ye(!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,Y.ZP)("/api/users/".concat(null==I||null===(n=I.userInfo)||void 0===n?void 0:n.login,"/user_setting_groups.json"),{method:"post",body:{type:"Shixun",name:Be}});case 2:0===(null==(t=e.sent)?void 0:t.status)&&(g.ZP.info("创建目录成功"),ye(!1),qe(""),ln());case 4:case"end":return e.stop()}}),e)}))),children:(0,A.jsx)(w.Z,{value:Be,onChange:function(e){qe(e.target.value)},placeholder:"请输入不超过20个字的目录名称",maxLength:20})}),(0,A.jsx)(f.Z,{open:Ze,title:"加入目录",onCancel:function(){Ne(!1)},footer:(0,A.jsx)("div",{style:{textAlign:"end"},children:(0,A.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==Ue?void 0:Ue.length)<=0)){e.next=3;break}return g.ZP.info("请选择要加入的目录"),e.abrupt("return");case 3:return e.next=5,(0,Y.ZP)("/api/users/".concat(null==I||null===(n=I.userInfo)||void 0===n?void 0:n.login,"/user_setting_groups/join.json"),{method:"post",body:{type:"Shixun",group_ids:Ue,item_ids:Ge}});case 5:0===(null==(t=e.sent)?void 0:t.status)&&g.ZP.info("加入成功"),dn(De),He([]),Ne(!1),Me([]);case 11:case"end":return e.stop()}}),e)}))),children:"确认"})}),children:(0,A.jsxs)("div",{children:[(0,A.jsx)("span",{children:"请选择需要加入的目录"}),(0,A.jsx)("br",{}),(0,A.jsx)(Z.Z.Group,{value:Ue,onChange:function(e){He(c()(e))},style:{marginTop:"20px"},children:(0,A.jsx)(N.Z,{style:{width:"400px"},children:null==Te||null===(_=Te.groups)||void 0===_?void 0:_.map((function(e,n){return(0,A.jsx)(k.Z,{span:6,style:{marginTop:"10px"},children:(0,A.jsx)(Z.Z,{value:e.id,style:{fontSize:"14px"},children:e.name})})}))})})]})}),(0,A.jsx)(f.Z,{open:Se,title:"撤销目录",onCancel:function(){Ie(!1)},footer:(0,A.jsx)("div",{style:{textAlign:"end"},children:(0,A.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==Ke?void 0:Ke.length)<=0)){e.next=3;break}return g.ZP.info("请选择要撤销的目录"),e.abrupt("return");case 3:return e.next=5,(0,Y.ZP)("/api/users/".concat(null==I||null===(n=I.userInfo)||void 0===n?void 0:n.login,"/user_setting_groups/cancel.json"),{method:"post",body:{type:"Shixun",group_ids:Ke,item_ids:sn}});case 5:0===(null==(t=e.sent)?void 0:t.status)&&g.ZP.info("撤销成功"),pn(L),$e([]),Ie(!1),cn([]);case 11:case"end":return e.stop()}}),e)}))),children:"确认"})}),children:(0,A.jsxs)("div",{children:[(0,A.jsx)("span",{children:"请选择需要撤销的目录"}),(0,A.jsx)("br",{}),(0,A.jsx)(Z.Z.Group,{value:Ke,onChange:function(e){$e(c()(e))},style:{marginTop:"20px"},children:(0,A.jsx)(N.Z,{style:{width:"400px"},children:null==tn?void 0:tn.map((function(e,n){return(0,A.jsx)(k.Z,{span:6,style:{marginTop:"10px"},children:(0,A.jsx)(Z.Z,{value:e.id,style:{fontSize:"14px"},children:e.name})})}))})})]})})]})}))},9070: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"}}}]); |