"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[19360],{82397:function(e,t,n){n.r(t),n.d(t,{default:function(){return z}});var a=n(7557),r=n.n(a),i=n(82242),s=n.n(i),o=n(41498),l=n.n(o),c=n(79800),u=n.n(c),d=n(39647),g=n.n(d),h=n(59301),m=n(49389),p=n(99313),f=n(61621),v=n(58421),x=n(94171),y=n(83287),_="order___Qysjp",j="listWarp___BsT0V",w="li___ndfmM",b="img___Ric6Z",S="name___aCd4t",k="e___aP2FC",N=n(6848),C=n(91689),Z=n(37712),D=function(e){var t=e.data,n=e.marginLeft,a=void 0===n?21:n,r=e.listWarpStyle,i=void 0===r?{}:r,s=e.width,o=void 0===s?282:s,l=e.height,c=void 0===l?257:l;return(0,Z.jsx)("ul",{className:j,style:i,children:t.map((function(e,t){var n=e.name,r=(e.id,e.backbground_image_url,e.cover_url),i=e.category_url;return(0,Z.jsxs)("a",{target:"_blank",href:i,className:w,style:{marginLeft:a,width:o,height:c},children:[(0,Z.jsx)("div",{className:b,children:(0,Z.jsx)("img",{src:C.Z.IMG_SERVER+r,alt:"封面图"})}),(0,Z.jsx)("div",{className:S,children:(0,Z.jsx)(N.Z,{title:n,children:(0,Z.jsx)("span",{className:k,children:n})})})]},t)}))})},P=n(36723),T=n(89999),A=n(67554),E=n(7338),I=n(940),O=["user","userDetail","globalSetting","dispatch"],z=(p.Z.TabPane,(0,m.connect)((function(e){return{user:e.user,userDetail:e.userDetail,globalSetting:e.globalSetting}}))((function(e){var t,n=e.user,a=(e.userDetail,e.globalSetting,e.dispatch),i=(g()(e,O),(0,m.useSearchParams)()),o=u()(i,1)[0],c=((0,m.useLocation)(),(0,h.useState)({category:o.get("category")||"all",page:1,limit:15})),d=u()(c,2),p=d[0],j=d[1],w=(0,h.useState)([]),b=u()(w,2),S=b[0],k=b[1],N=(0,h.useState)(0),C=u()(N,2),z=C[0],L=C[1],R=(0,h.useState)(!0),V=u()(R,2),B=V[0],G=V[1],M=(0,h.useState)(!1),Q=u()(M,2),W=Q[0],F=Q[1];(0,h.useEffect)((function(){(0,y.Dk)("虚拟社区"),H(p)}),[]);var H=function(){var e=l()(r()().mark((function e(t){var n,a;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return G(!0),n=s()({},t),e.next=4,(0,x.ZP)("/api/virtual_classrooms/mine.json",{method:"get",params:n});case 4:null!=(a=e.sent)&&a.virtual_classrooms&&(k(null==a?void 0:a.virtual_classrooms),L(null==a?void 0:a.total_count),G(!1));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),J=function(){var e=l()(r()().mark((function e(t,n){var i;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,x.ZP)("/api/virtual_classrooms.json",{method:"post",body:t});case 2:0===(null==(i=e.sent)?void 0:i.status)&&(H(p),F(!1),setTimeout((function(){(0,y.xg)(null==i?void 0:i.category_url)}),300),a({type:"shixunHomeworks/setActionTabs",payload:{key:"提示",type:99}})),n(i);case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();return(0,Z.jsxs)("div",{className:_,children:[(0,Z.jsx)(I.YG,{value:null==p?void 0:p.category,onChange:function(e){var t;null!==(t=window.location.href.toString())&&void 0!==t&&t.includes("category")?(0,y.jz)("category",e):window.history.replaceState(null,"",window.location.href.indexOf("?")>-1?window.location.href+"&category=".concat(e):"?category=".concat(e)),p.category=e,p.page=1,j(s()({},p)),H(p)},tabBarExtraContent:(0,E.bg)()&&("teacher"===(null===(t=n.userInfo)||void 0===t?void 0:t.identity)||(0,E.Ny)())&&(0,Z.jsx)(I.op,{onClick:function(){((0,E.Ny)()||(0,A.O5)())&&F(!0)},children:"新建虚拟社区"}),className:"mb25",dataSource:[{name:"全部",id:"all"},{name:"我管理的",id:"manage"},{name:"我参与的",id:"partake"}]}),(0,Z.jsx)(f.Z,{loading:B,active:!0,paragraph:{rows:5},children:S.length?(0,Z.jsx)(D,{data:S||[]}):(0,Z.jsxs)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",margin:"100px 0 20px 0"},children:[(0,Z.jsx)("img",{src:P,width:204,alt:""}),(0,Z.jsx)("span",{style:{color:"#6A6A6A"},children:"暂无数据"})]})}),(0,Z.jsx)(v.Z,{hideOnSinglePage:!0,onChange:function(e){return function(e){document.body.scrollIntoView(),p.page=e,j(s()({},p)),H(p)}(e)},current:p.page,pageSize:p.limit,total:z,showQuickJumper:!0,showSizeChanger:!1,showTotal:function(e){return(0,Z.jsxs)("span",{className:"mr10",children:["共",(0,Z.jsx)("span",{className:"c-orange",children:e}),"条数据"]})},className:"tc pb30"}),(0,Z.jsx)(T.Z,{visible:W,title:"新建虚拟社区",onCancel:function(){return F(!1)},onOk:J})]})})))}}]);