|
|
(self.webpackChunk=self.webpackChunk||[]).push([[61713],{22845:function(e,t,n){"use strict";var s=n(82242),i=n.n(s),a=(n(59301),n(19779)),r=n(3113),l=n(37712);t.Z=function(e){var t=e.img,n=e.buttonProps,s=void 0===n?{}:n,o=e.styles,c=void 0===o?{}:o,u=e.customText,d=e.ButtonText,p=e.ButtonClick,m=e.Buttonclass,h=e.ButtonTwo,f=e.imgStyles,v=e.loading,x=void 0!==v&&v;return(0,l.jsxs)("section",{className:"tc animated fadeIn",style:i()(i()({},{color:"#999",margin:"100px auto",visibility:x?"hidden":"visible"}),c),children:[(0,l.jsx)("img",{src:t||a,style:i()({width:288,height:200},f)}),(0,l.jsx)("p",{className:"mt20 font14",children:u||"暂时还没有相关数据哦!"}),d&&(0,l.jsx)(r.ZP,i()(i()({className:m,onClick:p},s),{},{children:d})),h&&h]})}},50550:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return ee}});var s=n(7557),i=n.n(s),a=n(41498),r=n.n(a),l=n(79800),o=n.n(l),c=n(59301),u=n(51836),d="wrap___dX7Vx",p=n(82242),m=n.n(p),h=n(39647),f=n.n(h),v=n(78241),x=n(8591),_=n(98135),g=n(46651),y=n(95237),b=n(24905),j=n(3113),w={flex_box_center:"flex_box_center___y1YZJ",flex_space_between:"flex_space_between___wTOwl",flex_box_vertical_center:"flex_box_vertical_center___XmLwW",flex_box_center_end:"flex_box_center_end___gWVqd",flex_box_column:"flex_box_column___PjZDS",form:"form___JA0Ze",text:"text___cCcOQ",img:"img___ht1lh",title:"title___mljGY",list:"list___isVFT",btn:"btn___IUjb1"},S=n(68339),k=n(97650),Z=n(96707),L=n(27030),C=n(37712),P=["globalSetting","virtualSpaces","dispatch"],N=["key","name"],I=(0,Z.connect)((function(e){return{globalSetting:e.globalSetting,virtualSpaces:e.virtualSpaces}}))((function(e){e.globalSetting;var t,n,s=e.virtualSpaces,a=e.dispatch,l=(f()(e,P),(0,Z.useParams)()),d=s.virtualSpacesDetails,p=s.menus,h=(0,c.useState)(!1),I=o()(h,2),T=I[0],E=I[1],O=(0,c.useState)(!0),M=o()(O,2),V=(M[0],M[1],v.Z.useForm()),D=o()(V,1)[0],R=(0,c.useState)([]),H=o()(R,2),z=H[0],F=H[1],Y=(0,c.useState)([]),A=o()(Y,2),W=A[0],B=A[1],U=(0,c.useState)(!1),q=o()(U,2),X=q[0],G=q[1];(0,c.useEffect)((function(){if(null!=d&&d.id&&null!=p&&p.length){var e,t,n,s;D.setFieldsValue({name:null==d?void 0:d.name,vs_type:null==d?void 0:d.vs_type,identifier:null==d?void 0:d.identifier,settings:p.map((function(e){return m()(m()({},e),{},{checked:!e.hidden})}))});var i=null!=d&&null!==(e=d.cover_url)&&void 0!==e&&e.includes("attachments")?[{response:{id:null==d||null===(t=d.cover_url)||void 0===t?void 0:t.split("/")[3]}}]:[],a=null!=d&&null!==(n=d.backbground_image_url)&&void 0!==n&&n.includes("attachments")?[{response:{id:null==d||null===(s=d.backbground_image_url)||void 0===s?void 0:s.split("/")[3]}}]:[];F(i),B(a)}}),[d,p]);var J=function(){var e=r()(i()().mark((function e(t){var n,s,r,o,c;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return E(!0),o={name:null==t?void 0:t.name,vs_type:null==t?void 0:t.vs_type,identifier:null==t?void 0:t.identifier,cover_id:(null==z||null===(n=z[0])||void 0===n||null===(n=n.response)||void 0===n?void 0:n.id)||"",backbground_image_id:(null==W||null===(s=W[0])||void 0===s||null===(s=s.response)||void 0===s?void 0:s.id)||"",modules_list:null==t||null===(r=t.settings)||void 0===r?void 0:r.map((function(e){return m()(m()({},e),{},{hidden:!e.checked})}))},e.next=4,(0,u.ZP)("/api/virtual_classrooms/".concat(l.virtual_spacesId,".json"),{method:"put",body:o});case 4:-1!==(null==(c=e.sent)?void 0:c.status)&&(x.ZP.success("修改成功"),a({type:"virtualSpaces/getVirtualSpacesMenus",payload:{id:null==t?void 0:t.identifier}}),a({type:"virtualSpaces/getVirtualSpacesDetails",payload:{id:null==t?void 0:t.identifier}}),Z.history.replace("/".concat("classroom"===(null==t?void 0:t.vs_type)?"vtrs":"101","/").concat(null==t?void 0:t.identifier,"/settings"))),-3===(null==c?void 0:c.status)&&D.setFields([{name:"identifier",errors:["该标识已存在,请更换"]}]),E(!1);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),$=function(e,t){["uploading","done","removed"].includes(e.file.status)&&("uploading"===e.file.status&&G(!0),"done"===e.file.status&&G(!1),1===t?F(e.fileList):B(e.fileList))},K=function(e,t){1===t?F([]):B([])},Q=function(e,t){if(!("image/jpeg"===e.type||"image/png"===e.type))return x.ZP.warning("请上传jpg或png的图片!"),!1;var n=e.size/1024>200,s=e.size/1024/1024>1;return n&&1===t?(x.ZP.warning("文件大小必须小于200KB"),!1):s&&2===t?(x.ZP.warning("文件大小必须小于1MB"),!1):(1===t?F([]):B([]),!0)},ee=function(e){var t,n;return(0,C.jsxs)("div",{className:w.img,children:[(0,C.jsx)("img",{src:S.Z.API_SERVER+"/api/attachments/"+(1===e?null==z||null===(t=z[0])||void 0===t||null===(t=t.response)||void 0===t?void 0:t.id:null==W||null===(n=W[0])||void 0===n||null===(n=n.response)||void 0===n?void 0:n.id),alt:"avatar",style:{width:"100%"}}),(0,C.jsx)("div",{children:(0,C.jsx)(k.Z,{onClick:function(){1===e?F([]):B([])},style:{fontSize:"16px",color:"red"}})})]})};return(0,C.jsxs)(v.Z,{form:D,colon:!1,onFinish:J,className:w.form,children:[(0,C.jsx)(v.Z.Item,{label:"社区名称",name:"name",rules:[{required:!0,message:"请输入社区名称"},{whitespace:!0,message:"请输入社区名称"},{max:60,message:"只能输入60个字符"}],children:(0,C.jsx)(_.Z,{style:{width:516},maxLength:60,placeholder:"请输入社区名称"})}),(0,C.jsx)(v.Z.Item,{label:(0,C.jsx)("span",{style:{width:66},children:"标识"}),name:"identifier",rules:[{pattern:/^[a-zA-Z0-9]+$/,message:"仅支持填写英文和数字"}],children:(0,C.jsx)(_.Z,{style:{width:516},maxLength:15})}),(0,C.jsx)(v.Z.Item,{name:"cover_id",label:"封面图",className:"mt30",children:(0,C.jsxs)("div",{className:w.upload,children:[null!=z&&null!==(t=z[0])&&void 0!==t&&null!==(t=t.response)&&void 0!==t&&t.id?ee(1):(0,C.jsx)(g.Z,{fileList:z,action:"".concat(S.Z.API_SERVER,"/api/attachments.json"),onChange:function(e){return $(e,1)},onRemove:function(e){return K(0,1)},beforeUpload:function(e){return Q(e,1)},withCredentials:!0,accept:"image/*",children:(0,C.jsx)(L.op,{className:"radius2",children:"上传图片"})}),(0,C.jsx)("aside",{className:w.text,children:"仅支持上传jpg/png格式文件,文件大小不能超过200KB,建议使用282*228像素;如不上传,默认使用系统图片。"})]})}),(0,C.jsx)(v.Z.Item,{name:"backbground_image_id",label:"详情顶部背景",className:"mt30",children:(0,C.jsxs)("div",{className:w.upload,children:[null!=W&&null!==(n=W[0])&&void 0!==n&&null!==(n=n.response)&&void 0!==n&&n.id?ee(2):(0,C.jsx)(g.Z,{fileList:W,action:"".concat(S.Z.API_SERVER,"/api/attachments.json"),onChange:function(e){return $(e,2)},onRemove:function(e){return K(0,2)},beforeUpload:function(e){return Q(e,2)},withCredentials:!0,accept:"image/*",children:(0,C.jsx)(L.op,{className:"radius2",children:"上传图片"})}),(0,C.jsx)("aside",{className:w.text,children:"仅支持上传jpg/png格式文件,文件大小不能超过1MB,建议使用3840*148像素;如不上传,默认使用系统图片。"})]})}),(0,C.jsxs)("div",{className:w.title,children:[(0,C.jsx)("b",{}),(0,C.jsx)("span",{children:"模块展示控制"})]}),(0,C.jsx)("div",{className:w.list,children:(0,C.jsx)(v.Z.List,{name:"settings",children:function(e,t){t.add,t.remove;var n=t.move;return(0,C.jsx)(C.Fragment,{children:e.map((function(t,s){var i=t.key,a=t.name,r=f()(t,N);return(0,C.jsx)("div",{children:(0,C.jsxs)(y.Z,{align:"top",children:[(0,C.jsx)(v.Z.Item,m()(m()({},r),{},{className:"mr20",valuePropName:"checked",name:[a,"checked"],children:(0,C.jsx)(b.Z,{disabled:p[i].disabled})})),(0,C.jsx)(v.Z.Item,m()(m()({},r),{},{style:{flex:1},name:[a,"name"],children:(0,C.jsx)(_.Z,{})})),(0,C.jsxs)("div",{className:"ml20",style:{width:60,display:"flex",alignItems:"center",justifyContent:"left",paddingTop:6},children:[0!==s&&s<=e.length-2&&(0,C.jsx)("div",{onClick:function(){var t;n(s,s-1);var i=null===(t=D.getFieldValue("settings"))||void 0===t?void 0:t.map((function(t,n){return e.map((function(e,s){n===s&&(t.position=Number(e.name)+1)})),t}));D.setFieldValue("settings",i)},children:(0,C.jsx)("i",{className:"iconfont icon-shangyi3",style:{transform:"translateY(2px)"}})}),s<e.length-2&&(0,C.jsx)("div",{onClick:function(){var t;n(s,s+1);var i=null===(t=D.getFieldValue("settings"))||void 0===t?void 0:t.map((function(t,n){return e.map((function(e,s){n===s&&(t.position=Number(e.name)+1)})),t}));D.setFieldValue("settings",i)},className:0===s?"":"ml10",style:{transform:"rotate(180deg) translateY(1px)"},children:(0,C.jsx)("i",{className:"iconfont icon-shangyi3"})})]})]})},i)}))})}})}),(0,C.jsx)(j.ZP,{disabled:X,loading:T,type:"primary",className:w.btn,onClick:function(){D.submit()},children:"确认修改"})]})})),T=n(43418),E=n(53864),O=n(22845),M={flex_box_center:"flex_box_center____FAUe",flex_space_between:"flex_space_between___JShCL",flex_box_vertical_center:"flex_box_vertical_center___YhLcd",flex_box_center_end:"flex_box_center_end___yfXIw",flex_box_column:"flex_box_column___zPH_W",warp:"warp____XM76",Content:"Content___dD_y0",imgstyle:"imgstyle___d5fnu",cardstyle:"cardstyle___uUh0g",paddingcard:"paddingcard___uEvZt",titlefont:"titlefont___HssVh",flexEnd:"flexEnd___Hl39R",modalinput:"modalinput___Vs9yI",items:"items___Gh25j",adminsstyle:"adminsstyle___dby7X",upadmin:"upadmin___JBDfN",yes:"yes___VIGe0",no:"no___e0VYU",tabs:"tabs___vHdEw",item_tab:"item_tab___gHOXT",active_tab:"active_tab___Th9Td",active_line:"active_line___dOPXK"},V=n(37205),D=n.n(V),R=n(6848),H=n(88522),z=n(14491),F=n(26724),Y=n.n(F),A=n(99232),W=n.n(A),B=n(14961),U=n(39324),q=n(7276),X=(0,Z.connect)((function(e){return{classroomList:e.classroomList,loading:e.loading}}))((function(e){var t,n,s=e.classroomList,a=(e.loading,e.dispatch),l=(0,Z.useParams)(),u=s.actionTabs,d=(0,c.useState)([]),p=o()(d,2),h=p[0],f=p[1],g=(0,c.useState)(!0),y=o()(g,2),w=y[0],S=y[1],k=(0,c.useState)(!1),L=o()(k,2),P=L[0],N=L[1],I=v.Z.useForm(),E=o()(I,1)[0],O=(0,c.useState)([]),M=o()(O,2),V=M[0],F=M[1],A=(0,c.useState)(0),X=o()(A,2),G=X[0],J=X[1],$=(0,c.useState)([]),K=o()($,2),Q=K[0],ee=K[1],te=(0,c.useState)(!0),ne=o()(te,2),se=ne[0],ie=ne[1],ae=(0,c.useRef)();(0,c.useEffect)((function(){"添加老师"===s.actionTabs.key&&(ie(!0),re())}),[s.actionTabs.key]);var re=function(){var e=r()(i()().mark((function e(){var t;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a({type:"classroomList/getSchoolList",payload:{}});case 2:t=e.sent,f(t.map((function(e){return{value:e}})));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),le=function(){var e=r()(i()().mark((function e(){var t,n,s,a,r=arguments;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=r.length>0&&void 0!==r[0]&&r[0])&&!w||P){e.next=11;break}return s=E.getFieldValue(),N(!0),J(t?1:G+1),e.next=7,(0,U.nQ)({page:t?1:G+1,container_id:l.virtual_spacesId,container_type:5,school_name:null==s?void 0:s.school_name,keyword:null==s?void 0:s.keyword});case 7:a=e.sent,F(t?D()(a.users):[].concat(D()(V),D()(a.users))),N(!1),(null===(n=a.users)||void 0===n?void 0:n.length)<10&&S(!1);case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),oe=function(){var e=r()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(""!=Q){e.next=4;break}x.ZP.error("请选择人数"),e.next=8;break;case 4:return e.next=6,(0,B.MM)(m()(m()({},l),{},{user_ids:Q}));case 6:0===e.sent.status&&(x.ZP.success("添加成功"),a({type:"classroomList/setActionTabs",payload:{key:"刷新数据"}}));case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ce=[{title:"",dataIndex:"added",width:40,ellipsis:!0,render:function(e,t){return(0,C.jsx)(b.Z,{value:t.numid,checked:Q.includes(String(t.numid)),disabled:!!e})}},{title:"姓名",width:100,ellipsis:!0,dataIndex:"username",render:function(e,t){return(0,C.jsx)(R.Z,{placement:"bottom",title:e,children:(0,C.jsx)(Z.Link,{className:"bold c-black",to:"/users/".concat(t.login),target:"_blank",children:e||"--"})})}},{title:"手机",width:100,dataIndex:"phone",ellipsis:!0,render:function(e){return(0,C.jsx)(R.Z,{placement:"bottom",title:e,children:(0,C.jsx)("span",{children:e||"--"})})}},{title:"邮箱",dataIndex:"email",width:100,ellipsis:!0,render:function(e){return(0,C.jsx)(R.Z,{placement:"bottom",title:e,children:(0,C.jsx)("span",{children:e||"--"})})}},{title:"学号/工号",width:100,dataIndex:"student_number",ellipsis:!0,render:function(e){return(0,C.jsx)(R.Z,{placement:"bottom",title:e,children:(0,C.jsx)("span",{children:e||"--"})})}},{title:"学校/单位",width:150,dataIndex:"school_name",ellipsis:!0,render:function(e){return(0,C.jsx)(R.Z,{placement:"bottom",title:e,children:(0,C.jsx)("span",{children:e||"--"})})}},{title:"院系/部门",dataIndex:"depart_name",width:130,ellipsis:!0,render:function(e){return(0,C.jsx)(R.Z,{placement:"bottom",title:e,children:(0,C.jsx)("span",{children:e||"--"})})}},{title:"实名认证",dataIndex:"school_name",width:100,render:function(e){return e?"是":"否"}},{title:"最后登录时间",dataIndex:"last_login_on",width:140,ellipsis:!0,render:function(e){return(0,C.jsx)(R.Z,{placement:"bottom",title:e,children:(0,C.jsx)("span",{children:W()(e).format("YYYY-MM-DD HH:mm")})})}},{title:"状态",dataIndex:"added",width:80,render:function(e){return 1===e?(0,C.jsx)("span",{className:"c-green",children:"已添加"}):(0,C.jsx)("span",{children:"未添加"})}}];return(0,C.jsxs)(T.Z,{centered:!0,title:"添加成员",open:"添加成员"===s.actionTabs.key,okText:"确定",cancelText:"取消",width:1100,zIndex:9999,bodyStyle:{minHeight:200},onOk:r()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:oe();case 1:case"end":return e.stop()}}),e)}))),onCancel:function(){ee([]),a({type:"classroomList/setActionTabs",payload:{}})},children:[(0,C.jsxs)(v.Z,{layout:"inline",form:E,initialValues:{school_name:"",keyword:""},className:"mt10",children:[(0,C.jsx)(v.Z.Item,{name:"keyword",label:"姓名:",children:(0,C.jsx)(_.Z,{allowClear:!0,style:{width:370},size:"middle",defaultValue:(null===(t=u.selectArrs)||void 0===t?void 0:t.category_name)||(null===(n=u.selectArrs)||void 0===n?void 0:n.name)})}),(0,C.jsx)(v.Z.Item,{name:"school_name",label:"单位:",children:(0,C.jsx)("div",{ref:ae,children:(0,C.jsx)(H.Z,{options:h,style:{width:400},size:"middle",placeholder:"请输入单位名称",filterOption:function(e,t){return-1!==t.value.toUpperCase().indexOf(e.toUpperCase())}})})}),(0,C.jsx)(v.Z.Item,{children:(0,C.jsx)(j.ZP,{htmlType:"submit",type:"primary",size:"middle",onClick:function(){return function(){var e;if(""===(null===(e=E.getFieldValue())||void 0===e?void 0:e.keyword))return F([]),void x.ZP.error("请输入姓名");ie(!1),S(!0),N(!1),ee([]),setTimeout((function(){le(!0)}),200)}()},children:"搜索"})})]}),se&&(0,C.jsxs)("div",{className:"tc font16 c-light-black mt40 pb30",children:[(0,C.jsx)("img",{src:q.RL,width:"100",alt:""}),(0,C.jsx)("br",{}),(0,C.jsx)("p",{className:"mt20",children:"请搜索要添加的人员"})]}),!se&&""==V&&!P&&(0,C.jsxs)("div",{className:"tc font16 c-light-black mt40 pb30",children:[(0,C.jsx)("img",{src:q.z3,width:"100",alt:""}),(0,C.jsx)("br",{}),(0,C.jsx)("p",{className:"mt20",children:"暂时还没有相关数据哦!"})]}),(!se&&""!=V||P)&&(0,C.jsxs)("section",{children:[(0,C.jsx)("div",{className:"flexd-table-header mt20",children:(0,C.jsx)(z.Z,{pagination:!1,dataSource:[],columns:ce})}),(0,C.jsx)("div",{style:{maxHeight:260,overflow:"auto"},children:(0,C.jsx)(Y(),{initialLoad:!1,pageStart:1,threshold:20,loadMore:function(e){le()},hasMore:w,useWindow:!1,children:(0,C.jsx)(z.Z,{loading:P,showHeader:!1,pagination:!1,dataSource:V,columns:ce,onRow:function(e){return{onClick:function(e){e.currentTarget.querySelector("input").disabled||function(e){e=String(e);var t=Q.indexOf(e);t<0?Q.push(e):Q.splice(t,1),ee(D()(Q))}(e.currentTarget.querySelector("input").value)}}}})})})]})]})})),G=n(5112),J=(0,Z.connect)((function(e){return{classroomList:e.classroomList,loading:e.loading}}))((function(e){var t,n,s=e.classroomList,a=(e.loading,e.dispatch),l=(0,Z.useParams)(),u=s.actionTabs,d=(0,c.useState)([]),p=o()(d,2),h=p[0],f=p[1],g=(0,c.useState)(!0),y=o()(g,2),b=y[0],w=y[1],S=(0,c.useState)(!1),k=o()(S,2),L=k[0],P=k[1],N=v.Z.useForm(),I=o()(N,1)[0],E=(0,c.useState)([]),O=o()(E,2),M=O[0],V=O[1],F=(0,c.useState)(0),A=o()(F,2),X=A[0],J=A[1],$=(0,c.useState)(),K=o()($,2),Q=K[0],ee=K[1],te=(0,c.useState)(!0),ne=o()(te,2),se=ne[0],ie=ne[1],ae=(0,c.useRef)();(0,c.useEffect)((function(){"更换管理员"===s.actionTabs.key&&(ie(!0),re())}),[s.actionTabs.key]);var re=function(){var e=r()(i()().mark((function e(){var t;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a({type:"classroomList/getSchoolList",payload:{}});case 2:t=e.sent,f(t.map((function(e){return{value:e}}))),ie(!1),w(!0),P(!1),ee(""),setTimeout((function(){le(!0)}),200);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),le=function(){var e=r()(i()().mark((function e(){var t,n,s,a,r=arguments;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=r.length>0&&void 0!==r[0]&&r[0])&&!b||L){e.next=11;break}return s=I.getFieldValue(),P(!0),J(t?1:X+1),e.next=7,(0,U.nQ)({page:t?1:X+1,container_id:l.virtual_spacesId,container_type:5,source:"virtual_classroom",school_name:null==s?void 0:s.school_name,keyword:null==s?void 0:s.keyword});case 7:a=e.sent,V(t?D()(a.users):[].concat(D()(M),D()(a.users))),P(!1),(null===(n=a.users)||void 0===n?void 0:n.length)<10&&w(!1);case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),oe=function(){var e=r()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(""!=Q){e.next=4;break}x.ZP.error("请选择成员"),e.next=8;break;case 4:return e.next=6,(0,B.xt)(m()(m()({},l),{},{id:Q,virtual_classroom_id:l.virtual_spacesId}));case 6:0===e.sent.status&&(x.ZP.success("更换成功"),a({type:"classroomList/setActionTabs",payload:{key:"刷新数据"}}));case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ce=[{title:"",dataIndex:"added",width:40,ellipsis:!0,render:function(e,t){return(0,C.jsx)(G.ZP,{value:t.numid,checked:Q===String(t.numid)})}},{title:"姓名",width:100,ellipsis:!0,dataIndex:"username",render:function(e,t){return(0,C.jsx)(R.Z,{placement:"bottom",title:e,children:(0,C.jsx)(Z.Link,{className:"bold c-black",to:"/users/".concat(t.login),target:"_blank",children:e||"--"})})}},{title:"手机",width:100,dataIndex:"phone",ellipsis:!0,render:function(e){return(0,C.jsx)(R.Z,{placement:"bottom",title:e,children:(0,C.jsx)("span",{children:e||"--"})})}},{title:"邮箱",dataIndex:"email",width:100,ellipsis:!0,render:function(e){return(0,C.jsx)(R.Z,{placement:"bottom",title:e,children:(0,C.jsx)("span",{children:e||"--"})})}},{title:"学号/工号",width:100,dataIndex:"student_number",ellipsis:!0,render:function(e){return(0,C.jsx)(R.Z,{placement:"bottom",title:e,children:(0,C.jsx)("span",{children:e||"--"})})}},{title:"学校/单位",width:150,dataIndex:"school_name",ellipsis:!0,render:function(e){return(0,C.jsx)(R.Z,{placement:"bottom",title:e,children:(0,C.jsx)("span",{children:e||"--"})})}},{title:"院系/部门",dataIndex:"depart_name",width:130,ellipsis:!0,render:function(e){return(0,C.jsx)(R.Z,{placement:"bottom",title:e,children:(0,C.jsx)("span",{children:e||"--"})})}},{title:"实名认证",dataIndex:"school_name",width:100,render:function(e){return e?"是":"否"}},{title:"最后登录时间",dataIndex:"last_login_on",width:140,ellipsis:!0,render:function(e){return(0,C.jsx)(R.Z,{placement:"bottom",title:e,children:(0,C.jsx)("span",{children:W()(e).format("YYYY-MM-DD HH:mm")})})}}];return(0,C.jsxs)(T.Z,{centered:!0,title:"更换管理员",open:"更换管理员"===s.actionTabs.key,okText:"确定",cancelText:"取消",width:1100,zIndex:9999,bodyStyle:{minHeight:200},onOk:r()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:oe();case 1:case"end":return e.stop()}}),e)}))),onCancel:function(){ee(""),a({type:"classroomList/setActionTabs",payload:{}})},children:[(0,C.jsxs)(v.Z,{layout:"inline",form:I,initialValues:{school_name:"",keyword:""},className:"mt10",children:[(0,C.jsx)(v.Z.Item,{name:"keyword",label:"姓名:",children:(0,C.jsx)(_.Z,{allowClear:!0,style:{width:370},size:"middle",defaultValue:(null===(t=u.selectArrs)||void 0===t?void 0:t.category_name)||(null===(n=u.selectArrs)||void 0===n?void 0:n.name)})}),(0,C.jsx)(v.Z.Item,{name:"school_name",label:"单位:",children:(0,C.jsx)("div",{ref:ae,children:(0,C.jsx)(H.Z,{options:h,style:{width:400},size:"middle",placeholder:"请输入单位名称",filterOption:function(e,t){return-1!==t.value.toUpperCase().indexOf(e.toUpperCase())}})})}),(0,C.jsx)(v.Z.Item,{children:(0,C.jsx)(j.ZP,{htmlType:"submit",type:"primary",size:"middle",onClick:function(){return function(){var e;if(""===(null===(e=I.getFieldValue())||void 0===e?void 0:e.keyword))return V([]),void x.ZP.error("请输入姓名");ie(!1),w(!0),P(!1),ee(""),setTimeout((function(){le(!0)}),200)}()},children:"搜索"})})]}),se&&(0,C.jsxs)("div",{className:"tc font16 c-light-black mt40 pb30",children:[(0,C.jsx)("img",{src:q.RL,width:"100",alt:""}),(0,C.jsx)("br",{}),(0,C.jsx)("p",{className:"mt20",children:"请搜索要添加的人员"})]}),!se&&""==M&&!L&&(0,C.jsxs)("div",{className:"tc font16 c-light-black mt40 pb30",children:[(0,C.jsx)("img",{src:q.z3,width:"100",alt:""}),(0,C.jsx)("br",{}),(0,C.jsx)("p",{className:"mt20",children:"暂时还没有相关数据哦!"})]}),(!se&&""!=M||L)&&(0,C.jsxs)("section",{children:[(0,C.jsx)("div",{className:"flexd-table-header mt20",children:(0,C.jsx)(z.Z,{pagination:!1,dataSource:[],columns:ce})}),(0,C.jsx)("div",{style:{maxHeight:260,overflow:"auto"},children:(0,C.jsx)(Y(),{initialLoad:!1,pageStart:1,threshold:20,loadMore:function(e){le()},hasMore:b,useWindow:!1,children:(0,C.jsx)(z.Z,{loading:L,showHeader:!1,pagination:!1,dataSource:M,columns:ce,onRow:function(e){return{onClick:function(e){var t;e.currentTarget.querySelector("input").disabled||(t=e.currentTarget.querySelector("input").value,t=String(t),ee(t))}}}})})})]})]})})),$=n(22961),K=["classroomList","globalSetting","virtualSpaces","user","loading","dispatch"],Q=(0,Z.connect)((function(e){var t=e.classroomList,n=e.loading,s=e.globalSetting,i=e.virtualSpaces,a=e.user;return{classroomList:t,globalSetting:s,loading:n.effects,virtualSpaces:i,user:a}}))((function(e){var t,n=e.classroomList,s=(e.globalSetting,e.virtualSpaces),a=e.user,l=(e.loading,e.dispatch),d=(f()(e,K),(0,c.useState)([])),p=o()(d,2),h=p[0],v=p[1],x=(0,c.useState)(!1),_=o()(x,2),g=(_[0],_[1],s.virtualSpacesDetails,(0,c.useState)("1")),y=o()(g,2),b=(y[0],y[1],(0,Z.useParams)()),j=(0,c.useState)({page:1,limit:16,search:"",virtual_classroom_id:b.virtual_spacesId,module_id:s.actionTabs.module_id}),w=o()(j,2),k=w[0],L=(w[1],(0,c.useState)([{name:"已审核",type:"agreed"},{name:"待审核",type:"pending"}])),P=o()(L,2),N=P[0],I=(P[1],(0,c.useState)("agreed")),V=o()(I,2),D=V[0],R=V[1];function H(){return z.apply(this,arguments)}function z(){return(z=r()(i()().mark((function e(){var t;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,u.ZP)("/api/virtual_classrooms/".concat(b.virtual_spacesId,"/members.json"),{method:"get",params:m()(m()({},k),{},{status:D})});case 2:t=e.sent,v(t);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return(0,c.useEffect)((function(){H()}),[D]),(0,c.useEffect)((function(){"刷新数据"===n.actionTabs.key&&(H(),l({type:"virtualSpaces/getVirtualSpacesDetails",payload:{id:b.virtual_spacesId}}))}),[n.actionTabs.key]),(0,C.jsxs)("div",{className:M.warp,children:[(0,C.jsx)("div",{className:M.tabs,children:N.map((function(e,t){return(0,C.jsx)("div",{className:"".concat(D==e.type?M.active_tab:M.item_tab),onClick:function(){R(e.type)},children:(0,C.jsxs)("div",{style:{position:"relative"},children:[e.name,"(","已审核"==e.name?null==h?void 0:h.member_count:null==h?void 0:h.apply_total_count,")",(0,C.jsx)("div",{className:"".concat(D==e.type?M.active_line:"")})]})},t)}))}),(0,C.jsxs)("div",{className:M.Content,children:[(null==h?void 0:h.total_count)<=0&&(0,C.jsx)(O.Z,{Buttonclass:M.buttonstyle,customText:"此项目还没有成员,立即添加它们吧~"}),null==h||null===(t=h.members)||void 0===t?void 0:t.map((function(e,t){return(0,C.jsxs)("div",{className:M.items,onClick:function(){window.open("/users/".concat(e.login))},children:[(0,C.jsxs)("div",{style:{display:"flex"},children:[(0,C.jsx)("img",{src:S.Z.IMG_SERVER+"/images/"+(null==e?void 0:e.image_url)}),(0,C.jsxs)("div",{children:[(0,C.jsxs)("div",{style:{fontSize:"16px",display:"flex",fontWeight:600},children:[null==e?void 0:e.name,(null==e?void 0:e.is_creator)&&(0,C.jsx)("div",{className:M.adminsstyle,children:"管理员"})]}),(0,C.jsxs)("div",{style:{fontSize:"14px",color:"#7D8592",marginTop:"7px"},children:[e.school,e.school&&e.department_name&&"-",e.department_name]})]})]}),(0,C.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[((null==e?void 0:e.is_creator)&&a.userInfo.user_id===e.user_id||(0,$.Ny)())&&0===t&&"agreed"===D&&(null==e?void 0:e.is_creator)&&(0,C.jsxs)("span",{onClick:function(e){e.stopPropagation(),e.preventDefault(),l({type:"classroomList/setActionTabs",payload:{key:"更换管理员",params:k}})},className:M.upadmin,children:[(0,C.jsx)("i",{className:"iconfont icon-genghuanguanliyuan mr5 font14"}),"更换管理员"]}),(null==e?void 0:e.can_remove)&&"agreed"===D&&(0,C.jsxs)("span",{className:"font14",onClick:function(t){var n;t.stopPropagation(),t.preventDefault(),T.Z.confirm({title:"移除成员",content:"确认将成员《".concat(e.name,"》移出虚拟社区吗?"),okText:"确认",cancelText:"取消",onOk:(n=r()(i()().mark((function t(){return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,u.ZP)("/api/virtual_classrooms/".concat(b.virtual_spacesId,"/members/").concat(e.user_id,".json"),{method:"Delete"});case 2:0===t.sent.status&&(H(),l({type:"virtualSpaces/getVirtualSpacesDetails",payload:{id:b.virtual_spacesId}}));case 4:case"end":return t.stop()}}),t)}))),function(){return n.apply(this,arguments)})})},style:{color:"#3061D0",cursor:"pointer"},children:[(0,C.jsx)("i",{className:"iconfont icon-piliangshanchubeifen mr5 font14"}),"删除成员"]}),!(null!=e&&e.is_creator)&&"pending"===D&&(0,C.jsxs)("div",{style:{cursor:"pointer"},children:[(0,C.jsx)("span",{onClick:function(){var t=r()(i()().mark((function t(n){return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n.stopPropagation(),n.preventDefault(),t.next=4,(0,u.ZP)("/api/virtual_classrooms/".concat(b.virtual_spacesId,"/agree.json"),{method:"post",body:{apply_id:e.source_id}});case 4:0===t.sent.status&&(H(),l({type:"virtualSpaces/getVirtualSpacesDetails",payload:{id:b.virtual_spacesId}}));case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),className:M.yes,children:"同意"}),(0,C.jsx)("span",{onClick:function(){var t=r()(i()().mark((function t(n){return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n.stopPropagation(),n.preventDefault(),t.next=4,(0,u.ZP)("/api/virtual_classrooms/".concat(b.virtual_spacesId,"/refuse.json"),{method:"post",body:{apply_id:e.source_id}});case 4:0===t.sent.status&&(H(),l({type:"virtualSpaces/getVirtualSpacesDetails",payload:{id:b.virtual_spacesId}}));case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),className:M.no,children:"拒绝"})]})]})]})}))]}),(0,C.jsx)(X,{}),(0,C.jsx)(J,{}),(0,C.jsx)(E.Z,{current:k.page,total:null==h?void 0:h.total_count,style:{textAlign:"end",marginBottom:"20px"},pageSize:k.limit,hideOnSinglePage:!0,onChange:function(e){k.page=e,H()}})]})})),ee=(0,Z.connect)((function(e){return{globalSetting:e.globalSetting,virtualSpaces:e.virtualSpaces}}))((function(e){var t,n=e.dispatch,s=e.virtualSpaces,a=(0,Z.useParams)().virtual_spacesId,l=(0,c.useState)("1"),p=o()(l,2),m=p[0],h=p[1],f=(0,c.useState)(!1),v=o()(f,2),x=v[0],_=v[1];(0,c.useEffect)((function(){g()}),[]);var g=function(){var e=r()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,u.ZP)("/api/virtual_classrooms/".concat(a,"/settings_auth.json"),{method:"get"});case 2:0===e.sent.status&&_(!0);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),y=[{id:"1",name:"模块设置"},{id:"2",name:"成员设置",total:null==s||null===(t=s.virtualSpacesDetails)||void 0===t?void 0:t.members_count}];return x?(0,C.jsxs)("div",{className:d,children:[(0,C.jsx)(L.YG,{value:m,onChange:function(e){h(e)},dataSource:y,tabBarExtraContent:"2"===m&&(0,C.jsx)(L.op,{onClick:function(){n({type:"classroomList/setActionTabs",payload:{key:"添加成员",params:{}}})},children:"添加成员"})}),"1"===m&&(0,C.jsx)(I,{}),"2"===m&&(0,C.jsx)(Q,{})]}):(0,C.jsx)(C.Fragment,{})}))},88522:function(e,t,n){"use strict";var s=n(92310),i=n.n(s),a=n(89616),r=n(54798),l=n(59301),o=n(53487),c=n(92343),u=n(36355),d=n(57809);const{Option:p}=d.default;function m(e){return e&&e.type&&(e.type.isSelectOption||e.type.isSelectOptGroup)}const h=(e,t)=>{const{prefixCls:n,className:s,popupClassName:o,dropdownClassName:h,children:f,dataSource:v}=e,x=(0,a.Z)(f);let _;1===x.length&&(0,c.l$)(x[0])&&!m(x[0])&&([_]=x);const g=_?()=>_:void 0;let y;y=x.length&&m(x[0])?f:v?v.map((e=>{if((0,c.l$)(e))return e;switch(typeof e){case"string":return l.createElement(p,{key:e,value:e},e);case"object":{const{value:t}=e;return l.createElement(p,{key:t,value:t},e.text)}default:return}})):[];const{getPrefixCls:b}=l.useContext(u.E_),j=b("select",n);return l.createElement(d.default,Object.assign({ref:t,suffixIcon:null},(0,r.Z)(e,["dataSource","dropdownClassName"]),{prefixCls:j,popupClassName:o||h,className:i()(`${j}-auto-complete`,s),mode:d.default.SECRET_COMBOBOX_MODE_DO_NOT_USE},{getInputElement:g}),y)},f=l.forwardRef(h),v=(0,o.Z)(f);f.Option=p,f._InternalPanelDoNotUseOrYouWillBeFired=v,t.Z=f},51581:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}return function(t,n,s){return n&&e(t.prototype,n),s&&e(t,s),t}}(),i=n(59301),a=l(i),r=l(n(12708));function l(e){return e&&e.__esModule?e:{default:e}}var o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.scrollListener=n.scrollListener.bind(n),n.eventListenerOptions=n.eventListenerOptions.bind(n),n.mousewheelListener=n.mousewheelListener.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),s(t,[{key:"componentDidMount",value:function(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function(){if(this.props.isReverse&&this.loadMore){var e=this.getParentElement(this.scrollComponent);e.scrollTop=e.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var e=!1,t={get passive(){e=!0}};try{document.addEventListener("test",null,t),document.removeEventListener("test",null,t)}catch(e){}return e}},{key:"eventListenerOptions",value:function(){var e=this.props.useCapture;return this.isPassiveSupported()&&(e={useCapture:this.props.useCapture,passive:!0}),e}},{key:"setDefaultLoader",value:function(e){this.defaultLoader=e}},{key:"detachMousewheelListener",value:function(){var e=window;!1===this.props.useWindow&&(e=this.scrollComponent.parentNode),e.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var e=window;!1===this.props.useWindow&&(e=this.getParentElement(this.scrollComponent)),e.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),e.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(e){var t=this.props.getScrollParent&&this.props.getScrollParent();return null!=t?t:e&&e.parentNode}},{key:"filterProps",value:function(e){return e}},{key:"attachScrollListener",value:function(){var e=this.getParentElement(this.scrollComponent);if(this.props.hasMore&&e){var t=window;!1===this.props.useWindow&&(t=e),t.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),t.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),t.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}}},{key:"mousewheelListener",value:function(e){1!==e.deltaY||this.isPassiveSupported()||e.preventDefault()}},{key:"scrollListener",value:function(){var e=this.scrollComponent,t=window,n=this.getParentElement(e),s=void 0;if(this.props.useWindow){var i=document.documentElement||document.body.parentNode||document.body,a=void 0!==t.pageYOffset?t.pageYOffset:i.scrollTop;s=this.props.isReverse?a:this.calculateOffset(e,a)}else s=this.props.isReverse?n.scrollTop:e.scrollHeight-n.scrollTop-n.clientHeight;s<Number(this.props.threshold)&&e&&null!==e.offsetParent&&(this.detachScrollListener(),this.beforeScrollHeight=n.scrollHeight,this.beforeScrollTop=n.scrollTop,"function"==typeof this.props.loadMore&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function(e,t){return e?this.calculateTopPosition(e)+(e.offsetHeight-t-window.innerHeight):0}},{key:"calculateTopPosition",value:function(e){return e?e.offsetTop+this.calculateTopPosition(e.offsetParent):0}},{key:"render",value:function(){var e=this,t=this.filterProps(this.props),n=t.children,s=t.element,i=t.hasMore,r=(t.initialLoad,t.isReverse),l=t.loader,o=(t.loadMore,t.pageStart,t.ref),c=(t.threshold,t.useCapture,t.useWindow,t.getScrollParent,function(e,t){var n={};for(var s in e)t.indexOf(s)>=0||Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=e[s]);return n}(t,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]));c.ref=function(t){e.scrollComponent=t,o&&o(t)};var u=[n];return i&&(l?r?u.unshift(l):u.push(l):this.defaultLoader&&(r?u.unshift(this.defaultLoader):u.push(this.defaultLoader))),a.default.createElement(s,c,u)}}]),t}(i.Component);o.propTypes={children:r.default.node.isRequired,element:r.default.node,hasMore:r.default.bool,initialLoad:r.default.bool,isReverse:r.default.bool,loader:r.default.node,loadMore:r.default.func.isRequired,pageStart:r.default.number,ref:r.default.func,getScrollParent:r.default.func,threshold:r.default.number,useCapture:r.default.bool,useWindow:r.default.bool},o.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},t.default=o,e.exports=t.default},26724:function(e,t,n){e.exports=n(51581)}}]); |