|
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[61713],{36614:function(e,t,n){n.r(t),n.d(t,{default:function(){return ee}});var i=n(7557),s=n.n(i),a=n(41498),r=n.n(a),l=n(79800),o=n.n(l),c=n(59301),d=n(49105),u="wrap___dX7Vx",p=n(82242),m=n.n(p),f=n(39647),h=n.n(f),x=n(78241),_=n(8591),v=n(24650),g=n(53326),j=n(95237),y=n(24905),b=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(71681),k=n(21884),Z=n(80608),I=n(2753),N=n(37712),T=["globalSetting","virtualSpaces","dispatch"],C=["key","name"],P=(0,Z.connect)((function(e){return{globalSetting:e.globalSetting,virtualSpaces:e.virtualSpaces}}))((function(e){e.globalSetting;var t,n,i=e.virtualSpaces,a=e.dispatch,l=(h()(e,T),(0,Z.useParams)()),u=i.virtualSpacesDetails,p=i.menus,f=(0,c.useState)(!1),P=o()(f,2),L=P[0],V=P[1],D=(0,c.useState)(!0),E=o()(D,2),z=(E[0],E[1],x.Z.useForm()),F=o()(z,1)[0],A=(0,c.useState)([]),R=o()(A,2),H=R[0],M=R[1],Y=(0,c.useState)([]),O=o()(Y,2),U=O[0],B=O[1],X=(0,c.useState)(!1),q=o()(X,2),W=q[0],G=q[1];(0,c.useEffect)((function(){if(null!=u&&u.id&&null!=p&&p.length){var e,t,n,i;F.setFieldsValue({name:null==u?void 0:u.name,vs_type:null==u?void 0:u.vs_type,identifier:null==u?void 0:u.identifier,settings:p.map((function(e){return m()(m()({},e),{},{checked:!e.hidden})}))});var s=null!=u&&null!==(e=u.cover_url)&&void 0!==e&&e.includes("attachments")?[{response:{id:null==u||null===(t=u.cover_url)||void 0===t?void 0:t.split("/")[3]}}]:[],a=null!=u&&null!==(n=u.backbground_image_url)&&void 0!==n&&n.includes("attachments")?[{response:{id:null==u||null===(i=u.backbground_image_url)||void 0===i?void 0:i.split("/")[3]}}]:[];M(s),B(a)}}),[u,p]);var J=function(){var e=r()(s()().mark((function e(t){var n,i,r,o,c;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return V(!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==H||null===(n=H[0])||void 0===n||null===(n=n.response)||void 0===n?void 0:n.id)||"",backbground_image_id:(null==U||null===(i=U[0])||void 0===i||null===(i=i.response)||void 0===i?void 0:i.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,d.ZP)("/api/virtual_classrooms/".concat(l.virtual_spacesId,".json"),{method:"put",body:o});case 4:-1!==(null==(c=e.sent)?void 0:c.status)&&(_.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)&&F.setFields([{name:"identifier",errors:["该标识已存在,请更换"]}]),V(!1);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),K=function(e,t){["uploading","done","removed"].includes(e.file.status)&&("uploading"===e.file.status&&G(!0),"done"===e.file.status&&G(!1),1===t?M(e.fileList):B(e.fileList))},Q=function(e,t){1===t?M([]):B([])},$=function(e,t){if(!("image/jpeg"===e.type||"image/png"===e.type))return _.ZP.warning("请上传jpg或png的图片!"),!1;var n=e.size/1024>200,i=e.size/1024/1024>1;return n&&1===t?(_.ZP.warning("文件大小必须小于200KB"),!1):i&&2===t?(_.ZP.warning("文件大小必须小于1MB"),!1):(1===t?M([]):B([]),!0)},ee=function(e){var t,n;return(0,N.jsxs)("div",{className:w.img,children:[(0,N.jsx)("img",{src:S.Z.API_SERVER+"/api/attachments/"+(1===e?null==H||null===(t=H[0])||void 0===t||null===(t=t.response)||void 0===t?void 0:t.id:null==U||null===(n=U[0])||void 0===n||null===(n=n.response)||void 0===n?void 0:n.id),alt:"avatar",style:{width:"100%"}}),(0,N.jsx)("div",{children:(0,N.jsx)(k.Z,{onClick:function(){1===e?M([]):B([])},style:{fontSize:"16px",color:"red"}})})]})};return(0,N.jsxs)(x.Z,{form:F,colon:!1,onFinish:J,className:w.form,children:[(0,N.jsx)(x.Z.Item,{label:"社区名称",name:"name",rules:[{required:!0,message:"请输入社区名称"},{whitespace:!0,message:"请输入社区名称"},{max:60,message:"只能输入60个字符"}],children:(0,N.jsx)(v.Z,{style:{width:516},maxLength:60,placeholder:"请输入社区名称"})}),(0,N.jsx)(x.Z.Item,{label:(0,N.jsx)("span",{style:{width:66},children:"标识"}),name:"identifier",rules:[{pattern:/^[a-zA-Z0-9]+$/,message:"仅支持填写英文和数字"}],children:(0,N.jsx)(v.Z,{style:{width:516},maxLength:15})}),(0,N.jsx)(x.Z.Item,{name:"cover_id",label:"封面图",className:"mt30",children:(0,N.jsxs)("div",{className:w.upload,children:[null!=H&&null!==(t=H[0])&&void 0!==t&&null!==(t=t.response)&&void 0!==t&&t.id?ee(1):(0,N.jsx)(g.Z,{fileList:H,action:"".concat(S.Z.API_SERVER,"/api/attachments.json"),onChange:function(e){return K(e,1)},onRemove:function(e){return Q(0,1)},beforeUpload:function(e){return $(e,1)},withCredentials:!0,accept:"image/*",children:(0,N.jsx)(I.op,{className:"radius2",children:"上传图片"})}),(0,N.jsx)("aside",{className:w.text,children:"仅支持上传jpg/png格式文件,文件大小不能超过200KB,建议使用282*228像素;如不上传,默认使用系统图片。"})]})}),(0,N.jsx)(x.Z.Item,{name:"backbground_image_id",label:"详情顶部背景",className:"mt30",children:(0,N.jsxs)("div",{className:w.upload,children:[null!=U&&null!==(n=U[0])&&void 0!==n&&null!==(n=n.response)&&void 0!==n&&n.id?ee(2):(0,N.jsx)(g.Z,{fileList:U,action:"".concat(S.Z.API_SERVER,"/api/attachments.json"),onChange:function(e){return K(e,2)},onRemove:function(e){return Q(0,2)},beforeUpload:function(e){return $(e,2)},withCredentials:!0,accept:"image/*",children:(0,N.jsx)(I.op,{className:"radius2",children:"上传图片"})}),(0,N.jsx)("aside",{className:w.text,children:"仅支持上传jpg/png格式文件,文件大小不能超过1MB,建议使用3840*148像素;如不上传,默认使用系统图片。"})]})}),(0,N.jsxs)("div",{className:w.title,children:[(0,N.jsx)("b",{}),(0,N.jsx)("span",{children:"模块展示控制"})]}),(0,N.jsx)("div",{className:w.list,children:(0,N.jsx)(x.Z.List,{name:"settings",children:function(e,t){t.add,t.remove;var n=t.move;return(0,N.jsx)(N.Fragment,{children:e.map((function(t,i){var s=t.key,a=t.name,r=h()(t,C);return(0,N.jsx)("div",{children:(0,N.jsxs)(j.Z,{align:"top",children:[(0,N.jsx)(x.Z.Item,m()(m()({},r),{},{className:"mr20",valuePropName:"checked",name:[a,"checked"],children:(0,N.jsx)(y.Z,{disabled:p[s].disabled})})),(0,N.jsx)(x.Z.Item,m()(m()({},r),{},{style:{flex:1},name:[a,"name"],children:(0,N.jsx)(v.Z,{})})),(0,N.jsxs)("div",{className:"ml20",style:{width:60,display:"flex",alignItems:"center",justifyContent:"left",paddingTop:6},children:[0!==i&&i<=e.length-2&&(0,N.jsx)("div",{onClick:function(){var t;n(i,i-1);var s=null===(t=F.getFieldValue("settings"))||void 0===t?void 0:t.map((function(t,n){return e.map((function(e,i){n===i&&(t.position=Number(e.name)+1)})),t}));F.setFieldValue("settings",s)},children:(0,N.jsx)("i",{className:"iconfont icon-shangyi3",style:{transform:"translateY(2px)"}})}),i<e.length-2&&(0,N.jsx)("div",{onClick:function(){var t;n(i,i+1);var s=null===(t=F.getFieldValue("settings"))||void 0===t?void 0:t.map((function(t,n){return e.map((function(e,i){n===i&&(t.position=Number(e.name)+1)})),t}));F.setFieldValue("settings",s)},className:0===i?"":"ml10",style:{transform:"rotate(180deg) translateY(1px)"},children:(0,N.jsx)("i",{className:"iconfont icon-shangyi3"})})]})]})},s)}))})}})}),(0,N.jsx)(b.ZP,{disabled:W,loading:L,type:"primary",className:w.btn,onClick:function(){F.submit()},children:"确认修改"})]})})),L=n(43418),V=n(86859),D=n(6638),E={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"},z=n(37205),F=n.n(z),A=n(6848),R=n(88522),H=n(51945),M=n(26724),Y=n.n(M),O=n(61186),U=n.n(O),B=n(27047),X=n(6668),q=n(92396),W=(0,Z.connect)((function(e){return{classroomList:e.classroomList,loading:e.loading}}))((function(e){var t,n,i=e.classroomList,a=(e.loading,e.dispatch),l=(0,Z.useParams)(),d=i.actionTabs,u=(0,c.useState)([]),p=o()(u,2),f=p[0],h=p[1],g=(0,c.useState)(!0),j=o()(g,2),w=j[0],S=j[1],k=(0,c.useState)(!1),I=o()(k,2),T=I[0],C=I[1],P=x.Z.useForm(),V=o()(P,1)[0],D=(0,c.useState)([]),E=o()(D,2),z=E[0],M=E[1],O=(0,c.useState)(0),W=o()(O,2),G=W[0],J=W[1],K=(0,c.useState)([]),Q=o()(K,2),$=Q[0],ee=Q[1],te=(0,c.useState)(!0),ne=o()(te,2),ie=ne[0],se=ne[1],ae=(0,c.useRef)();(0,c.useEffect)((function(){"添加老师"===i.actionTabs.key&&(se(!0),re())}),[i.actionTabs.key]);var re=function(){var e=r()(s()().mark((function e(){var t;return s()().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,h(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()(s()().mark((function e(){var t,n,i,a,r=arguments;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=r.length>0&&void 0!==r[0]&&r[0])&&!w||T){e.next=11;break}return i=V.getFieldValue(),C(!0),J(t?1:G+1),e.next=7,(0,X.nQ)({page:t?1:G+1,container_id:l.virtual_spacesId,container_type:5,school_name:null==i?void 0:i.school_name,keyword:null==i?void 0:i.keyword});case 7:a=e.sent,M(t?F()(a.users):[].concat(F()(z),F()(a.users))),C(!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()(s()().mark((function e(){return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(""!=$){e.next=4;break}_.ZP.error("请选择人数"),e.next=8;break;case 4:return e.next=6,(0,B.MM)(m()(m()({},l),{},{user_ids:$}));case 6:0===e.sent.status&&(_.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,N.jsx)(y.Z,{value:t.numid,checked:$.includes(String(t.numid)),disabled:!!e})}},{title:"姓名",width:100,ellipsis:!0,dataIndex:"username",render:function(e,t){return(0,N.jsx)(A.Z,{placement:"bottom",title:e,children:(0,N.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,N.jsx)(A.Z,{placement:"bottom",title:e,children:(0,N.jsx)("span",{children:e||"--"})})}},{title:"邮箱",dataIndex:"email",width:100,ellipsis:!0,render:function(e){return(0,N.jsx)(A.Z,{placement:"bottom",title:e,children:(0,N.jsx)("span",{children:e||"--"})})}},{title:"学号/工号",width:100,dataIndex:"student_number",ellipsis:!0,render:function(e){return(0,N.jsx)(A.Z,{placement:"bottom",title:e,children:(0,N.jsx)("span",{children:e||"--"})})}},{title:"学校/单位",width:150,dataIndex:"school_name",ellipsis:!0,render:function(e){return(0,N.jsx)(A.Z,{placement:"bottom",title:e,children:(0,N.jsx)("span",{children:e||"--"})})}},{title:"院系/部门",dataIndex:"depart_name",width:130,ellipsis:!0,render:function(e){return(0,N.jsx)(A.Z,{placement:"bottom",title:e,children:(0,N.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,N.jsx)(A.Z,{placement:"bottom",title:e,children:(0,N.jsx)("span",{children:U()(e).format("YYYY-MM-DD HH:mm")})})}},{title:"状态",dataIndex:"added",width:80,render:function(e){return 1===e?(0,N.jsx)("span",{className:"c-green",children:"已添加"}):(0,N.jsx)("span",{children:"未添加"})}}];return(0,N.jsxs)(L.Z,{centered:!0,title:"添加成员",open:"添加成员"===i.actionTabs.key,okText:"确定",cancelText:"取消",width:1100,zIndex:9999,bodyStyle:{minHeight:200},onOk:r()(s()().mark((function e(){return s()().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,N.jsxs)(x.Z,{layout:"inline",form:V,initialValues:{school_name:"",keyword:""},className:"mt10",children:[(0,N.jsx)(x.Z.Item,{name:"keyword",label:"姓名:",children:(0,N.jsx)(v.Z,{allowClear:!0,style:{width:370},size:"middle",defaultValue:(null===(t=d.selectArrs)||void 0===t?void 0:t.category_name)||(null===(n=d.selectArrs)||void 0===n?void 0:n.name)})}),(0,N.jsx)(x.Z.Item,{name:"school_name",label:"单位:",children:(0,N.jsx)("div",{ref:ae,children:(0,N.jsx)(R.Z,{options:f,style:{width:400},size:"middle",placeholder:"请输入单位名称",filterOption:function(e,t){return-1!==t.value.toUpperCase().indexOf(e.toUpperCase())}})})}),(0,N.jsx)(x.Z.Item,{children:(0,N.jsx)(b.ZP,{htmlType:"submit",type:"primary",size:"middle",onClick:function(){return function(){var e;if(""===(null===(e=V.getFieldValue())||void 0===e?void 0:e.keyword))return M([]),void _.ZP.error("请输入姓名");se(!1),S(!0),C(!1),ee([]),setTimeout((function(){le(!0)}),200)}()},children:"搜索"})})]}),ie&&(0,N.jsxs)("div",{className:"tc font16 c-light-black mt40 pb30",children:[(0,N.jsx)("img",{src:q.RL,width:"100",alt:""}),(0,N.jsx)("br",{}),(0,N.jsx)("p",{className:"mt20",children:"请搜索要添加的人员"})]}),!ie&&""==z&&!T&&(0,N.jsxs)("div",{className:"tc font16 c-light-black mt40 pb30",children:[(0,N.jsx)("img",{src:q.z3,width:"100",alt:""}),(0,N.jsx)("br",{}),(0,N.jsx)("p",{className:"mt20",children:"暂时还没有相关数据哦!"})]}),(!ie&&""!=z||T)&&(0,N.jsxs)("section",{children:[(0,N.jsx)("div",{className:"flexd-table-header mt20",children:(0,N.jsx)(H.Z,{pagination:!1,dataSource:[],columns:ce})}),(0,N.jsx)("div",{style:{maxHeight:260,overflow:"auto"},children:(0,N.jsx)(Y(),{initialLoad:!1,pageStart:1,threshold:20,loadMore:function(e){le()},hasMore:w,useWindow:!1,children:(0,N.jsx)(H.Z,{loading:T,showHeader:!1,pagination:!1,dataSource:z,columns:ce,onRow:function(e){return{onClick:function(e){e.currentTarget.querySelector("input").disabled||function(e){e=String(e);var t=$.indexOf(e);t<0?$.push(e):$.splice(t,1),ee(F()($))}(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,i=e.classroomList,a=(e.loading,e.dispatch),l=(0,Z.useParams)(),d=i.actionTabs,u=(0,c.useState)([]),p=o()(u,2),f=p[0],h=p[1],g=(0,c.useState)(!0),j=o()(g,2),y=j[0],w=j[1],S=(0,c.useState)(!1),k=o()(S,2),I=k[0],T=k[1],C=x.Z.useForm(),P=o()(C,1)[0],V=(0,c.useState)([]),D=o()(V,2),E=D[0],z=D[1],M=(0,c.useState)(0),O=o()(M,2),W=O[0],J=O[1],K=(0,c.useState)(),Q=o()(K,2),$=Q[0],ee=Q[1],te=(0,c.useState)(!0),ne=o()(te,2),ie=ne[0],se=ne[1],ae=(0,c.useRef)();(0,c.useEffect)((function(){"更换管理员"===i.actionTabs.key&&(se(!0),re())}),[i.actionTabs.key]);var re=function(){var e=r()(s()().mark((function e(){var t;return s()().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,h(t.map((function(e){return{value:e}}))),se(!1),w(!0),T(!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()(s()().mark((function e(){var t,n,i,a,r=arguments;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=r.length>0&&void 0!==r[0]&&r[0])&&!y||I){e.next=11;break}return i=P.getFieldValue(),T(!0),J(t?1:W+1),e.next=7,(0,X.nQ)({page:t?1:W+1,container_id:l.virtual_spacesId,container_type:5,source:"virtual_classroom",school_name:null==i?void 0:i.school_name,keyword:null==i?void 0:i.keyword});case 7:a=e.sent,z(t?F()(a.users):[].concat(F()(E),F()(a.users))),T(!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()(s()().mark((function e(){return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(""!=$){e.next=4;break}_.ZP.error("请选择成员"),e.next=8;break;case 4:return e.next=6,(0,B.xt)(m()(m()({},l),{},{id:$,virtual_classroom_id:l.virtual_spacesId}));case 6:0===e.sent.status&&(_.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,N.jsx)(G.ZP,{value:t.numid,checked:$===String(t.numid)})}},{title:"姓名",width:100,ellipsis:!0,dataIndex:"username",render:function(e,t){return(0,N.jsx)(A.Z,{placement:"bottom",title:e,children:(0,N.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,N.jsx)(A.Z,{placement:"bottom",title:e,children:(0,N.jsx)("span",{children:e||"--"})})}},{title:"邮箱",dataIndex:"email",width:100,ellipsis:!0,render:function(e){return(0,N.jsx)(A.Z,{placement:"bottom",title:e,children:(0,N.jsx)("span",{children:e||"--"})})}},{title:"学号/工号",width:100,dataIndex:"student_number",ellipsis:!0,render:function(e){return(0,N.jsx)(A.Z,{placement:"bottom",title:e,children:(0,N.jsx)("span",{children:e||"--"})})}},{title:"学校/单位",width:150,dataIndex:"school_name",ellipsis:!0,render:function(e){return(0,N.jsx)(A.Z,{placement:"bottom",title:e,children:(0,N.jsx)("span",{children:e||"--"})})}},{title:"院系/部门",dataIndex:"depart_name",width:130,ellipsis:!0,render:function(e){return(0,N.jsx)(A.Z,{placement:"bottom",title:e,children:(0,N.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,N.jsx)(A.Z,{placement:"bottom",title:e,children:(0,N.jsx)("span",{children:U()(e).format("YYYY-MM-DD HH:mm")})})}}];return(0,N.jsxs)(L.Z,{centered:!0,title:"更换管理员",open:"更换管理员"===i.actionTabs.key,okText:"确定",cancelText:"取消",width:1100,zIndex:9999,bodyStyle:{minHeight:200},onOk:r()(s()().mark((function e(){return s()().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,N.jsxs)(x.Z,{layout:"inline",form:P,initialValues:{school_name:"",keyword:""},className:"mt10",children:[(0,N.jsx)(x.Z.Item,{name:"keyword",label:"姓名:",children:(0,N.jsx)(v.Z,{allowClear:!0,style:{width:370},size:"middle",defaultValue:(null===(t=d.selectArrs)||void 0===t?void 0:t.category_name)||(null===(n=d.selectArrs)||void 0===n?void 0:n.name)})}),(0,N.jsx)(x.Z.Item,{name:"school_name",label:"单位:",children:(0,N.jsx)("div",{ref:ae,children:(0,N.jsx)(R.Z,{options:f,style:{width:400},size:"middle",placeholder:"请输入单位名称",filterOption:function(e,t){return-1!==t.value.toUpperCase().indexOf(e.toUpperCase())}})})}),(0,N.jsx)(x.Z.Item,{children:(0,N.jsx)(b.ZP,{htmlType:"submit",type:"primary",size:"middle",onClick:function(){return function(){var e;if(""===(null===(e=P.getFieldValue())||void 0===e?void 0:e.keyword))return z([]),void _.ZP.error("请输入姓名");se(!1),w(!0),T(!1),ee(""),setTimeout((function(){le(!0)}),200)}()},children:"搜索"})})]}),ie&&(0,N.jsxs)("div",{className:"tc font16 c-light-black mt40 pb30",children:[(0,N.jsx)("img",{src:q.RL,width:"100",alt:""}),(0,N.jsx)("br",{}),(0,N.jsx)("p",{className:"mt20",children:"请搜索要添加的人员"})]}),!ie&&""==E&&!I&&(0,N.jsxs)("div",{className:"tc font16 c-light-black mt40 pb30",children:[(0,N.jsx)("img",{src:q.z3,width:"100",alt:""}),(0,N.jsx)("br",{}),(0,N.jsx)("p",{className:"mt20",children:"暂时还没有相关数据哦!"})]}),(!ie&&""!=E||I)&&(0,N.jsxs)("section",{children:[(0,N.jsx)("div",{className:"flexd-table-header mt20",children:(0,N.jsx)(H.Z,{pagination:!1,dataSource:[],columns:ce})}),(0,N.jsx)("div",{style:{maxHeight:260,overflow:"auto"},children:(0,N.jsx)(Y(),{initialLoad:!1,pageStart:1,threshold:20,loadMore:function(e){le()},hasMore:y,useWindow:!1,children:(0,N.jsx)(H.Z,{loading:I,showHeader:!1,pagination:!1,dataSource:E,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))}}}})})})]})]})})),K=n(75916),Q=["classroomList","globalSetting","virtualSpaces","user","loading","dispatch"],$=(0,Z.connect)((function(e){var t=e.classroomList,n=e.loading,i=e.globalSetting,s=e.virtualSpaces,a=e.user;return{classroomList:t,globalSetting:i,loading:n.effects,virtualSpaces:s,user:a}}))((function(e){var t,n=e.classroomList,i=(e.globalSetting,e.virtualSpaces),a=e.user,l=(e.loading,e.dispatch),u=(h()(e,Q),(0,c.useState)([])),p=o()(u,2),f=p[0],x=p[1],_=(0,c.useState)(!1),v=o()(_,2),g=(v[0],v[1],i.virtualSpacesDetails,(0,c.useState)("1")),j=o()(g,2),y=(j[0],j[1],(0,Z.useParams)()),b=(0,c.useState)({page:1,limit:16,search:"",virtual_classroom_id:y.virtual_spacesId,module_id:i.actionTabs.module_id}),w=o()(b,2),k=w[0],I=(w[1],(0,c.useState)([{name:"已审核",type:"agreed"},{name:"待审核",type:"pending"}])),T=o()(I,2),C=T[0],P=(T[1],(0,c.useState)("agreed")),z=o()(P,2),F=z[0],A=z[1];function R(){return H.apply(this,arguments)}function H(){return(H=r()(s()().mark((function e(){var t;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,d.ZP)("/api/virtual_classrooms/".concat(y.virtual_spacesId,"/members.json"),{method:"get",params:m()(m()({},k),{},{status:F})});case 2:t=e.sent,x(t);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return(0,c.useEffect)((function(){R()}),[F]),(0,c.useEffect)((function(){"刷新数据"===n.actionTabs.key&&(R(),l({type:"virtualSpaces/getVirtualSpacesDetails",payload:{id:y.virtual_spacesId}}))}),[n.actionTabs.key]),(0,N.jsxs)("div",{className:E.warp,children:[(0,N.jsx)("div",{className:E.tabs,children:C.map((function(e,t){return(0,N.jsx)("div",{className:"".concat(F==e.type?E.active_tab:E.item_tab),onClick:function(){A(e.type)},children:(0,N.jsxs)("div",{style:{position:"relative"},children:[e.name,"(","已审核"==e.name?null==f?void 0:f.member_count:null==f?void 0:f.apply_total_count,")",(0,N.jsx)("div",{className:"".concat(F==e.type?E.active_line:"")})]})},t)}))}),(0,N.jsxs)("div",{className:E.Content,children:[(null==f?void 0:f.total_count)<=0&&(0,N.jsx)(D.Z,{Buttonclass:E.buttonstyle,customText:"此项目还没有成员,立即添加它们吧~"}),null==f||null===(t=f.members)||void 0===t?void 0:t.map((function(e,t){return(0,N.jsxs)("div",{className:E.items,onClick:function(){window.open("/users/".concat(e.login))},children:[(0,N.jsxs)("div",{style:{display:"flex"},children:[(0,N.jsx)("img",{src:S.Z.IMG_SERVER+"/images/"+(null==e?void 0:e.image_url)}),(0,N.jsxs)("div",{children:[(0,N.jsxs)("div",{style:{fontSize:"16px",display:"flex",fontWeight:600},children:[null==e?void 0:e.name,(null==e?void 0:e.is_creator)&&(0,N.jsx)("div",{className:E.adminsstyle,children:"管理员"})]}),(0,N.jsxs)("div",{style:{fontSize:"14px",color:"#7D8592",marginTop:"7px"},children:[e.school,e.school&&e.department_name&&"-",e.department_name]})]})]}),(0,N.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,K.Ny)())&&0===t&&"agreed"===F&&(null==e?void 0:e.is_creator)&&(0,N.jsxs)("span",{onClick:function(e){e.stopPropagation(),e.preventDefault(),l({type:"classroomList/setActionTabs",payload:{key:"更换管理员",params:k}})},className:E.upadmin,children:[(0,N.jsx)("i",{className:"iconfont icon-genghuanguanliyuan mr5 font14"}),"更换管理员"]}),(null==e?void 0:e.can_remove)&&"agreed"===F&&(0,N.jsxs)("span",{className:"font14",onClick:function(t){var n;t.stopPropagation(),t.preventDefault(),L.Z.confirm({title:"移除成员",content:"确认将成员《".concat(e.name,"》移出虚拟社区吗?"),okText:"确认",cancelText:"取消",onOk:(n=r()(s()().mark((function t(){return s()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,d.ZP)("/api/virtual_classrooms/".concat(y.virtual_spacesId,"/members/").concat(e.user_id,".json"),{method:"Delete"});case 2:0===t.sent.status&&(R(),l({type:"virtualSpaces/getVirtualSpacesDetails",payload:{id:y.virtual_spacesId}}));case 4:case"end":return t.stop()}}),t)}))),function(){return n.apply(this,arguments)})})},style:{color:"#3061D0",cursor:"pointer"},children:[(0,N.jsx)("i",{className:"iconfont icon-piliangshanchubeifen mr5 font14"}),"删除成员"]}),!(null!=e&&e.is_creator)&&"pending"===F&&(0,N.jsxs)("div",{style:{cursor:"pointer"},children:[(0,N.jsx)("span",{onClick:function(){var t=r()(s()().mark((function t(n){return s()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n.stopPropagation(),n.preventDefault(),t.next=4,(0,d.ZP)("/api/virtual_classrooms/".concat(y.virtual_spacesId,"/agree.json"),{method:"post",body:{apply_id:e.source_id}});case 4:0===t.sent.status&&(R(),l({type:"virtualSpaces/getVirtualSpacesDetails",payload:{id:y.virtual_spacesId}}));case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),className:E.yes,children:"同意"}),(0,N.jsx)("span",{onClick:function(){var t=r()(s()().mark((function t(n){return s()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n.stopPropagation(),n.preventDefault(),t.next=4,(0,d.ZP)("/api/virtual_classrooms/".concat(y.virtual_spacesId,"/refuse.json"),{method:"post",body:{apply_id:e.source_id}});case 4:0===t.sent.status&&(R(),l({type:"virtualSpaces/getVirtualSpacesDetails",payload:{id:y.virtual_spacesId}}));case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),className:E.no,children:"拒绝"})]})]})]})}))]}),(0,N.jsx)(W,{}),(0,N.jsx)(J,{}),(0,N.jsx)(V.Z,{current:k.page,total:null==f?void 0:f.total_count,style:{textAlign:"end",marginBottom:"20px"},pageSize:k.limit,hideOnSinglePage:!0,onChange:function(e){k.page=e,R()}})]})})),ee=(0,Z.connect)((function(e){return{globalSetting:e.globalSetting,virtualSpaces:e.virtualSpaces}}))((function(e){var t,n=e.dispatch,i=e.virtualSpaces,a=(0,Z.useParams)().virtual_spacesId,l=(0,c.useState)("1"),p=o()(l,2),m=p[0],f=p[1],h=(0,c.useState)(!1),x=o()(h,2),_=x[0],v=x[1];(0,c.useEffect)((function(){g()}),[]);var g=function(){var e=r()(s()().mark((function e(){return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,d.ZP)("/api/virtual_classrooms/".concat(a,"/settings_auth.json"),{method:"get"});case 2:0===e.sent.status&&v(!0);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),j=[{id:"1",name:"模块设置"},{id:"2",name:"成员设置",total:null==i||null===(t=i.virtualSpacesDetails)||void 0===t?void 0:t.members_count}];return _?(0,N.jsxs)("div",{className:u,children:[(0,N.jsx)(I.YG,{value:m,onChange:function(e){f(e)},dataSource:j,tabBarExtraContent:"2"===m&&(0,N.jsx)(I.op,{onClick:function(){n({type:"classroomList/setActionTabs",payload:{key:"添加成员",params:{}}})},children:"添加成员"})}),"1"===m&&(0,N.jsx)(P,{}),"2"===m&&(0,N.jsx)($,{})]}):(0,N.jsx)(N.Fragment,{})}))}}]); |