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
39 KiB
1 line
39 KiB
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[18307],{88819:function(e,n,t){t.r(n),t.d(n,{default:function(){return ie}});var r=t(7557),o=t.n(r),a=t(82242),i=t.n(a),s=t(37205),c=t.n(s),l=t(41498),d=t.n(l),u=t(79800),p=t.n(u),g=t(39647),m=t.n(g),h=t(59301),x=t(80608),f=t(43418),_=t(8591),v=t(6848),b=t(66999),y=t(86859),j=t(24650),w=t(3113),S=t(24905),C=t(95237),$=t(43604),N={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"},Z=t(6638),k=t(18889),P=t(33329),I={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"},W=t(71681),O=t(27876),T=t(96908),E=t(57177),z=t(81378),B=t(37712),R=function(e){var n=e.data,t=e.params,r=void 0===t?{}:t,a=e.user,i=e.onCancelCollect,s=void 0===i?function(){}:i,c=e.onRemove,l=void 0===c?function(){}:c;return(0,B.jsx)(h.Fragment,{children:n&&n.map((function(e,n){var t,i;return(0,B.jsx)("a",{className:I.wrap,onClick:d()(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,B.jsxs)(C.Z,{children:[(0,B.jsx)($.Z,{children:"当前实训已被考试调用,且您正在参加本次考试。考试场景下必须从试卷中进入并答题,否则答题结果不计入成绩。请点击试卷名称进入考试。"}),(0,B.jsx)($.Z,{children:(0,B.jsx)("aside",{className:"mt10",children:null==r?void 0:r.exercise.map((function(e,n){return(0,B.jsx)("div",{children:(0,B.jsx)("a",{href:"/classrooms/".concat(e.course_id,"/exercise/").concat(e.id,"/detail?random=").concat(e.random),children:e.name})})}))})})]})}):(0,O.xg)("/shixuns/".concat(e.identifier,"/challenges"));case 4:case"end":return n.stop()}}),n)}))),children:(0,B.jsxs)(k.Z,{className:"animated fadeIn ".concat(I.cardWrap),children:["collect"===r.category&&(0,B.jsx)("div",{className:"".concat(I.action," user-shixun-items"),onClick:function(n){n.stopPropagation(),s(e.id)},children:(0,B.jsx)(v.Z,{title:"取消收藏",children:(0,B.jsx)("i",{className:"iconfont icon-shoucang3 font24 mr5 ".concat(I.colorFF8E02)})})}),"study"===r.category&&r.username===(null===(t=a.userInfo)||void 0===t?void 0:t.login)&&(0,B.jsx)("div",{className:"".concat(I.action," user-shixun-items"),onClick:function(n){n.stopPropagation(),l(e.identifier)},children:(0,B.jsx)(v.Z,{title:"移除",children:(0,B.jsx)("i",{className:"iconfont icon-shanchu21 font24 mr5 c-white"})})}),e.tag&&(0,B.jsx)("div",{className:I.tagWrap,children:(0,B.jsx)("span",{className:I.tagName,children:e.tag})}),e.is_jupyter&&(0,B.jsx)("img",{className:I.sign,src:T}),e.is_jupyter_lab&&(0,B.jsx)("img",{className:I.sign,src:E}),e.is_unity_3d&&(0,B.jsx)("img",{className:I.sign,src:z}),(0,B.jsx)("span",{className:I.imgWrap,children:null!=e&&e.cover_image_id?(0,B.jsx)("img",{alt:e.name,src:W.Z.API_SERVER+"/api/attachments/"+(null==e?void 0:e.cover_image_id)}):(0,B.jsx)("img",{alt:e.name,src:"".concat(W.Z.IMG_SERVER,"/").concat(e.image_url)})}),(0,B.jsxs)("div",{className:I.cardBottom,children:[(0,B.jsxs)("p",{className:I.bottomNameWrap,children:[(0,B.jsx)("span",{title:e.name,className:I.bottomName,children:e.name||"实践项目名称-未填写"}),!(null===(i=e.schools)||void 0===i||!i.length)&&(0,B.jsx)(v.Z,{title:"该实践项目面向指定单位开放",children:(0,B.jsx)("i",{className:"iconfont icon-zhidinggongkai1 ml10 c-orange"})})]}),!!e.challenges_count&&(0,B.jsxs)(h.Fragment,{children:[(0,B.jsx)("div",{className:I.bottomCountProgressWrap,children:(0,B.jsx)("p",{style:{width:"".concat(100*parseFloat(parseInt(e.finished_challenges_count)/parseInt(e.challenges_count)).toFixed(2),"%")}})}),(0,B.jsxs)("p",{className:I.bottomCount,children:["已完成 ",e.finished_challenges_count," / ",e.challenges_count]})]})]})]})},e.id)}))})},M=t(38854),G=t(20834),L=t(51945),D=t(61186),A=t.n(D),F=t(46952),H=function(e){var n=e.data,t=(e.number,e.params),r=e.user,a=e.isCurrent,i=e.setParams,s=e.getShixuns,c=e.onCancelCollect,l=void 0===c?function(){}:c,u=e.onRemove,g=void 0===u?function(){}:u,m=e.setGroupIds,x=void 0===m?function(){}:m,b=e.setUnGrouplists,y=void 0===b?function(){}:b,j=(0,h.useState)([]),w=p()(j,2),S=w[0],N=w[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)})),N([].concat(e))}}),[n]);var Z=[{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,B.jsxs)("p",{className:I.bottomNameWrap,children:[!(null===(t=n.schools)||void 0===t||!t.length)&&(0,B.jsx)(v.Z,{title:"该实践项目面向指定单位开放",children:(0,B.jsx)("i",{className:"iconfont icon-zhidinggongkai1 mr5 c-orange translateY1 inline-block"})}),(0,B.jsx)(v.Z,{title:e||"实践项目名称-未填写",children:(0,B.jsx)("span",{children:e||"实践项目名称-未填写"})})]})}},{title:"管理员",dataIndex:"owner",key:"owner",width:100,ellipsis:!0,render:function(e){return(0,B.jsx)(v.Z,{title:e||"--",placement:"bottomLeft",children:(0,B.jsx)("span",{children:e||"--"})})}},{title:"合作者",dataIndex:"members",key:"members",width:110,ellipsis:!0,render:function(e){return(0,B.jsx)(v.Z,{title:e.join("、"),placement:"bottomLeft",children:(0,B.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,B.jsx)("span",{className:"c-grey-666",children:A()(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,B.jsx)("span",{className:"c-grey-666",children:e})}},{title:"操作",dataIndex:"name",key:"name",width:110,align:"right",render:function(e,n){var i,s;return(0,B.jsxs)("div",{children:[(0,B.jsx)("span",{className:"current-primary",onClick:function(){var e=d()(o()().mark((function e(t){var r,a;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!=(a=e.sent)&&null!==(r=a.exercise)&&void 0!==r&&r.length?f.Z.info({title:"考试场景告知",content:(0,B.jsxs)(C.Z,{children:[(0,B.jsx)($.Z,{children:"当前实训已被考试调用,且您正在参加本次考试。考试场景下必须从试卷中进入并答题,否则答题结果不计入成绩。请点击试卷名称进入考试。"}),(0,B.jsx)($.Z,{children:(0,B.jsx)("aside",{className:"mt10",children:null==a?void 0:a.exercise.map((function(e,n){return(0,B.jsx)("div",{children:(0,B.jsx)("a",{href:"/classrooms/".concat(e.course_id,"/exercise/").concat(e.id,"/detail?random=").concat(e.random),children:e.name})},n)}))})})]})}):(0,O.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&&a&&(null==n||null===(i=n.groups)||void 0===i?void 0:i.length)>0&&(0,B.jsx)("span",{onClick:function(e){var t;e.stopPropagation(),(null==n||null===(t=n.groups)||void 0===t?void 0:t.length)<=0?_.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,B.jsx)(M.Z,{dropdownRender:function(){var e;return(0,B.jsxs)(G.Z,{children:[(0,B.jsx)(G.Z.Item,{children:(0,B.jsx)("span",{onClick:function(e){e.stopPropagation(),f.Z.confirm({content:"是否确认删除",onOk:function(){return g(n.identifier)}})},className:"ml10 current",children:"删除"})}),(null==n||null===(e=n.groups)||void 0===e?void 0:e.length)>0&&(0,B.jsx)(G.Z.Item,{children:(0,B.jsx)("span",{onClick:function(e){var t;e.stopPropagation(),(null==n||null===(t=n.groups)||void 0===t?void 0:t.length)<=0?_.ZP.info("该实践项目暂无目录"):y(n.groups,n.id)},className:" current",children:"撤销目录"})})]})},children:(0,B.jsxs)("span",{onClick:function(e){e.stopPropagation()},className:"c-blue current ml10",children:["更多 ",(0,B.jsx)(F.Z,{})]})}),"collect"===t.category&&a&&(0,B.jsx)(M.Z,{dropdownRender:function(){return(0,B.jsxs)(G.Z,{children:[(0,B.jsx)(G.Z.Item,{children:(0,B.jsx)("span",{onClick:function(e){e.stopPropagation(),l(n.id)},className:"current",children:"取消收藏"})}),(0,B.jsx)(G.Z.Item,{children:(0,B.jsx)("span",{onClick:function(e){var t;e.stopPropagation(),(null==n||null===(t=n.groups)||void 0===t?void 0:t.length)<=0?_.ZP.info("该实践项目暂无目录"):y(n.groups,n.id)},className:" current",children:"撤销目录"})})]})},children:(0,B.jsxs)("span",{onClick:function(e){e.stopPropagation()},className:"c-blue current ml10",children:["更多 ",(0,B.jsx)(F.Z,{})]})})]})}}];return(0,B.jsx)(B.Fragment,{children:a?(0,B.jsx)(L.Z,{rowSelection:{type:"checkbox",columnWidth:25,onChange:function(e,n){x(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"),i(t),s(t)},onRow:function(e){return{onClick:(n=d()(o()().mark((function n(t){var r,a;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!=(a=n.sent)&&null!==(r=a.exercise)&&void 0!==r&&r.length?f.Z.info({title:"考试场景告知",content:(0,B.jsxs)(C.Z,{children:[(0,B.jsx)($.Z,{children:"当前实训已被考试调用,且您正在参加本次考试。考试场景下必须从试卷中进入并答题,否则答题结果不计入成绩。请点击试卷名称进入考试。"}),(0,B.jsx)($.Z,{children:(0,B.jsx)("aside",{className:"mt10",children:null==a?void 0:a.exercise.map((function(e,n){return(0,B.jsx)("div",{children:(0,B.jsx)("a",{href:"/classrooms/".concat(e.course_id,"/exercise/").concat(e.id,"/detail?random=").concat(e.random),children:e.name})},n)}))})})]})}):(0,O.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:S,columns:Z}):(0,B.jsx)(L.Z,{style:{cursor:"pointer"},onRow:function(e){return{onClick:(n=d()(o()().mark((function n(t){var r,a;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!=(a=n.sent)&&null!==(r=a.exercise)&&void 0!==r&&r.length?f.Z.info({title:"考试场景告知",content:(0,B.jsxs)(C.Z,{children:[(0,B.jsx)($.Z,{children:"当前实训已被考试调用,且您正在参加本次考试。考试场景下必须从试卷中进入并答题,否则答题结果不计入成绩。请点击试卷名称进入考试。"}),(0,B.jsx)($.Z,{children:(0,B.jsx)("aside",{className:"mt10",children:null==a?void 0:a.exercise.map((function(e,n){return(0,B.jsx)("div",{children:(0,B.jsx)("a",{href:"/classrooms/".concat(e.course_id,"/exercise/").concat(e.id,"/detail?random=").concat(e.random),children:e.name})},n)}))})})]})}):(0,O.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:S,columns:Z})})},V=t(43764),K=t(49105),X="groupWrap___AXrh6",q="directionItemWrap___YnUMa",J="directionItem____jxOq",Y="groupActionWrap___xgw7Q",U="active___AjCIl",Q="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,a=void 0===r?[]:r,i=e.item_banks_groups,s=e.getItem,c=void 0===s?function(){}:s,l=e.user,u=e.onChangeGroup,p=void 0===u?function(){}:u,g=(0,h.useRef)(),m=function(){var e=d()(o()().mark((function e(n){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:g.current=n.name,f.Z.confirm({centered:!0,width:424,okText:"确定",cancelText:"取消",title:"编辑目录",icon:null,className:"custom-modal-divider",content:(0,B.jsx)("div",{className:"font14",children:(0,B.jsx)(j.Z,{maxLength:20,placeholder:"请输入不超过20字的名称",className:"mt10",defaultValue:g.current,onChange:function(e){return g.current=e.target.value}})}),onOk:function(){return new Promise(function(){var e=d()(o()().mark((function e(t,r){var a,i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(g.current){e.next=3;break}return _.ZP.info("请输入目录名称"),e.abrupt("return",r());case 3:return e.next=5,(0,K.ZP)("/api/users/".concat(null==l||null===(a=l.userInfo)||void 0===a?void 0:a.login,"/user_setting_groups/").concat(n.id,".json"),{method:"put",body:{name:null==g?void 0:g.current}});case 5:0===(null==(i=e.sent)?void 0:i.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==i||!i.length)&&(0,B.jsxs)("div",{className:X,children:[(0,B.jsx)("span",{className:"".concat(ee),style:{color:"#9096A3",marginTop:2,marginRight:6},children:"目录"}),(0,B.jsx)("span",{children:(0,B.jsx)("li",{className:"mb10 ".concat(ne," ").concat(J," ").concat(null!=a&&a.length?"":U),onClick:function(){return p([])},style:{marginRight:26},children:"全部"})}),(0,B.jsxs)("div",{className:Q,children:[(0,B.jsx)("li",{className:"mb10 mr32 ".concat(J," ").concat(null!=a&&a.includes(-1)?U:""),onClick:function(){return p([-1])},children:"未加入目录"}),null==i?void 0:i.map((function(e){return(0,B.jsxs)("div",{className:q,children:[(0,B.jsx)("li",{onClick:function(){return p([e.id])},className:"".concat(J," mb10 ").concat(null!=a&&a.includes(e.id)?U:""),children:e.name},e.id),!t&&(0,B.jsxs)("span",{className:Y,children:[(0,B.jsx)("i",{className:"iconfont icon-xiugai mr1 c-light-primary font15 current",onClick:function(n){n.stopPropagation(),m(e)}}),(0,B.jsx)("i",{className:"iconfont icon-shanchu4 mr1 c-red font15 current",onClick:function(n){var t,r,a,s;n.stopPropagation(),t=e.id,s=null==i||null===(r=i.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,B.jsxs)("div",{className:"font14",children:["你正在删除【",s,"】目录,本操作将导致只加入该目录的实训项目重新分配到【未加入目录】目录中",(0,B.jsx)("br",{}),"确认删除吗?"]}),onOk:(a=d()(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,K.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 a.apply(this,arguments)})})}})]})]})}))]})]})},re=t(48410),oe=t(11806),ae=["user","userDetail","globalSetting","loading","dispatch"],ie=(0,x.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,a,s,l,u,g,k=e.user,I=(e.userDetail,e.globalSetting),W=e.loading,T=e.dispatch,E=(m()(e,ae),(0,x.useSearchParams)()),z=p()(E,1)[0],M=(0,x.useLocation)(),G=(0,h.useRef)(),L=(0,h.useState)({}),D=p()(L,2),A=D[0],F=D[1],X=(0,h.useState)(0),q=p()(X,2),J=q[0],Y=q[1],U=(0,h.useState)([]),Q=p()(U,2),ee=Q[0],ne=Q[1],ie=(0,h.useState)(),se=p()(ie,2),ce=se[0],le=se[1],de=(0,h.useState)(!1),ue=p()(de,2),pe=(ue[0],ue[1],(0,h.useState)([{label:(0,B.jsx)("span",{className:"icon-juxingfenbu font14"}),value:1},{label:(0,B.jsx)("span",{className:"icon-liebiaofenbu font14"}),value:2}])),ge=p()(pe,2),me=(ge[0],ge[1],(0,h.useState)(parseInt(localStorage.getItem("ShixunShowType"))||1)),he=p()(me,2),xe=he[0],fe=he[1],_e=(0,h.useState)(!1),ve=p()(_e,2),be=ve[0],ye=ve[1],je=(0,h.useState)(!1),we=p()(je,2),Se=we[0],Ce=we[1],$e=(0,h.useState)(!1),Ne=p()($e,2),Ze=Ne[0],ke=Ne[1],Pe=(0,h.useState)([]),Ie=p()(Pe,2),We=Ie[0],Oe=Ie[1],Te=(0,h.useState)([]),Ee=p()(Te,2),ze=Ee[0],Be=Ee[1],Re=(0,h.useState)([]),Me=p()(Re,2),Ge=Me[0],Le=Me[1],De=(0,h.useState)(""),Ae=p()(De,2),Fe=Ae[0],He=Ae[1],Ve=(0,h.useState)([]),Ke=p()(Ve,2),Xe=Ke[0],qe=Ke[1],Je=(0,h.useState)([]),Ye=p()(Je,2),Ue=Ye[0],Qe=Ye[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 dn.apply(this,arguments)}function dn(){return(dn=d()(o()().mark((function e(){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=Oe,e.next=3,(0,K.ZP)("/api/users/".concat(null===(n=k.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=M.pathname.split("/"))||void 0===e?void 0:e[2];var n={category:z.get("category")||"",status:"manage"===z.get("category")?fn.map((function(e){return e.id})).includes(z.get("status"))?z.get("status"):"":("study"===z.get("category")||"collect"===z.get("category"))&&xn.map((function(e){return e.id})).includes(z.get("status"))?z.get("status"):"",page:1,per_page:15,sort_by:"updated_at",sort_direction:"desc",username:G.current,search:"",group_id:z.get("group_id")||""};Be(z.get("group_id")||""),F(n),pn(n)}),[M.pathname]),(0,h.useEffect)((function(){var e;le((null===(e=k.userInfo)||void 0===e?void 0:e.login)===G.current)}),[null===(n=k.userInfo)||void 0===n?void 0:n.login,G.current]),(0,h.useEffect)((function(){var e;null!==(e=k.userInfo)&&void 0!==e&&e.login&&ln()}),[null===(t=k.userInfo)||void 0===t?void 0:t.login]);var un=function(){var e=d()(o()().mark((function e(n){var t,r,a;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,O.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]:"")),Be(c()(n)),A.page=1,A.group_id="",!((null==n?void 0:n.length)>0)){e.next=11;break}return e.next=7,T({type:"userDetail/getShixuns",payload:i()(i()({},A),{},{group_id:n[0]})});case 7:(r=e.sent)&&(Y(r.count||0),ne(r.shixuns||[])),e.next=15;break;case 11:return e.next=13,T({type:"userDetail/getShixuns",payload:i()({},A)});case 13:(a=e.sent)&&(Y(a.count||0),ne(a.shixuns||[]));case 15:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),pn=function(){var e=d()(o()().mark((function e(n){var t,r,a,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==ze?void 0:ze.length)>0)){e.next=8;break}return e.next=4,T({type:"userDetail/getShixuns",payload:i()(i()({},n),{},{group_id:t?null:ze[0]})});case 4:(r=e.sent)&&(Y(r.count||0),ne(r.shixuns||[])),e.next=12;break;case 8:return e.next=10,T({type:"userDetail/getShixuns",payload:n});case 10:(a=e.sent)&&(Y(a.count||0),ne(a.shixuns||[]));case 12:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),gn=function(e){var n;f.Z.confirm({width:416,centered:!0,okText:"确定",cancelText:"取消",title:"取消收藏",icon:null,content:(0,B.jsxs)("div",{className:"tc font14 ".concat(N.modalContent),children:[(0,B.jsx)("i",{className:"iconfont icon-jingshi1 font14 mr5 ".concat(N.colorFEB300)}),"你确定要取消收藏该实践项目?"]}),onOk:(n=d()(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)&&(_.ZP.success("已取消收藏"),pn(A));case 4:case"end":return n.stop()}}),n)}))),function(){return n.apply(this,arguments)})})},mn=function(e){var n;f.Z.confirm({width:416,centered:!0,okText:"确定",cancelText:"取消",title:"移除实践项目",icon:null,content:(0,B.jsxs)("div",{className:"tc font14 ".concat(N.modalContent),children:[(0,B.jsx)("i",{className:"iconfont icon-jingshi1 font14 mr5 ".concat(N.colorFEB300)}),"确定将该实践项目从学习列表中移除?"]}),onOk:(n=d()(o()().mark((function n(){var t;return o()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,V.dE)({identifier:e});case 2:0===(null==(t=n.sent)?void 0:t.status)&&(_.ZP.success("已移除"),pn(A));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","收藏的")}],xn=[{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:"已关闭"}],_n="manage"===A.category?fn:"study"===(null==A?void 0:A.category)||"collect"===(null==A?void 0:A.category)?xn:[];return(0,B.jsxs)("div",{className:N.wrap,children:[(0,B.jsx)(re.YG,{value:A.category,onChange:function(e){var n;A.category=e,A.status="",A.page=1,null!==(n=window.location.href.toString())&&void 0!==n&&n.includes("category")?((0,O.jz)("category",e),(0,O.jz)("status","")):window.history.replaceState(null,"",window.location.href.indexOf("?")>-1?window.location.href+"&category=".concat(e):"?category=".concat(e)),Be([]),F(A),pn(A,!0)},tabBarExtraContent:(0,B.jsx)(re.t7,{style:{width:303},placeholder:"搜索实践项目",value:A.search,onChange:function(e){A.search=e,A.page=1,F(A),pn(A)}}),className:"mb25",dataSource:hn}),ce&&!!A.category&&(0,B.jsx)(re.qp,{title:"状态",value:A.status,onChange:function(e){var n;A.status=e,A.page=1,null!==(n=window.location.href.toString())&&void 0!==n&&n.includes("status")?((0,O.jz)("status",e),(0,O.jz)("group_id","")):window.history.replaceState(null,"",window.location.href.indexOf("?")>-1?window.location.href+"&status=".concat(e):"?status=".concat(e)),F(A),pn(A,!0),Be([])},dataSource:_n,titleWidth:28}),ce&&(0,B.jsxs)("div",{className:N.group,children:[(0,B.jsx)(te,{item_banks_groups:null==We?void 0:We.groups,getItem:ln,user:k,groupIds:ze,onChangeGroup:un}),(0,B.jsx)("div",{className:N.add,style:{border:(null==We||null===(r=We.groups)||void 0===r?void 0:r.length)<=0&&"none",textAlign:(null==We||null===(a=We.groups)||void 0===a?void 0:a.length)<=0&&"left"},onClick:function(){var e;20!==(null==We||null===(e=We.groups)||void 0===e?void 0:e.length)?ye(!0):_.ZP.info("目录数最大为20")},children:"新建目录"})]}),(0,B.jsxs)("div",{className:N.midWrap,children:[(0,B.jsx)(re.cq,{sortValue:A.sort_direction,dropValue:A.sort_by,onSort:function(e){A.sort_direction=e,F(A),pn(A)},onDrop:function(e){A.sort_by=e,A.sort_direction="desc",F(A),pn(A)}}),(0,B.jsxs)("div",{className:N.type,children:[(0,B.jsx)(v.Z,{title:"图片模式",children:(0,B.jsx)("i",{className:1===xe?"iconfont icon-fenbu ".concat(N.cursorPointer," ").concat(N.color0152d9):"iconfont icon-fenbu ".concat(N.cursorPointer),onClick:function(){fe(1),localStorage.setItem("ShixunShowType","1")}})}),(0,B.jsx)("span",{className:N.orderDesc,children:(0,B.jsx)(v.Z,{title:"列表模式",children:(0,B.jsx)("i",{className:2===xe?"iconfont icon-fenbu-2 ".concat(N.cursorPointer," ").concat(N.color0152d9," "):"iconfont icon-fenbu-2 ".concat(N.cursorPointer),onClick:function(){fe(2),localStorage.setItem("ShixunShowType","2")}})})})]}),ce&&(0,B.jsx)(v.Z,{title:1===xe?"请在列表模式中选中实训项目加入目录":"请选择实践项目",children:(0,B.jsx)("a",{onClick:function(){var e;1!==xe&&((null==Ge?void 0:Ge.length)<=0?_.ZP.info(1===xe?"请在列表模式中选中实训项目加入目录":"请选择实践项目"):(null==We||null===(e=We.groups)||void 0===e?void 0:e.length)<=0?_.ZP.info("您尚未创建任何目录"):Ce(!0))},style:{marginLeft:8,color:1===xe?"#00000040":"#3061d0",cursor:1===xe&&"no-drop"},children:"加入目录"})}),"学生"!==(null===(s=k.userInfo)||void 0===s?void 0:s.user_identity)&&!(null!=I&&null!==(l=I.setting)&&void 0!==l&&l.hide_shixun)&&(null==k||null===(u=k.userInfo)||void 0===u?void 0:u.is_shixun_marker)&&(0,B.jsx)(re.op,{style:{marginLeft:"auto"},className:N.btn,onClick:function(){return x.history.push("/shixuns/new")},children:"新建实践项目"})]}),(0,B.jsxs)(b.Z,{loading:W["userDetail/getShixuns"],active:!0,paragraph:{rows:5},children:[1===xe&&(0,B.jsxs)("div",{className:N.cardWrap,children:[!(null!=ee&&ee.length)&&(A.category||A.search)&&(0,B.jsx)(Z.Z,{}),(0,B.jsx)(R,{data:ee,params:A,user:k,onRemove:mn,onCancelCollect:gn})]}),1!=xe&&(0,B.jsx)("div",{className:"mt10",style:{minHeight:400},children:(0,B.jsx)(H,{number:(A.page-1)*A.per_page,onRemove:mn,user:k,isCurrent:ce,onCancelCollect:gn,setGroupIds:function(e){Le(c()(e))},setUnGrouplists:function(e,n){rn(c()(e)),cn([n]),ke(!0)},params:A,data:ee,setParams:F,getShixuns:pn})}),J>0&&(0,B.jsx)("div",{className:N.countWrap,children:(0,B.jsx)(y.Z,{showQuickJumper:!0,showSizeChanger:!0,pageSizeOptions:["10","20","50","100","200"],hideOnSinglePage:!0,total:J,onChange:function(e,n){!function(e,n){A.page=e,A.per_page=n,F(A),pn(A)}(e,n)},pageSize:A.per_page,current:A.page})})]}),(0,B.jsx)(f.Z,{open:be,title:"新建目录",wrapClassName:oe.Z.CustomCss,onCancel:function(){ye(!1)},onOk:d()(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,K.ZP)("/api/users/".concat(null==k||null===(n=k.userInfo)||void 0===n?void 0:n.login,"/user_setting_groups.json"),{method:"post",body:{type:"Shixun",name:Fe}});case 2:0===(null==(t=e.sent)?void 0:t.status)&&(_.ZP.info("创建目录成功"),ye(!1),He(""),ln());case 4:case"end":return e.stop()}}),e)}))),children:(0,B.jsx)(j.Z,{value:Fe,onChange:function(e){He(e.target.value)},placeholder:"请输入不超过20个字的目录名称",maxLength:20})}),(0,B.jsx)(f.Z,{open:Se,title:"加入目录",onCancel:function(){Ce(!1)},footer:(0,B.jsx)("div",{style:{textAlign:"end"},children:(0,B.jsx)(w.ZP,{type:"primary",onClick:d()(o()().mark((function e(){var n,t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((null==Xe?void 0:Xe.length)<=0)){e.next=3;break}return _.ZP.info("请选择要加入的目录"),e.abrupt("return");case 3:return e.next=5,(0,K.ZP)("/api/users/".concat(null==k||null===(n=k.userInfo)||void 0===n?void 0:n.login,"/user_setting_groups/join.json"),{method:"post",body:{type:"Shixun",group_ids:Xe,item_ids:Ge}});case 5:0===(null==(t=e.sent)?void 0:t.status)&&_.ZP.info("加入成功"),un(ze),qe([]),Ce(!1),Le([]);case 11:case"end":return e.stop()}}),e)}))),children:"确认"})}),children:(0,B.jsxs)("div",{children:[(0,B.jsx)("span",{children:"请选择需要加入的目录"}),(0,B.jsx)("br",{}),(0,B.jsx)(S.Z.Group,{value:Xe,onChange:function(e){qe(c()(e))},style:{marginTop:"20px"},children:(0,B.jsx)(C.Z,{style:{width:"400px"},children:null==We||null===(g=We.groups)||void 0===g?void 0:g.map((function(e,n){return(0,B.jsx)($.Z,{span:6,style:{marginTop:"10px"},children:(0,B.jsx)(S.Z,{value:e.id,style:{fontSize:"14px"},children:e.name})})}))})})]})}),(0,B.jsx)(f.Z,{open:Ze,title:"撤销目录",onCancel:function(){ke(!1)},footer:(0,B.jsx)("div",{style:{textAlign:"end"},children:(0,B.jsx)(w.ZP,{type:"primary",onClick:d()(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 _.ZP.info("请选择要撤销的目录"),e.abrupt("return");case 3:return e.next=5,(0,K.ZP)("/api/users/".concat(null==k||null===(n=k.userInfo)||void 0===n?void 0:n.login,"/user_setting_groups/cancel.json"),{method:"post",body:{type:"Shixun",group_ids:Ue,item_ids:sn}});case 5:0===(null==(t=e.sent)?void 0:t.status)&&_.ZP.info("撤销成功"),pn(A),Qe([]),ke(!1),cn([]);case 11:case"end":return e.stop()}}),e)}))),children:"确认"})}),children:(0,B.jsxs)("div",{children:[(0,B.jsx)("span",{children:"请选择需要撤销的目录"}),(0,B.jsx)("br",{}),(0,B.jsx)(S.Z.Group,{value:Ue,onChange:function(e){Qe(c()(e))},style:{marginTop:"20px"},children:(0,B.jsx)(C.Z,{style:{width:"400px"},children:null==tn?void 0:tn.map((function(e,n){return(0,B.jsx)($.Z,{span:6,style:{marginTop:"10px"},children:(0,B.jsx)(S.Z,{value:e.id,style:{fontSize:"14px"},children:e.name})})}))})})]})})]})}))},11806: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"}},18889:function(e,n,t){t.d(n,{Z:function(){return P}});var r=t(92310),o=t.n(r),a=t(55405),i=t(59301),s=t(36355),c=t(19716),l=t(66999),d=t(99313),u=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t};var p=e=>{var{prefixCls:n,className:t,hoverable:r=!0}=e,a=u(e,["prefixCls","className","hoverable"]);const{getPrefixCls:c}=i.useContext(s.E_),l=c("card",n),d=o()(`${l}-grid`,t,{[`${l}-grid-hoverable`]:r});return i.createElement("div",Object.assign({},a,{className:d}))},g=t(17313),m=t(83116),h=t(37613);const x=e=>{const{antCls:n,componentCls:t,headerHeight:r,cardPaddingBase:o,tabsMarginBottom:a}=e;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:r,marginBottom:-1,padding:`0 ${o}px`,color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.headerFontSize,background:e.headerBg,borderBottom:`${e.lineWidth}px ${e.lineType} ${e.colorBorderSecondary}`,borderRadius:`${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`},(0,g.dF)()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":Object.assign(Object.assign({display:"inline-block",flex:1},g.vS),{[`\n > ${t}-typography,\n > ${t}-typography-edit-content\n `]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),[`${n}-tabs-top`]:{clear:"both",marginBottom:a,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,"&-bar":{borderBottom:`${e.lineWidth}px ${e.lineType} ${e.colorBorderSecondary}`}}})},f=e=>{const{cardPaddingBase:n,colorBorderSecondary:t,cardShadow:r,lineWidth:o}=e;return{width:"33.33%",padding:n,border:0,borderRadius:0,boxShadow:`\n ${o}px 0 0 0 ${t},\n 0 ${o}px 0 0 ${t},\n ${o}px ${o}px 0 0 ${t},\n ${o}px 0 0 0 ${t} inset,\n 0 ${o}px 0 0 ${t} inset;\n `,transition:`all ${e.motionDurationMid}`,"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:r}}},_=e=>{const{componentCls:n,iconCls:t,actionsLiMargin:r,cardActionsIconSize:o,colorBorderSecondary:a,actionsBg:i}=e;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:i,borderTop:`${e.lineWidth}px ${e.lineType} ${a}`,display:"flex",borderRadius:`0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px `},(0,g.dF)()),{"& > li":{margin:r,color:e.colorTextDescription,textAlign:"center","> span":{position:"relative",display:"block",minWidth:2*e.cardActionsIconSize,fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer","&:hover":{color:e.colorPrimary,transition:`color ${e.motionDurationMid}`},[`a:not(${n}-btn), > ${t}`]:{display:"inline-block",width:"100%",color:e.colorTextDescription,lineHeight:e.fontSize*e.lineHeight+"px",transition:`color ${e.motionDurationMid}`,"&:hover":{color:e.colorPrimary}},[`> ${t}`]:{fontSize:o,lineHeight:o*e.lineHeight+"px"}},"&:not(:last-child)":{borderInlineEnd:`${e.lineWidth}px ${e.lineType} ${a}`}}})},v=e=>Object.assign(Object.assign({margin:`-${e.marginXXS}px 0`,display:"flex"},(0,g.dF)()),{"&-avatar":{paddingInlineEnd:e.padding},"&-detail":{overflow:"hidden",flex:1,"> div:not(:last-child)":{marginBottom:e.marginXS}},"&-title":Object.assign({color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG},g.vS),"&-description":{color:e.colorTextDescription}}),b=e=>{const{componentCls:n,cardPaddingBase:t,colorFillAlter:r}=e;return{[`${n}-head`]:{padding:`0 ${t}px`,background:r,"&-title":{fontSize:e.fontSize}},[`${n}-body`]:{padding:`${e.padding}px ${t}px`}}},y=e=>{const{componentCls:n}=e;return{overflow:"hidden",[`${n}-body`]:{userSelect:"none"}}},j=e=>{const{antCls:n,componentCls:t,cardShadow:r,cardHeadPadding:o,colorBorderSecondary:a,boxShadowTertiary:i,cardPaddingBase:s,extraColor:c}=e;return{[t]:Object.assign(Object.assign({},(0,g.Wf)(e)),{position:"relative",background:e.colorBgContainer,borderRadius:e.borderRadiusLG,[`&:not(${t}-bordered)`]:{boxShadow:i},[`${t}-head`]:x(e),[`${t}-extra`]:{marginInlineStart:"auto",color:c,fontWeight:"normal",fontSize:e.fontSize},[`${t}-body`]:Object.assign({padding:s,borderRadius:` 0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px`},(0,g.dF)()),[`${t}-grid`]:f(e),[`${t}-cover`]:{"> *":{display:"block",width:"100%"},[`img, img + ${n}-image-mask`]:{borderRadius:`${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`}},[`${t}-actions`]:_(e),[`${t}-meta`]:v(e)}),[`${t}-bordered`]:{border:`${e.lineWidth}px ${e.lineType} ${a}`,[`${t}-cover`]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},[`${t}-hoverable`]:{cursor:"pointer",transition:`box-shadow ${e.motionDurationMid}, border-color ${e.motionDurationMid}`,"&:hover":{borderColor:"transparent",boxShadow:r}},[`${t}-contain-grid`]:{[`${t}-body`]:{display:"flex",flexWrap:"wrap"},[`&:not(${t}-loading) ${t}-body`]:{marginBlockStart:-e.lineWidth,marginInlineStart:-e.lineWidth,padding:0}},[`${t}-contain-tabs`]:{[`> ${t}-head`]:{[`${t}-head-title, ${t}-extra`]:{paddingTop:o}}},[`${t}-type-inner`]:b(e),[`${t}-loading`]:y(e),[`${t}-rtl`]:{direction:"rtl"}}},w=e=>{const{componentCls:n,cardPaddingSM:t,headerHeightSM:r,headerFontSizeSM:o}=e;return{[`${n}-small`]:{[`> ${n}-head`]:{minHeight:r,padding:`0 ${t}px`,fontSize:o,[`> ${n}-head-wrapper`]:{[`> ${n}-extra`]:{fontSize:e.fontSize}}},[`> ${n}-body`]:{padding:t}},[`${n}-small${n}-contain-tabs`]:{[`> ${n}-head`]:{[`${n}-head-title, ${n}-extra`]:{minHeight:r,paddingTop:0,display:"flex",alignItems:"center"}}}}};var S=(0,m.Z)("Card",(e=>{const n=(0,h.TS)(e,{cardShadow:e.boxShadowCard,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardActionsIconSize:e.fontSize,cardPaddingSM:12});return[j(n),w(n)]}),(e=>({headerBg:"transparent",headerFontSize:e.fontSizeLG,headerFontSizeSM:e.fontSize,headerHeight:e.fontSizeLG*e.lineHeightLG+2*e.padding,headerHeightSM:e.fontSize*e.lineHeight+2*e.paddingXS,actionsBg:e.colorBgContainer,actionsLiMargin:`${e.paddingSM}px 0`,tabsMarginBottom:-e.padding-e.lineWidth,extraColor:e.colorText}))),C=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t};const $=i.forwardRef(((e,n)=>{const{prefixCls:t,className:r,rootClassName:u,style:g,extra:m,headStyle:h={},bodyStyle:x={},title:f,loading:_,bordered:v=!0,size:b,type:y,cover:j,actions:w,tabList:$,children:N,activeTabKey:Z,defaultActiveTabKey:k,tabBarExtraContent:P,hoverable:I,tabProps:W={}}=e,O=C(e,["prefixCls","className","rootClassName","style","extra","headStyle","bodyStyle","title","loading","bordered","size","type","cover","actions","tabList","children","activeTabKey","defaultActiveTabKey","tabBarExtraContent","hoverable","tabProps"]),{getPrefixCls:T,direction:E,card:z}=i.useContext(s.E_),B=i.useMemo((()=>{let e=!1;return i.Children.forEach(N,(n=>{n&&n.type&&n.type===p&&(e=!0)})),e}),[N]),R=T("card",t),[M,G]=S(R),L=i.createElement(l.Z,{loading:!0,active:!0,paragraph:{rows:4},title:!1},N),D=void 0!==Z,A=Object.assign(Object.assign({},W),{[D?"activeKey":"defaultActiveKey"]:D?Z:k,tabBarExtraContent:P});let F;const H=(0,c.Z)(b),V=H&&"default"!==H?H:"large",K=$?i.createElement(d.Z,Object.assign({size:V},A,{className:`${R}-head-tabs`,onChange:n=>{var t;null===(t=e.onTabChange)||void 0===t||t.call(e,n)},items:$.map((e=>{var{tab:n}=e,t=C(e,["tab"]);return Object.assign({label:n},t)}))})):null;(f||m||K)&&(F=i.createElement("div",{className:`${R}-head`,style:h},i.createElement("div",{className:`${R}-head-wrapper`},f&&i.createElement("div",{className:`${R}-head-title`},f),m&&i.createElement("div",{className:`${R}-extra`},m)),K));const X=j?i.createElement("div",{className:`${R}-cover`},j):null,q=i.createElement("div",{className:`${R}-body`,style:x},_?L:N),J=w&&w.length?i.createElement("ul",{className:`${R}-actions`},function(e){return e.map(((n,t)=>i.createElement("li",{style:{width:100/e.length+"%"},key:`action-${t}`},i.createElement("span",null,n))))}(w)):null,Y=(0,a.Z)(O,["onTabChange"]),U=o()(R,null==z?void 0:z.className,{[`${R}-loading`]:_,[`${R}-bordered`]:v,[`${R}-hoverable`]:I,[`${R}-contain-grid`]:B,[`${R}-contain-tabs`]:$&&$.length,[`${R}-${H}`]:H,[`${R}-type-${y}`]:!!y,[`${R}-rtl`]:"rtl"===E},r,u,G),Q=Object.assign(Object.assign({},null==z?void 0:z.style),g);return M(i.createElement("div",Object.assign({ref:n},Y,{className:U,style:Q}),F,X,q,J))}));var N=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t};var Z=e=>{const{prefixCls:n,className:t,avatar:r,title:a,description:c}=e,l=N(e,["prefixCls","className","avatar","title","description"]),{getPrefixCls:d}=i.useContext(s.E_),u=d("card",n),p=o()(`${u}-meta`,t),g=r?i.createElement("div",{className:`${u}-meta-avatar`},r):null,m=a?i.createElement("div",{className:`${u}-meta-title`},a):null,h=c?i.createElement("div",{className:`${u}-meta-description`},c):null,x=m||h?i.createElement("div",{className:`${u}-meta-detail`},m,h):null;return i.createElement("div",Object.assign({},l,{className:p}),g,x)};const k=$;k.Grid=p,k.Meta=Z;var P=k}}]); |