vdi/web-fe/serve/dist/p__terminal__index.async.js

4 lines
48 KiB
JavaScript

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[782],{78134:function(mn,Ke,n){n.d(Ke,{AA:function(){return D},Bq:function(){return O},DE:function(){return W},Dx:function(){return we},Jk:function(){return k},OQ:function(){return l},UO:function(){return Ge},Wf:function(){return r},iI:function(){return Oe},uz:function(){return ke}});var O="200",r={1:"VDI",3:"VOI"},Xe={1:"\u5168\u76D8\u8FD8\u539F",2:"\u6570\u636E\u76D8\u8FD8\u539F",3:"\u5B9A\u65F6\u8FD8\u539F",0:"\u4E0D\u8FD8\u539F"},D={1:"\u57DF\u7528\u6237",0:"\u672C\u5730\u7528\u6237"},Oe={1:"\u5973",2:"\u7537"},W={1:"\u4E00\u7EA7",2:"\u4E8C\u7EA7",3:"\u4E09\u7EA7"},Ge={1:"\u542F\u7528",2:"\u7981\u7528"},l=[{value:1,label:"\u57DF\u7528\u6237"},{value:0,label:"\u672C\u5730\u7528\u6237"}],k=[{value:1,label:"VDI"},{value:3,label:"VOI"}],ke=[{value:1,label:"\u5973"},{value:2,label:"\u7537"}],we=[{value:1,label:"\u4E00\u7EA7"},{value:2,label:"\u4E8C\u7EA7"},{value:3,label:"\u4E09\u7EA7"}]},12985:function(mn,Ke,n){var O=n(26068),r=n.n(O),Xe=n(67825),D=n.n(Xe),Oe=n(75271),W=n(26926),Ge=n(52676),l=["treeData","titleField","keyField","childrenField","onCheck"],k=function(we){var De=we.treeData,Ie=we.titleField,Ae=we.keyField,Ue=we.childrenField,ve=Ue===void 0?"children":Ue,Be=we.onCheck,qe=D()(we,l),Ze=function ze(h){return h.map(function(F){var me=r()({title:F[Ie],key:F[Ae]},F);return F[ve]&&Array.isArray(F[ve])&&(me.children=ze(F[ve])),me})},Ne=Ze(De),He=function(h,F){var me=[];Array.isArray(h)?me=h:me=h.checked,Be==null||Be(me,F.checkedNodes,F)};return(0,Ge.jsx)(W.Z,r()({treeData:Ne,onCheck:He},qe))};Ke.Z=k},75361:function(mn,Ke,n){n.r(Ke),n.d(Ke,{default:function(){return nr}});var O=n(90228),r=n.n(O),Xe=n(87999),D=n.n(Xe),Oe=n(26068),W=n.n(Oe),Ge=n(48305),l=n.n(Ge),k=n(78134),ke=n(12985),we=n(2112),De=n(35103),Ie="/api/nex/v1";function Ae(x){return Ue.apply(this,arguments)}function Ue(){return Ue=D()(r()().mark(function x(i){return r()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,De.request)("".concat(Ie,"/device/select/page"),{method:"POST",data:i}));case 1:case"end":return t.stop()}},x)})),Ue.apply(this,arguments)}function ve(x){return Be.apply(this,arguments)}function Be(){return Be=D()(r()().mark(function x(i){return r()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,De.request)("".concat(Ie,"/device/query"),{method:"POST",data:i}));case 1:case"end":return t.stop()}},x)})),Be.apply(this,arguments)}function qe(x){return Ze.apply(this,arguments)}function Ze(){return Ze=D()(r()().mark(function x(i){return r()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,De.request)("".concat(Ie,"/device/delete"),{method:"POST",data:i}));case 1:case"end":return t.stop()}},x)})),Ze.apply(this,arguments)}function Ne(x){return He.apply(this,arguments)}function He(){return He=D()(r()().mark(function x(i){return r()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,De.request)("".concat(Ie,"/device/update"),{method:"POST",data:i}));case 1:case"end":return t.stop()}},x)})),He.apply(this,arguments)}function ze(x){return h.apply(this,arguments)}function h(){return h=D()(r()().mark(function x(i){return r()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,De.request)("".concat(Ie,"/device/user/mapping/add"),{method:"POST",data:i}));case 1:case"end":return t.stop()}},x)})),h.apply(this,arguments)}function F(x){return me.apply(this,arguments)}function me(){return me=D()(r()().mark(function x(i){return r()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,De.request)("".concat(Ie,"/device/user/mapping/select"),{method:"POST",data:i}));case 1:case"end":return t.stop()}},x)})),me.apply(this,arguments)}function c(x){return dn.apply(this,arguments)}function dn(){return dn=D()(r()().mark(function x(i){return r()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,De.request)("".concat(Ie,"/image/select/page"),{method:"POST",data:i}));case 1:case"end":return t.stop()}},x)})),dn.apply(this,arguments)}function fn(x){return on.apply(this,arguments)}function on(){return on=D()(r()().mark(function x(i){return r()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,De.request)("".concat(Ie,"/device/image/mapping/select"),{method:"POST",data:i}));case 1:case"end":return t.stop()}},x)})),on.apply(this,arguments)}function hn(x){return en.apply(this,arguments)}function en(){return en=D()(r()().mark(function x(i){return r()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,De.request)("".concat(Ie,"/device/image/mapping/add"),{method:"POST",data:i}));case 1:case"end":return t.stop()}},x)})),en.apply(this,arguments)}var un=n(17981),gn=n(99098),We=n(97365),_n=n(37322),En=n(10770),Sn=n(66283),a=n(75271),pn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M342 472h342c.4 0 .9 0 1.3-.1 4.4-.7 7.3-4.8 6.6-9.2l-40.2-248c-.6-3.9-4-6.7-7.9-6.7H382.2c-3.9 0-7.3 2.8-7.9 6.7l-40.2 248c-.1.4-.1.9-.1 1.3 0 4.4 3.6 8 8 8zm91.2-196h159.5l20.7 128h-201l20.8-128zm2.5 282.7c-.6-3.9-4-6.7-7.9-6.7H166.2c-3.9 0-7.3 2.8-7.9 6.7l-40.2 248c-.1.4-.1.9-.1 1.3 0 4.4 3.6 8 8 8h342c.4 0 .9 0 1.3-.1 4.4-.7 7.3-4.8 6.6-9.2l-40.2-248zM196.5 748l20.7-128h159.5l20.7 128H196.5zm709.4 58.7l-40.2-248c-.6-3.9-4-6.7-7.9-6.7H596.2c-3.9 0-7.3 2.8-7.9 6.7l-40.2 248c-.1.4-.1.9-.1 1.3 0 4.4 3.6 8 8 8h342c.4 0 .9 0 1.3-.1 4.3-.7 7.3-4.8 6.6-9.2zM626.5 748l20.7-128h159.5l20.7 128H626.5z"}}]},name:"gold",theme:"outlined"},o=pn,u=n(60101),g=function(i,I){return a.createElement(u.Z,(0,Sn.Z)({},i,{ref:I,icon:o}))},y=a.forwardRef(g),w=y,v=n(39032),G=n(24655),C=n(74970),Re=n(58135),$=n(50),je=n(66767),rn=n(16583),Ve=n(5293),Me={user_content:"user_content___NVrSf",left_content:"left_content___k_v4w",search:"search___mN53j",tree_box:"tree_box___HLlDc",right_content:"right_content___NTJte",teble_content:"teble_content___yJ7lW",teble_box:"teble_box___YE1no"},j=n(50850),tn=n(31106),nn=n(44126),xn=n(67825),Bn=n.n(xn),e=n(52676),jn=["dataSource","onDelete","isSerial","isAction","scrollY"],Fn=function(i){var I=i.dataSource,t=i.onDelete,q=i.isSerial,se=q===void 0?!0:q,te=i.isAction,P=te===void 0?!0:te,oe=i.scrollY,ue=oe===void 0?400:oe,he=Bn()(i,jn);return(0,e.jsx)("div",{children:(0,e.jsx)(Ve.Z,W()({dataSource:I,scroll:{y:ue}},he))})},yn=Fn,Pn={content_wrap:"content_wrap___IzyVq",search_wrap:"search_wrap___vyvi6"},$n=function(i){var I=i.onUserTableSelect,t=i.selectedRowKeys,q=(0,a.useState)(!1),se=l()(q,2),te=se[0],P=se[1],oe=(0,a.useState)([]),ue=l()(oe,2),he=ue[0],ge=ue[1],_e=(0,a.useState)(),ce=l()(_e,2),ee=ce[0],Ee=ce[1],Ce=(0,a.useState)(1),de=l()(Ce,2),fe=de[0],le=de[1],xe=(0,a.useState)(20),Q=l()(xe,2),A=Q[0],R=Q[1],M=(0,a.useState)(0),H=l()(M,2),z=H[0],ae=H[1];(0,a.useEffect)(function(){_()},[ee,fe,A]);var _=function(){var m=D()(r()().mark(function d(){var E,p,V,Se,S,B,L,be,pe,U;return r()().wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return E={page_size:A,page_num:fe},ee&&(E.keywords=ee),P(!0),Y.prev=3,Y.next=6,c(E);case 6:p=Y.sent,console.log("imagesRes=========",p),V=p||{},Se=V.code,S=V.data,B=S||{},L=B.data,be=L===void 0?[]:L,pe=B.total,U=pe===void 0?0:pe,Se===k.Bq?(ge(be),ae(U),P(!1)):(v.ZP.error(p.message||"\u83B7\u53D6\u955C\u50CF\u5217\u8868\u5931\u8D25"),P(!1)),Y.next=17;break;case 13:Y.prev=13,Y.t0=Y.catch(3),v.ZP.error("\u83B7\u53D6\u955C\u50CF\u5217\u8868\u5931\u8D25"),P(!1);case 17:case"end":return Y.stop()}},d,null,[[3,13]])}));return function(){return m.apply(this,arguments)}}(),ie=[{title:"\u5E8F\u53F7",dataIndex:"order",key:"order",width:80,render:function(d,E,p){return(0,e.jsx)("span",{children:p+1})}},{title:"\u955C\u50CF\u540D\u79F0",dataIndex:"image_name",render:function(d){return(0,e.jsx)(G.Z,{children:d||"--"})}}],b=function(d){Ee(d),le(1)},ne=function(d,E){le(d),R(E)},X=function(d,E){le(1),R(E)};return(0,e.jsxs)("div",{className:Pn.content_wrap,children:[(0,e.jsx)("div",{className:Pn.search_wrap,children:(0,e.jsx)(je.Z.Search,{placeholder:"\u955C\u50CF\u540D\u79F0...",onSearch:b,enterButton:!0,allowClear:!0,style:{width:"300px",marginLeft:"10px"}})}),(0,e.jsx)(Ve.Z,{columns:ie,dataSource:he,rowKey:"id",loading:te,rowSelection:{selectedRowKeys:t,preserveSelectedRowKeys:!0,onChange:I},pagination:{current:fe,pageSize:A,total:z,simple:!0,onChange:ne,onShowSizeChange:X,showSizeChanger:!1,showQuickJumper:!1,pageSizeOptions:["10","20","50","100"]},scroll:{x:"max-content",y:300}})]})},an=$n,Tn=function(i){var I=i.placement,t=I===void 0?"bottomLeft":I,q=i.value,se=i.onChange,te=(0,a.useState)(!1),P=l()(te,2),oe=P[0],ue=P[1],he=(0,a.useState)([]),ge=l()(he,2),_e=ge[0],ce=ge[1],ee=(0,a.useState)([]),Ee=l()(ee,2),Ce=Ee[0],de=Ee[1],fe=(0,a.useState)([]),le=l()(fe,2),xe=le[0],Q=le[1],A=(0,a.useState)([]),R=l()(A,2),M=R[0],H=R[1];(0,a.useEffect)(function(){var m=[],d=[];q&&q.length>0&&(q.forEach(function(E){m.push(E),d.push(E.id)}),ce(q),de(d),Q(m))},[q]);var z=function(){ue(!1),de([]),Q([])},ae=function(){var d=[];(xe||[]).forEach(function(E){d.push({id:E.id,image_name:E.image_name})}),ce(d),se(d),z()},_=function(d,E){de(d),Q(E)},ie=function(d){H(d)},b=function(d){if(d){var E=d||{},p=E.id,V=_e.filter(function(L){return L.id!==p}),Se=[];V.map(function(L){return Se.push(L.id)}),ce(V),de(Se),Q(V),se(V),H([])}else{var S=_e.filter(function(L){return!M.includes(L.id)}),B=[];S.map(function(L){return B.push(L.id)}),ce(S),H([]),de(B),Q(S),se(S)}},ne=(0,e.jsxs)("div",{style:{width:"600px"},children:[(0,e.jsx)(an,{onUserTableSelect:_,selectedRowKeys:Ce}),(0,e.jsxs)("div",{style:{borderTop:"1px solid #e8e8e8",marginTop:"10px",paddingTop:"10px",display:"flex",justifyContent:"center"},children:[(0,e.jsx)(C.ZP,{onClick:ae,style:{marginRight:"30px"},type:"primary",children:"\u786E\u5B9A"}),(0,e.jsx)(C.ZP,{onClick:z,children:"\u53D6\u6D88"})]})]}),X=function(){var d=[{title:"\u5E8F\u53F7",dataIndex:"order",key:"order",width:80,render:function(p,V,Se){return(0,e.jsx)("span",{children:Se+1})}},{title:"\u955C\u50CF\u540D\u79F0",dataIndex:"image_name",key:"image_name",render:function(p){return(0,e.jsx)(G.Z,{children:p||"--"})}},{title:"\u64CD\u4F5C",key:"action",width:150,align:"center",render:function(p,V){return(0,e.jsx)($.Z,{title:"",placement:"bottom",description:"\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664?",onConfirm:function(){return b(V)},okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",children:(0,e.jsx)(C.ZP,{type:"link",children:"\u5220\u9664"})})}}];return d};return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(nn.Z,{style:{marginBottom:"10px"},children:[(0,e.jsx)(Re.Z,{content:ne,title:"",trigger:"click",open:oe,onOpenChange:ue,placement:t,children:(0,e.jsx)(C.ZP,{children:"\u6DFB\u52A0"})}),(0,e.jsx)($.Z,{title:"",placement:"bottomRight",description:"\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664?",onConfirm:function(){return b()},disabled:M.length===0,okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",children:(0,e.jsx)(C.ZP,{disabled:M.length===0,children:"\u5220\u9664"})})]}),(0,e.jsx)(yn,{dataSource:_e,onDelete:b,columns:X(),scrollY:400,rowKey:"id",pagination:!1,rowSelection:{bindTableKeys:M,onChange:ie}})]})},kn=Tn,An={model_content:"model_content___MsF87"},Fe=function(i){var I=i.onCancel,t=i.onOk,q=i.confirmLoading,se=q===void 0?!1:q,te=i.dataDetial,P=te||{},oe=P.recordData,ue=P.visible,he=oe||{},ge=he.device_id,_e=j.Z.useForm(),ce=l()(_e,1),ee=ce[0],Ee=(0,a.useState)([]),Ce=l()(Ee,2),de=Ce[0],fe=Ce[1];(0,a.useEffect)(function(){var Q={device_id:ge};fn(Q).then(function(A){var R=A||{},M=R.code,H=R.data,z=H===void 0?[]:H;if(M===k.Bq&&z&&z.length){var ae=[];z.forEach(function(ie){ae.push({id:ie.image_id,image_name:ie.image_name})}),fe(z);var _={image_list:ae};ee.setFieldsValue(_)}})},[ue,ee,oe]);var le=function(A){hn(A).then(function(R){var M=R||{},H=M.code;H===k.Bq?(v.ZP.success("\u7ED1\u5B9A\u6210\u529F"),t&&t()):v.ZP.error("\u7ED1\u5B9A\u5931\u8D25")})},xe=function(){var Q=D()(r()().mark(function A(){var R,M,H,z,ae,_;return r()().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return b.prev=0,b.next=3,ee.validateFields();case 3:R=b.sent,M=R||{},H=M.image_list,z=H===void 0?[]:H,console.log("image_list=====",z),ae=[],z.forEach(function(ne){var X={device_id:ge,image_id:ne.id},m=de.filter(function(d){return d.image_id===ne.id});m&&m.length===1&&(X.id=m[0].id),ae.push(W()({},X))}),_={data:ae,device_id:ge},le(_),b.next=15;break;case 12:b.prev=12,b.t0=b.catch(0),v.ZP.error("\u8BF7\u68C0\u67E5\u8868\u5355\u5B57\u6BB5");case 15:case"end":return b.stop()}},A,null,[[0,12]])}));return function(){return Q.apply(this,arguments)}}();return(0,e.jsx)(tn.Z,{title:"\u7ED1\u5B9A\u955C\u50CF",open:ue,onCancel:I,onOk:xe,confirmLoading:se,width:1200,maskClosable:!1,centered:!0,destroyOnHidden:!0,cancelText:"\u53D6\u6D88",okText:"\u786E\u5B9A",footer:null,children:(0,e.jsx)("div",{className:An.model_content,children:(0,e.jsxs)(j.Z,{form:ee,onFinish:xe,labelCol:{span:4},wrapperCol:{span:19},layout:"horizontal",style:{paddingTop:"20px",paddingBottom:"20px"},children:[(0,e.jsx)(j.Z.Item,{name:"image_list",label:"\u9009\u62E9\u955C\u50CF",rules:[{required:!1,message:"\u8BF7\u8F93\u5165\u7EC8\u7AEF\u578B\u53F7"}],children:(0,e.jsx)(kn,{})}),(0,e.jsxs)(j.Z.Item,{label:null,children:[(0,e.jsx)(C.ZP,{type:"primary",htmlType:"submit",style:{marginRight:"20px"},children:"\u786E\u5B9A"}),(0,e.jsx)(C.ZP,{onClick:I,children:"\u53D6\u6D88"})]})]})})})},Rn=Fe,Mn=n(24508),Ln=n(89745),Cn=n(80818),bn=n(72884),On={content_wrap:"content_wrap___t2j0e",search_wrap:"search_wrap___MKaSL"},In=function(i){var I=i.treeData,t=i.onUserTableSelect,q=i.selectedRowKeys,se=(0,a.useState)([]),te=l()(se,2),P=te[0],oe=te[1],ue=(0,a.useState)(!1),he=l()(ue,2),ge=he[0],_e=he[1],ce=(0,a.useState)(),ee=l()(ce,2),Ee=ee[0],Ce=ee[1],de=(0,a.useState)(""),fe=l()(de,2),le=fe[0],xe=fe[1],Q=(0,a.useState)(1),A=l()(Q,2),R=A[0],M=A[1],H=(0,a.useState)(20),z=l()(H,2),ae=z[0],_=z[1],ie=(0,a.useState)(0),b=l()(ie,2),ne=b[0],X=b[1],m=function(){var S=D()(r()().mark(function B(){var L,be,pe,U,Z,Y,Pe,Je,sn,Dn;return r()().wrap(function(Le){for(;;)switch(Le.prev=Le.next){case 0:return L={page_size:ae,page_num:R},Ee&&(L.user_group_id=Ee),le&&(L.user_name=le),_e(!0),Le.prev=4,Le.next=7,(0,un.lE)(L);case 7:be=Le.sent,console.log("res======",be),pe=be||{},U=pe.code,Z=pe.data,Y=Z===void 0?{}:Z,Pe=Y||{},Je=Pe.data,sn=Pe.total,Dn=sn===void 0?0:sn,U===k.Bq?(oe(Je||[]),X(Dn),_e(!1)):(v.ZP.error(be.message||"\u83B7\u53D6\u7528\u6237\u5217\u8868\u5931\u8D25"),_e(!1)),Le.next=17;break;case 14:Le.prev=14,Le.t0=Le.catch(4),v.ZP.error("\u83B7\u53D6\u7528\u6237\u5217\u8868\u5931\u8D25");case 17:case"end":return Le.stop()}},B,null,[[4,14]])}));return function(){return S.apply(this,arguments)}}();(0,a.useEffect)(function(){m()},[Ee,le]);var d=[{title:"\u5E8F\u53F7",dataIndex:"order",key:"order",width:80,align:"center",render:function(B,L,be){return(0,e.jsx)("span",{children:be+1})}},{title:"\u7528\u6237\u540D",dataIndex:"user_name",key:"user_name",align:"center",render:function(B){return(0,e.jsx)(G.Z,{children:B||"--"})}}],E=function(B){xe(B),M(1)},p=function(B,L){M(B),_(L)},V=function(B,L){M(1),_(L)},Se=function(B){Ce(B)};return(0,e.jsxs)("div",{className:On.content_wrap,children:[(0,e.jsxs)("div",{className:On.search_wrap,children:[(0,e.jsx)(bn.Z,{style:{width:"300px"},showSearch:!0,allowClear:!0,treeDefaultExpandAll:!0,placeholder:"\u8BF7\u9009\u62E9\u7528\u6237\u5206\u7EC4",treeData:I,onChange:Se,fieldNames:{label:"name",value:"id",children:"children"}}),(0,e.jsx)(je.Z.Search,{placeholder:"\u7528\u6237\u540D",onSearch:E,enterButton:!0,allowClear:!0,style:{width:"200px",marginLeft:"10px"}})]}),(0,e.jsx)(Ve.Z,{columns:d,dataSource:P,loading:ge,rowKey:"id",rowSelection:{selectedRowKeys:q,preserveSelectedRowKeys:!0,onChange:t},pagination:{current:R,pageSize:ae,total:ne,simple:!0,onChange:p,onShowSizeChange:V,showSizeChanger:!1,showQuickJumper:!1},scroll:{x:"max-content",y:300}})]})},Un=In,zn=function(i){var I=i.placement,t=I===void 0?"bottomLeft":I,q=i.orgTreeData,se=i.value,te=i.onChange,P=(0,a.useState)(!1),oe=l()(P,2),ue=oe[0],he=oe[1],ge=(0,a.useState)([]),_e=l()(ge,2),ce=_e[0],ee=_e[1],Ee=(0,a.useState)([]),Ce=l()(Ee,2),de=Ce[0],fe=Ce[1],le=(0,a.useState)([]),xe=l()(le,2),Q=xe[0],A=xe[1],R=(0,a.useState)([]),M=l()(R,2),H=M[0],z=M[1],ae=(0,a.useState)([]),_=l()(ae,2),ie=_[0],b=_[1],ne=(0,a.useState)([]),X=l()(ne,2),m=X[0],d=X[1];(0,a.useEffect)(function(){var pe=[],U=[],Z=[],Y=[];se&&se.length>0&&(se.forEach(function(Pe){Pe.type===1?(pe.push(Pe),Z.push(Pe.id)):(U.push(Pe),Y.push(Pe.id))}),ee(se),fe(Z),A(pe),z(Y),b(U))},[se]);var E=function(U,Z){z(U),b(Z)},p=function(){he(!1),fe([]),A([]),z([]),b([])},V=function(){var U=[];(Q||[]).forEach(function(Z){U.push({id:Z.id,name:Z.user_name,type:1,table_id:"user_".concat(Z.id)})}),(ie||[]).forEach(function(Z){U.push({id:Z.id,name:Z.name,type:2,table_id:"group_".concat(Z.id)})}),ee(U),te&&te(U),p()},Se=function(U,Z){fe(U),A(Z)},S=function(U){d(U)},B=function(U){if(U){var Z=U||{},Y=Z.table_id,Pe=ce.filter(function(sn){return sn.table_id!==Y});ee(Pe),d([]),te&&te(Pe)}else{var Je=ce.filter(function(sn){return!m.includes(sn.table_id)});ee(Je),d([]),te&&te(Je)}},L=function(){var U=[{title:"\u5E8F\u53F7",dataIndex:"order",key:"order",width:80,align:"center",render:function(Y,Pe,Je){return(0,e.jsx)("span",{children:Je+1})}},{title:"\u540D\u79F0",dataIndex:"name",key:"name",align:"center",render:function(Y){return(0,e.jsx)(G.Z,{children:Y||"--"})}},{title:"\u7C7B\u578B",dataIndex:"type",key:"type",align:"center",width:220,render:function(Y){return(0,e.jsx)("span",{children:Y==1?"\u7528\u6237":Y==2?"\u7528\u6237\u7EC4":""})}},{title:"\u64CD\u4F5C",key:"action",width:180,align:"center",render:function(Y,Pe){return(0,e.jsx)($.Z,{title:"",placement:"bottom",description:"\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664?",onConfirm:function(){return B(Pe)},okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",children:(0,e.jsx)(C.ZP,{type:"link",children:"\u5220\u9664"})})}}];return U},be=(0,e.jsxs)("div",{style:{width:"600px"},children:[(0,e.jsx)(Ln.Z,{message:"\u53EF\u5207\u6362\u9009\u62E9\u591A\u4E2A\u4E0D\u540C\u7C7B\u578B\u8FDB\u884C\u7ED1\u5B9A",type:"info",showIcon:!0,closeIcon:!0}),(0,e.jsxs)(Cn.Z,{children:[(0,e.jsx)(Cn.Z.TabPane,{tab:"\u5206\u7EC4",children:(0,e.jsx)(ke.Z,{checkable:!0,multiple:!0,checkStrictly:!0,treeData:q,titleField:"name",keyField:"id",childrenField:"children",defaultExpandAll:!0,onCheck:E,checkedKeys:H,icon:(0,e.jsx)(Mn.Z,{style:{fontSize:"15px"}})})},"1"),(0,e.jsx)(Cn.Z.TabPane,{tab:"\u7528\u6237",children:(0,e.jsx)(Un,{treeData:q,onUserTableSelect:Se,selectedRowKeys:de})},"2")]}),(0,e.jsxs)("div",{style:{borderTop:"1px solid #e8e8e8",marginTop:"10px",paddingTop:"10px",display:"flex",justifyContent:"center"},children:[(0,e.jsx)(C.ZP,{onClick:V,style:{marginRight:"30px"},type:"primary",children:"\u786E\u5B9A"}),(0,e.jsx)(C.ZP,{onClick:p,children:"\u53D6\u6D88"})]})]});return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(nn.Z,{style:{marginBottom:"10px"},children:[(0,e.jsx)(Re.Z,{content:be,title:"",trigger:"click",open:ue,onOpenChange:he,placement:t,children:(0,e.jsx)(C.ZP,{children:"\u6DFB\u52A0"})}),(0,e.jsx)($.Z,{title:"",placement:"bottomRight",description:"\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664?",onConfirm:function(){return B()},disabled:m.length===0,okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",children:(0,e.jsx)(C.ZP,{disabled:m.length===0,children:"\u5220\u9664"})})]}),(0,e.jsx)(yn,{dataSource:ce,onDelete:B,scrollY:400,rowKey:"table_id",pagination:!1,columns:L(),rowSelection:{bindTableKeys:m,onChange:S}})]})},Kn=zn,Nn={model_content:"model_content___DaYce"},Ye=function(i){var I=i.onCancel,t=i.onOk,q=i.confirmLoading,se=q===void 0?!1:q,te=i.dataDetial,P=te||{},oe=P.recordData,ue=P.visible,he=oe||{},ge=he.device_id,_e=he.device_group_id,ce=(0,a.useState)([]),ee=l()(ce,2),Ee=ee[0],Ce=ee[1],de=(0,a.useState)([]),fe=l()(de,2),le=fe[0],xe=fe[1],Q=j.Z.useForm(),A=l()(Q,1),R=A[0],M=function(){var ae=D()(r()().mark(function _(){var ie,b,ne,X,m,d,E,p,V;return r()().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return ie={type:1},S.prev=1,S.next=4,(0,un.ib)(ie);case 4:b=S.sent,console.log("result=====",b),ne=b||{},X=ne.code,m=ne.data,d=m===void 0?[]:m,X===k.Bq?d.length>0&&(E=d[0]||{},p=E.children,V=p===void 0?[]:p,Ce(V)):v.ZP.error(b.message||"\u83B7\u53D6\u7EC8\u7AEF\u5206\u7EC4\u5931\u8D25"),S.next=13;break;case 10:S.prev=10,S.t0=S.catch(1),v.ZP.error("\u83B7\u53D6\u7EC8\u7AEF\u5206\u7EC4\u5931\u8D25");case 13:case"end":return S.stop()}},_,null,[[1,10]])}));return function(){return ae.apply(this,arguments)}}();(0,a.useEffect)(function(){M()},[ue]),(0,a.useEffect)(function(){if(ge){var ae={device_id:ge};F(ae).then(function(_){var ie=_||{},b=ie.code,ne=ie.data,X=ne===void 0?[]:ne;if(b===k.Bq&&X&&X.length>0){var m=[];X.map(function(E){var p=E||{},V=p.type,Se=p.user_id,S=p.user_name,B=p.user_group_id,L=p.user_group_name,be=W()({},E);delete be.id,V===1?m.push({table_id:"user_".concat(Se),id:Se,name:S,user_name:S,type:V}):m.push({table_id:"group_".concat(B),id:B,name:L,type:V})}),xe(X);var d={user_list:m};R.setFieldsValue(d)}})}},[ue,R,oe]);var H=function(_){ze(_).then(function(ie){var b=ie||{},ne=b.code;ne===k.Bq?(v.ZP.success("\u7ED1\u5B9A\u6210\u529F"),t()):v.ZP.error("\u7ED1\u5B9A\u5931\u8D25")}).catch(function(){})},z=function(){var ae=D()(r()().mark(function _(){var ie,b,ne,X,m,d;return r()().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.prev=0,p.next=3,R.validateFields();case 3:ie=p.sent,b=ie||{},ne=b.user_list,X=ne===void 0?[]:ne,m=[],X.forEach(function(V){var Se=V||{},S=Se.type,B=Se.id;if(S===1){var L={device_id:ge,device_group_id:_e,type:S,user_id:B},be=le.filter(function(Z){return Z.user_id===V.id&&Z.type===1});be&&be.length===1&&(L.id=be[0].id),m.push(L)}else{var pe={device_id:ge,device_group_id:_e,type:S,user_group_id:B},U=le.filter(function(Z){return Z.user_group_id===V.id&&Z.type===2});U&&U.length===1&&(pe.id=U[0].id),m.push(pe)}}),d={data:m,device_id:ge},H(d),p.next=14;break;case 11:p.prev=11,p.t0=p.catch(0),v.ZP.error("\u8BF7\u68C0\u67E5\u8868\u5355\u5B57\u6BB5");case 14:case"end":return p.stop()}},_,null,[[0,11]])}));return function(){return ae.apply(this,arguments)}}();return(0,e.jsx)(tn.Z,{title:"\u7ED1\u5B9A\u7528\u6237",open:ue,onCancel:I,onOk:z,confirmLoading:se,width:1200,maskClosable:!1,centered:!0,destroyOnHidden:!0,cancelText:"\u53D6\u6D88",okText:"\u786E\u5B9A",footer:null,children:(0,e.jsx)("div",{className:Nn.model_content,children:(0,e.jsxs)(j.Z,{form:R,onFinish:z,labelCol:{span:4},wrapperCol:{span:19},layout:"horizontal",style:{paddingTop:"20px",paddingBottom:"20px"},children:[(0,e.jsx)(j.Z.Item,{name:"user_list",label:"\u9009\u62E9\u7528\u6237",rules:[{required:!1,message:"\u8BF7\u9009\u62E9\u7ED1\u5B9A\u7528\u6237"}],children:(0,e.jsx)(Kn,{orgTreeData:Ee})}),(0,e.jsxs)(j.Z.Item,{label:null,children:[(0,e.jsx)(C.ZP,{type:"primary",htmlType:"submit",style:{marginRight:"20px"},children:"\u786E\u5B9A"}),(0,e.jsx)(C.ZP,{onClick:I,children:"\u53D6\u6D88"})]})]})})})},cn=Ye,Zn=n(66959),Xn=function(i){var I=i.orgTreeData,t=i.onCancel,q=i.onOk,se=i.confirmLoading,te=se===void 0?!1:se,P=i.currentDeviceInfo,oe=P||{},ue=oe.recordData,he=oe.visible,ge=oe.selectedOrg,_e=ue||{},ce=_e.id,ee=_e.device_name,Ee=j.Z.useForm(),Ce=l()(Ee,1),de=Ce[0];(0,a.useEffect)(function(){var xe={id:ce};ve(xe).then(function(Q){console.log("res=======",Q);var A=Q||{},R=A.code,M=A.data;if(R===k.Bq){var H=W()({},M);de.setFieldsValue(H)}})},[he,de,ue,ge]);var fe=function(){var xe=D()(r()().mark(function Q(){var A,R,M,H,z;return r()().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return _.prev=0,_.next=3,de.validateFields();case 3:return A=_.sent,R=W()(W()({},A),{},{id:ce}),_.next=7,Ne(R);case 7:M=_.sent,H=M||{},z=H.code,z===k.Bq&&(v.ZP.success("\u4FDD\u5B58\u6210\u529F"),q&&q()),_.next=15;break;case 12:_.prev=12,_.t0=_.catch(0),v.ZP.error("\u4FDD\u5B58\u5931\u8D25");case 15:case"end":return _.stop()}},Q,null,[[0,12]])}));return function(){return xe.apply(this,arguments)}}(),le={required:"${label} is required!",types:{email:"${label} is not a valid email!",number:"${label} is not a valid number!"},number:{range:"${label} must be between ${min} and ${max}"}};return(0,e.jsx)(tn.Z,{title:ce?"".concat(ee,"\u7EC8\u7AEF\u4FE1\u606F\u4FEE\u6539"):"\u65B0\u589E\u7EC8\u7AEF",open:he,onCancel:t,onOk:fe,confirmLoading:te,width:600,maskClosable:!1,centered:!0,destroyOnHidden:!0,cancelText:"\u53D6\u6D88",okText:"\u786E\u5B9A",footer:null,children:(0,e.jsxs)(j.Z,{form:de,onFinish:fe,labelCol:{span:5},wrapperCol:{span:18},layout:"horizontal",style:{paddingTop:"20px",paddingBottom:"20px"},validateMessages:le,children:[(0,e.jsx)(j.Z.Item,{name:"device_name",label:"\u7EC8\u7AEF\u540D\u79F0",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u663E\u793A\u540D\u79F0"}],children:(0,e.jsx)(je.Z,{})}),(0,e.jsx)(j.Z.Item,{name:"device_id",label:"\u7EC8\u7AEF\u6807\u8BC6",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7EC8\u7AEF\u6807\u8BC6"}],children:(0,e.jsx)(je.Z,{})}),(0,e.jsx)(j.Z.Item,{name:"device_group_id",label:"\u7EC8\u7AEF\u5206\u7EC4",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u7EC8\u7AEF\u5206\u7EC4"}],children:(0,e.jsx)(bn.Z,{showSearch:!0,allowClear:!1,treeDefaultExpandAll:!0,placeholder:"\u8BF7\u9009\u62E9\u7EC8\u7AEF\u5206\u7EC4",treeData:I,fieldNames:{label:"name",value:"id",children:"children"}})}),(0,e.jsx)(j.Z.Item,{name:"device_type",label:"\u7EC8\u7AEF\u7C7B\u578B",rules:[{required:!1,message:"\u8BF7\u8F93\u5165\u7EC8\u7AEF\u578B\u53F7"}],children:(0,e.jsx)(Zn.Z,{options:k.Jk})}),(0,e.jsx)(j.Z.Item,{name:"model",label:"\u578B\u53F7",rules:[{required:!1,message:"\u8BF7\u8F93\u5165\u663E\u793A\u540D\u79F0"}],children:(0,e.jsx)(je.Z,{})}),(0,e.jsx)(j.Z.Item,{name:"ip_addr",label:"IP\u5730\u5740",rules:[{required:!1,message:"\u8BF7\u8F93\u5165IP\u5730\u5740"}],children:(0,e.jsx)(je.Z,{placeholder:"\u8BF7\u8F93\u5165IP\u5730\u5740"})}),(0,e.jsx)(j.Z.Item,{name:"mac_addr",label:"MAC\u5730\u5740",rules:[{required:!1,message:"\u8BF7\u8F93\u5165MAC\u5730\u5740"}],children:(0,e.jsx)(je.Z,{})}),(0,e.jsx)(j.Z.Item,{name:"description",label:"\u63CF\u8FF0",rules:[{required:!1,message:"\u8BF7\u8F93\u5165\u7EC8\u7AEF\u578B\u53F7"}],children:(0,e.jsx)(je.Z.TextArea,{rows:4})}),(0,e.jsxs)(j.Z.Item,{label:null,children:[(0,e.jsx)(C.ZP,{type:"primary",htmlType:"submit",style:{marginRight:"20px"},children:"\u786E\u5B9A"}),(0,e.jsx)(C.ZP,{onClick:t,children:"\u53D6\u6D88"})]})]})})},qn=Xn,er=function(){var i=(0,a.useState)([]),I=l()(i,2),t=I[0],q=I[1],se=(0,a.useState)(),te=l()(se,2),P=te[0],oe=te[1],ue=(0,a.useState)([]),he=l()(ue,2),ge=he[0],_e=he[1],ce=(0,a.useState)(!1),ee=l()(ce,2),Ee=ee[0],Ce=ee[1],de=(0,a.useState)(""),fe=l()(de,2),le=fe[0],xe=fe[1],Q=(0,a.useState)([]),A=l()(Q,2),R=A[0],M=A[1],H=(0,a.useState)(""),z=l()(H,2),ae=z[0],_=z[1],ie=(0,a.useState)(!1),b=l()(ie,2),ne=b[0],X=b[1],m=(0,a.useState)(1),d=l()(m,2),E=d[0],p=d[1],V=(0,a.useState)(20),Se=l()(V,2),S=Se[0],B=Se[1],L=(0,a.useState)(0),be=l()(L,2),pe=be[0],U=be[1],Z=(0,a.useState)(!1),Y=l()(Z,2),Pe=Y[0],Je=Y[1],sn=(0,a.useState)({visible:!1}),Dn=l()(sn,2),Wn=Dn[0],Le=Dn[1],rr=(0,a.useState)({visible:!1}),Vn=l()(rr,2),Yn=Vn[0],Gn=Vn[1],tr=(0,a.useState)({visible:!1}),Jn=l()(tr,2),Qn=Jn[0],Hn=Jn[1];(0,a.useEffect)(function(){wn()},[]);var ar=function f(s,T){return T?s.reduce(function(K,re){var Te,$e=(Te=re.name)===null||Te===void 0?void 0:Te.toLowerCase().includes(T.toLowerCase());if($e)K.push(W()({},re));else if(re.children&&re.children.length>0){var J=f(re.children,T);J.length>0&&K.push(W()(W()({},re),{},{children:J}))}return K},[]):s},sr=ar(t,ae);(0,a.useEffect)(function(){vn()},[le,P,E,S]);var wn=function(){var f=D()(r()().mark(function s(){var T,K,re,Te,$e,J,Qe,ln,N;return r()().wrap(function(ye){for(;;)switch(ye.prev=ye.next){case 0:return X(!0),T={type:2},ye.prev=2,ye.next=5,(0,un.ib)(T);case 5:K=ye.sent,console.log("result=====",K),re=K||{},Te=re.code,$e=re.data,J=$e===void 0?[]:$e,Te===k.Bq?(J.length>0&&(Qe=J[0]||{},ln=Qe.children,N=ln===void 0?[]:ln,q(N)),X(!1)):(X(!1),v.ZP.error(K.message||"\u83B7\u53D6\u7EC8\u7AEF\u5206\u7EC4\u5931\u8D25")),ye.next=15;break;case 11:ye.prev=11,ye.t0=ye.catch(2),v.ZP.error("\u83B7\u53D6\u7EC8\u7AEF\u5206\u7EC4\u5931\u8D25"),X(!1);case 15:case"end":return ye.stop()}},s,null,[[2,11]])}));return function(){return f.apply(this,arguments)}}(),vn=function(){var f=D()(r()().mark(function s(){var T,K,re,Te,$e,J,Qe,ln,N;return r()().wrap(function(ye){for(;;)switch(ye.prev=ye.next){case 0:return T={page_size:S,page_num:E},P&&(T.device_group_id=P),le&&(T.device_name=le),Ce(!0),ye.prev=4,ye.next=7,Ae(T);case 7:K=ye.sent,console.log("result=====",K),re=K||{},Te=re.code,$e=re.data,J=$e||{},Qe=J.data,ln=J.total,N=ln===void 0?0:ln,Te===k.Bq?(_e(Qe),U(N),Ce(!1)):(v.ZP.error(K.message||"\u83B7\u53D6\u7EC8\u7AEF\u5217\u8868\u5931\u8D25"),Ce(!1)),ye.next=18;break;case 14:ye.prev=14,ye.t0=ye.catch(4),v.ZP.error("\u83B7\u53D6\u7EC8\u7AEF\u5217\u8868\u5931\u8D25"),Ce(!1);case 18:case"end":return ye.stop()}},s,null,[[4,14]])}));return function(){return f.apply(this,arguments)}}(),lr=function(){var f=D()(r()().mark(function s(T){var K,re,Te,$e,J,Qe;return r()().wrap(function(N){for(;;)switch(N.prev=N.next){case 0:return N.prev=0,K=T||{},re=K.id,Te={id:re||R},N.next=5,qe(Te);case 5:$e=N.sent,J=$e||{},Qe=J.code,Qe===k.Bq&&(v.ZP.success("\u7EC8\u7AEF\u5220\u9664\u6210\u529F"),M([]),vn()),N.next=13;break;case 10:N.prev=10,N.t0=N.catch(0),v.ZP.error("\u7EC8\u7AEF\u5220\u9664\u5931\u8D25");case 13:case"end":return N.stop()}},s,null,[[0,10]])}));return function(T){return f.apply(this,arguments)}}(),ir=function(s){Le({recordData:W()({},s),visible:!0})},or=[{title:"\u5E8F\u53F7",dataIndex:"order",key:"order",width:60,align:"center",render:function(s,T,K){return(0,e.jsx)("span",{children:K+1})}},{title:"\u7EC8\u7AEF\u540D\u79F0",dataIndex:"device_name",key:"device_name",width:250,ellipsis:!0,align:"center",render:function(s){return(0,e.jsx)(G.Z,{title:s||"",children:s||"--"})}},{title:"\u5E8F\u5217\u53F7",dataIndex:"device_id",key:"device_id",width:250,align:"center",ellipsis:!0,render:function(s){return(0,e.jsx)(G.Z,{title:s||"",children:s||"--"})}},{title:"\u7EC8\u7AEF\u5206\u7EC4",dataIndex:"device_group_name",key:"device_group_name",width:200,align:"center",ellipsis:!0,render:function(s){return(0,e.jsx)("div",{children:(0,e.jsx)(G.Z,{title:s||"",children:s||"--"})})}},{title:"\u7C7B\u578B",dataIndex:"device_type",key:"device_type",width:150,align:"center",ellipsis:!0,render:function(s){var T=s;return(0,e.jsx)(G.Z,{title:k.Wf[T]||"--",children:k.Wf[T]||"--"})}},{title:"\u578B\u53F7",dataIndex:"model",key:"model",width:150,align:"center",ellipsis:!0,render:function(s){return(0,e.jsx)("div",{children:(0,e.jsx)(G.Z,{title:s||"",children:s||"--"})})}},{title:"IP\u5730\u5740",dataIndex:"ip_addr",key:"ip_addr",width:200,ellipsis:!0,align:"center",render:function(s){return(0,e.jsx)("div",{children:(0,e.jsx)(G.Z,{title:s||"",children:s||"--"})})}},{title:"MAC\u5730\u5740",dataIndex:"mac_addr",key:"mac_addr",ellipsis:!0,align:"center",width:200,render:function(s){return(0,e.jsx)("div",{children:(0,e.jsx)(G.Z,{title:s||"",children:s||"--"})})}},{title:"\u5907\u6CE8",dataIndex:"description",key:"description",ellipsis:!0,align:"center",width:200,render:function(s){return(0,e.jsx)("div",{children:(0,e.jsx)(G.Z,{title:s||"",children:s||"--"})})}},{title:"\u64CD\u4F5C",key:"actions",align:"center",width:150,fixed:"right",render:function(s,T){return(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,e.jsx)(C.ZP,{type:"link",onClick:function(){return ir(T)},children:"\u7F16\u8F91"}),(0,e.jsx)(Re.Z,{placement:"bottomRight",content:(0,e.jsxs)("div",{children:[(0,e.jsx)($.Z,{title:"",description:"\u5220\u9664\u64CD\u4F5C\u4E0D\u53EF\u9006\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664?",onConfirm:function(){return lr(T)},okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",children:(0,e.jsx)(C.ZP,{type:"link",children:"\u5220\u9664"})}),(0,e.jsx)("div",{children:(0,e.jsx)(C.ZP,{type:"link",onClick:function(){Gn({recordData:T,visible:!0})},children:"\u7ED1\u5B9A\u7528\u6237"})}),(0,e.jsx)("div",{children:(0,e.jsx)(C.ZP,{type:"link",onClick:function(){Hn({recordData:T,visible:!0})},children:"\u7ED1\u5B9A\u955C\u50CF"})})]}),children:(0,e.jsxs)("a",{onClick:function(re){return re.preventDefault()},children:["\u66F4\u591A",(0,e.jsx)(gn.Z,{style:{fontSize:"0.7rem"}})]})})]})}}],ur=function(s){s.length>0&&(oe(s[0]),p(1))},cr=function(s,T){p(s),B(T)},dr=function(s,T){p(1),B(T)},Sr=function(s){console.log("selectedRowKeys changed: ",s),M(s)},fr=function(){var f=D()(r()().mark(function s(){var T,K,re,Te,$e,J,Qe;return r()().wrap(function(N){for(;;)switch(N.prev=N.next){case 0:if(!P){N.next=15;break}return T={page_size:S,page_num:E},P&&(T.device_group_id=P),N.prev=3,N.next=6,Ae(T);case 6:K=N.sent,re=K||{},Te=re.data,$e=Te||{},J=$e.total,Qe=J===void 0?0:J,Qe>0?v.ZP.info("\u8BE5\u5206\u7EC4\u4E0B\u6709\u7EC8\u7AEF\uFF0C\u8BF7\u5148\u5220\u9664\u8BE5\u5206\u7EC4\u4E0B\u7684\u6240\u6709\u7EC8\u7AEF"):pr(),N.next=15;break;case 12:N.prev=12,N.t0=N.catch(3),console.log(N.t0);case 15:case"end":return N.stop()}},s,null,[[3,12]])}));return function(){return f.apply(this,arguments)}}(),pr=function(){var f=D()(r()().mark(function s(){var T,K,re,Te;return r()().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:return J.prev=0,T={id:P},J.next=4,(0,un.FU)(T);case 4:K=J.sent,re=K||{},Te=re.code,Te===k.Bq&&(v.ZP.success("\u5206\u7EC4\u5220\u9664\u6210\u529F"),wn()),J.next=12;break;case 9:J.prev=9,J.t0=J.catch(0),v.ZP.error("\u5206\u7EC4\u5220\u9664\u5931\u8D25");case 12:case"end":return J.stop()}},s,null,[[0,9]])}));return function(){return f.apply(this,arguments)}}(),vr=function(){wn()},mr=function(){Le({recordData:{},visible:!1}),vn()},hr=function(){Gn({recordData:{},visible:!1}),vn()},gr=function(){Hn({recordData:{},visible:!1}),vn()};return(0,e.jsxs)("div",{className:Me.user_content,children:[(0,e.jsxs)("div",{className:Me.left_content,children:[(0,e.jsxs)("div",{className:Me.search,children:[(0,e.jsxs)("div",{style:{paddingBottom:"5px"},children:[(0,e.jsx)(C.ZP,{type:"text",style:{marginRight:"8px",fontSize:"16px"},icon:(0,e.jsx)(We.Z,{}),onClick:function(){return wn()},title:"\u5237\u65B0",loading:ne}),(0,e.jsx)(C.ZP,{type:"text",style:{marginRight:"8px",fontSize:"16px"},icon:(0,e.jsx)(_n.Z,{}),onClick:function(){return Je(!0)}}),(0,e.jsx)($.Z,{title:"",description:"\u5220\u9664\u64CD\u4F5C\u4E0D\u53EF\u9006\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664?",onConfirm:function(){return fr()},okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",disabled:!P,children:(0,e.jsx)(C.ZP,{type:"text",style:{fontSize:"16px"},icon:(0,e.jsx)(En.Z,{}),disabled:!P})})]}),(0,e.jsx)(je.Z.Search,{placeholder:"\u8BF7\u8F93\u5165\u5206\u7EC4\u540D",style:{marginBottom:6},onSearch:function(s){return _(s)},onChange:function(s){return _(s.target.value)}})]}),(0,e.jsx)("div",{className:Me.tree_box,children:(0,e.jsx)(rn.Z,{spinning:ne,delay:100,children:(0,e.jsx)(ke.Z,{treeData:sr,titleField:"name",keyField:"id",childrenField:"children",defaultExpandAll:!0,onSelect:ur,showIcon:!0,selectedKeys:P?[P]:[],icon:(0,e.jsx)(w,{style:{fontSize:"15px"}})})})})]}),(0,e.jsx)("div",{className:Me.right_content,children:(0,e.jsxs)("div",{className:Me.teble_content,children:[(0,e.jsxs)("div",{style:{marginBottom:16,display:"flex",justifyContent:"space-between"},children:[(0,e.jsx)("div",{}),(0,e.jsx)("div",{children:(0,e.jsxs)("div",{children:[(0,e.jsx)(je.Z.Search,{placeholder:"\u7EC8\u7AEF\u540D\u79F0",value:le,onChange:function(s){return xe(s.target.value)},style:{width:300},onSearch:function(s){console.log("Search user:",s),p(1)}}),(0,e.jsx)(C.ZP,{style:{marginRight:"8px",marginLeft:"8px"},onClick:vn,icon:(0,e.jsx)(We.Z,{}),title:"\u5237\u65B0",loading:Ee})]})})]}),(0,e.jsx)("div",{className:Me.teble_box,children:(0,e.jsx)("div",{className:"images-list-table",children:(0,e.jsx)(Ve.Z,{columns:or,dataSource:ge,loading:Ee,rowKey:"id",pagination:{current:E,pageSize:S,total:pe,onChange:cr,onShowSizeChange:dr,showSizeChanger:!0,showQuickJumper:!0,pageSizeOptions:["10","20","50","100"],showTotal:function(s){return"\u5171".concat(s,"\u6761\u6570\u636E")}},scroll:{x:"max-content",y:"max-content"},style:{height:"100%",display:"flex",flexDirection:"column"}})})})]})}),Pe&&(0,e.jsx)(we.Z,{visible:Pe,type:2,title:"\u65B0\u589E\u7EC8\u7AEF\u5206\u7EC4",onCancel:function(){Je(!1)},selectedOrg:P,onOk:function(){vr()},orgTreeData:t}),Wn.visible&&(0,e.jsx)(qn,{selectedOrg:P,orgTreeData:t,currentDeviceInfo:Wn,onCancel:function(){Le({recordData:{},visible:!1})},onOk:function(){mr()}}),Yn.visible&&(0,e.jsx)(cn,{dataDetial:Yn,onCancel:function(){Gn({recordData:{},visible:!1})},onOk:function(){hr()}}),Qn.visible&&(0,e.jsx)(Rn,{dataDetial:Qn,onCancel:function(){Hn({recordData:{},visible:!1})},onOk:function(){gr()}})]})},nr=er},2112:function(mn,Ke,n){var O=n(90228),r=n.n(O),Xe=n(87999),D=n.n(Xe),Oe=n(48305),W=n.n(Oe),Ge=n(78134),l=n(17981),k=n(50850),ke=n(39032),we=n(31106),De=n(66767),Ie=n(72884),Ae=n(74970),Ue=n(75271),ve=n(52676),Be=function(Ze){var Ne=Ze.title,He=Ne===void 0?"\u65B0\u589E\u5206\u7EC4":Ne,ze=Ze.visible,h=Ze.onCancel,F=Ze.onOk,me=Ze.orgTreeData,c=Ze.selectedOrg,dn=Ze.type,fn=(0,Ue.useState)(!1),on=W()(fn,2),hn=on[0],en=on[1],un=k.Z.useForm(),gn=W()(un,1),We=gn[0];(0,Ue.useEffect)(function(){if(c){var a={parent_id:c};We.setFieldsValue(a)}},[ze,We,c]);var _n=function(){We.submit()},En=function(){We.resetFields(),h()},Sn=function(){var a=D()(r()().mark(function pn(){var o,u,g,y,w,v,G,C;return r()().wrap(function($){for(;;)switch($.prev=$.next){case 0:return $.next=2,We.validateFields();case 2:return o=$.sent,en(!0),$.prev=4,console.log("values=====",o),u=o||{},g=u.name,y=u.parent_id,w={name:g,type:dn,parent_id:y},$.next=10,(0,l.EJ)(w);case 10:v=$.sent,en(!1),G=v||{},C=G.code,C===Ge.Bq&&(ke.ZP.success("\u6DFB\u52A0\u6210\u529F"),We.resetFields(),h(),F()),$.next=20;break;case 16:$.prev=16,$.t0=$.catch(4),en(!1),ke.ZP.error("\u521B\u5EFA\u7528\u6237\u5206\u7EC4\u5931\u8D25");case 20:case"end":return $.stop()}},pn,null,[[4,16]])}));return function(){return a.apply(this,arguments)}}();return(0,ve.jsx)(we.Z,{title:He,open:ze,onOk:_n,onCancel:En,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",centered:!0,destroyOnHidden:!0,width:600,footer:null,children:(0,ve.jsx)("div",{style:{height:"300px"},children:(0,ve.jsxs)(k.Z,{form:We,labelCol:{span:5},wrapperCol:{span:18},layout:"horizontal",onFinish:Sn,style:{paddingTop:"20px",paddingBottom:"20px"},children:[(0,ve.jsx)(k.Z.Item,{name:"name",label:"\u5206\u7EC4\u540D",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5206\u7EC4\u540D!"}],children:(0,ve.jsx)(De.Z,{placeholder:"\u8BF7\u8F93\u5165\u5206\u7EC4\u540D"})}),(0,ve.jsx)(k.Z.Item,{name:"parent_id",label:"\u7236\u5206\u7EC4\u540D",children:(0,ve.jsx)(Ie.Z,{showSearch:!0,allowClear:!0,treeDefaultExpandAll:!0,placeholder:"\u8BF7\u9009\u62E9\u7236\u5206\u7EC4\u540D",treeData:me,fieldNames:{label:"name",value:"id",children:"children"}})}),(0,ve.jsxs)(k.Z.Item,{label:null,children:[(0,ve.jsx)(Ae.ZP,{type:"primary",htmlType:"submit",style:{marginRight:"20px"},loading:hn,children:"\u786E\u5B9A"}),(0,ve.jsx)(Ae.ZP,{onClick:h,children:"\u53D6\u6D88"})]})]})})})};Ke.Z=Be},17981:function(mn,Ke,n){n.d(Ke,{EJ:function(){return Ge},FU:function(){return we},GA:function(){return Ze},cn:function(){return Ue},h8:function(){return He},ib:function(){return k},lE:function(){return Ie},uz:function(){return Be}});var O=n(90228),r=n.n(O),Xe=n(87999),D=n.n(Xe),Oe=n(35103),W="/api/nex/v1";function Ge(h){return l.apply(this,arguments)}function l(){return l=D()(r()().mark(function h(F){return r()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.abrupt("return",(0,Oe.request)("".concat(W,"/user/device/group/add"),{method:"POST",data:F}));case 1:case"end":return c.stop()}},h)})),l.apply(this,arguments)}function k(h){return ke.apply(this,arguments)}function ke(){return ke=D()(r()().mark(function h(F){return r()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.abrupt("return",(0,Oe.request)("".concat(W,"/user/device/group/query"),{method:"POST",data:F}));case 1:case"end":return c.stop()}},h)})),ke.apply(this,arguments)}function we(h){return De.apply(this,arguments)}function De(){return De=D()(r()().mark(function h(F){return r()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.abrupt("return",(0,Oe.request)("".concat(W,"/user/device/group/delete"),{method:"POST",data:F}));case 1:case"end":return c.stop()}},h)})),De.apply(this,arguments)}function Ie(h){return Ae.apply(this,arguments)}function Ae(){return Ae=D()(r()().mark(function h(F){return r()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.abrupt("return",(0,Oe.request)("".concat(W,"/user/select/page"),{method:"POST",data:F}));case 1:case"end":return c.stop()}},h)})),Ae.apply(this,arguments)}function Ue(h){return ve.apply(this,arguments)}function ve(){return ve=D()(r()().mark(function h(F){return r()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.abrupt("return",(0,Oe.request)("".concat(W,"/user/add"),{method:"POST",data:F}));case 1:case"end":return c.stop()}},h)})),ve.apply(this,arguments)}function Be(h){return qe.apply(this,arguments)}function qe(){return qe=D()(r()().mark(function h(F){return r()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.abrupt("return",(0,Oe.request)("".concat(W,"/user/update"),{method:"POST",data:F}));case 1:case"end":return c.stop()}},h)})),qe.apply(this,arguments)}function Ze(h){return Ne.apply(this,arguments)}function Ne(){return Ne=D()(r()().mark(function h(F){return r()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.abrupt("return",(0,Oe.request)("".concat(W,"/user/query"),{method:"POST",data:F}));case 1:case"end":return c.stop()}},h)})),Ne.apply(this,arguments)}function He(h){return ze.apply(this,arguments)}function ze(){return ze=D()(r()().mark(function h(F){return r()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.abrupt("return",(0,Oe.request)("".concat(W,"/user/delete"),{method:"POST",data:F}));case 1:case"end":return c.stop()}},h)})),ze.apply(this,arguments)}},89745:function(mn,Ke,n){n.d(Ke,{Z:function(){return pn}});var O=n(75271),r=n(78354),Xe=n(48368),D=n(45659),Oe=n(21427),W=n(15007),Ge=n(82187),l=n.n(Ge),k=n(62803),ke=n(71305),we=n(42684),De=n(48349),Ie=n(70436),Ae=n(89260),Ue=n(67083),ve=n(89348);const Be=(o,u,g,y,w)=>({background:o,border:`${(0,Ae.bf)(y.lineWidth)} ${y.lineType} ${u}`,[`${w}-icon`]:{color:g}}),qe=o=>{const{componentCls:u,motionDurationSlow:g,marginXS:y,marginSM:w,fontSize:v,fontSizeLG:G,lineHeight:C,borderRadiusLG:Re,motionEaseInOutCirc:$,withDescriptionIconSize:je,colorText:rn,colorTextHeading:Ve,withDescriptionPadding:Me,defaultPadding:j}=o;return{[u]:Object.assign(Object.assign({},(0,Ue.Wf)(o)),{position:"relative",display:"flex",alignItems:"center",padding:j,wordWrap:"break-word",borderRadius:Re,[`&${u}-rtl`]:{direction:"rtl"},[`${u}-content`]:{flex:1,minWidth:0},[`${u}-icon`]:{marginInlineEnd:y,lineHeight:0},"&-description":{display:"none",fontSize:v,lineHeight:C},"&-message":{color:Ve},[`&${u}-motion-leave`]:{overflow:"hidden",opacity:1,transition:`max-height ${g} ${$}, opacity ${g} ${$},
padding-top ${g} ${$}, padding-bottom ${g} ${$},
margin-bottom ${g} ${$}`},[`&${u}-motion-leave-active`]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0}}),[`${u}-with-description`]:{alignItems:"flex-start",padding:Me,[`${u}-icon`]:{marginInlineEnd:w,fontSize:je,lineHeight:0},[`${u}-message`]:{display:"block",marginBottom:y,color:Ve,fontSize:G},[`${u}-description`]:{display:"block",color:rn}},[`${u}-banner`]:{marginBottom:0,border:"0 !important",borderRadius:0}}},Ze=o=>{const{componentCls:u,colorSuccess:g,colorSuccessBorder:y,colorSuccessBg:w,colorWarning:v,colorWarningBorder:G,colorWarningBg:C,colorError:Re,colorErrorBorder:$,colorErrorBg:je,colorInfo:rn,colorInfoBorder:Ve,colorInfoBg:Me}=o;return{[u]:{"&-success":Be(w,y,g,o,u),"&-info":Be(Me,Ve,rn,o,u),"&-warning":Be(C,G,v,o,u),"&-error":Object.assign(Object.assign({},Be(je,$,Re,o,u)),{[`${u}-description > pre`]:{margin:0,padding:0}})}}},Ne=o=>{const{componentCls:u,iconCls:g,motionDurationMid:y,marginXS:w,fontSizeIcon:v,colorIcon:G,colorIconHover:C}=o;return{[u]:{"&-action":{marginInlineStart:w},[`${u}-close-icon`]:{marginInlineStart:w,padding:0,overflow:"hidden",fontSize:v,lineHeight:(0,Ae.bf)(v),backgroundColor:"transparent",border:"none",outline:"none",cursor:"pointer",[`${g}-close`]:{color:G,transition:`color ${y}`,"&:hover":{color:C}}},"&-close-text":{color:G,transition:`color ${y}`,"&:hover":{color:C}}}}},He=o=>({withDescriptionIconSize:o.fontSizeHeading3,defaultPadding:`${o.paddingContentVerticalSM}px 12px`,withDescriptionPadding:`${o.paddingMD}px ${o.paddingContentHorizontalLG}px`});var ze=(0,ve.I$)("Alert",o=>[qe(o),Ze(o),Ne(o)],He),h=function(o,u){var g={};for(var y in o)Object.prototype.hasOwnProperty.call(o,y)&&u.indexOf(y)<0&&(g[y]=o[y]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var w=0,y=Object.getOwnPropertySymbols(o);w<y.length;w++)u.indexOf(y[w])<0&&Object.prototype.propertyIsEnumerable.call(o,y[w])&&(g[y[w]]=o[y[w]]);return g};const F={success:r.Z,info:W.Z,error:Xe.Z,warning:Oe.Z},me=o=>{const{icon:u,prefixCls:g,type:y}=o,w=F[y]||null;return u?(0,De.wm)(u,O.createElement("span",{className:`${g}-icon`},u),()=>({className:l()(`${g}-icon`,u.props.className)})):O.createElement(w,{className:`${g}-icon`})},c=o=>{const{isClosable:u,prefixCls:g,closeIcon:y,handleClose:w,ariaProps:v}=o,G=y===!0||y===void 0?O.createElement(D.Z,null):y;return u?O.createElement("button",Object.assign({type:"button",onClick:w,className:`${g}-close-icon`,tabIndex:0},v),G):null};var fn=O.forwardRef((o,u)=>{const{description:g,prefixCls:y,message:w,banner:v,className:G,rootClassName:C,style:Re,onMouseEnter:$,onMouseLeave:je,onClick:rn,afterClose:Ve,showIcon:Me,closable:j,closeText:tn,closeIcon:nn,action:xn,id:Bn}=o,e=h(o,["description","prefixCls","message","banner","className","rootClassName","style","onMouseEnter","onMouseLeave","onClick","afterClose","showIcon","closable","closeText","closeIcon","action","id"]),[jn,Fn]=O.useState(!1),yn=O.useRef(null);O.useImperativeHandle(u,()=>({nativeElement:yn.current}));const{getPrefixCls:Pn,direction:$n,closable:an,closeIcon:Tn,className:kn,style:An}=(0,Ie.dj)("alert"),Fe=Pn("alert",y),[Rn,Mn,Ln]=ze(Fe),Cn=Ye=>{var cn;Fn(!0),(cn=o.onClose)===null||cn===void 0||cn.call(o,Ye)},bn=O.useMemo(()=>o.type!==void 0?o.type:v?"warning":"info",[o.type,v]),On=O.useMemo(()=>typeof j=="object"&&j.closeIcon||tn?!0:typeof j=="boolean"?j:nn!==!1&&nn!==null&&nn!==void 0?!0:!!an,[tn,nn,j,an]),In=v&&Me===void 0?!0:Me,Un=l()(Fe,`${Fe}-${bn}`,{[`${Fe}-with-description`]:!!g,[`${Fe}-no-icon`]:!In,[`${Fe}-banner`]:!!v,[`${Fe}-rtl`]:$n==="rtl"},kn,G,C,Ln,Mn),zn=(0,ke.Z)(e,{aria:!0,data:!0}),Kn=O.useMemo(()=>typeof j=="object"&&j.closeIcon?j.closeIcon:tn||(nn!==void 0?nn:typeof an=="object"&&an.closeIcon?an.closeIcon:Tn),[nn,j,tn,Tn]),Nn=O.useMemo(()=>{const Ye=j!=null?j:an;if(typeof Ye=="object"){const{closeIcon:cn}=Ye;return h(Ye,["closeIcon"])}return{}},[j,an]);return Rn(O.createElement(k.ZP,{visible:!jn,motionName:`${Fe}-motion`,motionAppear:!1,motionEnter:!1,onLeaveStart:Ye=>({maxHeight:Ye.offsetHeight}),onLeaveEnd:Ve},({className:Ye,style:cn},Zn)=>O.createElement("div",Object.assign({id:Bn,ref:(0,we.sQ)(yn,Zn),"data-show":!jn,className:l()(Un,Ye),style:Object.assign(Object.assign(Object.assign({},An),Re),cn),onMouseEnter:$,onMouseLeave:je,onClick:rn,role:"alert"},zn),In?O.createElement(me,{description:g,icon:o.icon,prefixCls:Fe,type:bn}):null,O.createElement("div",{className:`${Fe}-content`},w?O.createElement("div",{className:`${Fe}-message`},w):null,g?O.createElement("div",{className:`${Fe}-description`},g):null),xn?O.createElement("div",{className:`${Fe}-action`},xn):null,O.createElement(c,{isClosable:On,prefixCls:Fe,closeIcon:Kn,handleClose:Cn,ariaProps:Nn}))))}),on=n(47519),hn=n(59694),en=n(56953),un=n(88811),gn=n(76227);function We(o,u,g){return u=(0,en.Z)(u),(0,gn.Z)(o,(0,un.Z)()?Reflect.construct(u,g||[],(0,en.Z)(o).constructor):u.apply(o,g))}var _n=n(66217),Sn=function(o){function u(){var g;return(0,on.Z)(this,u),g=We(this,u,arguments),g.state={error:void 0,info:{componentStack:""}},g}return(0,_n.Z)(u,o),(0,hn.Z)(u,[{key:"componentDidCatch",value:function(y,w){this.setState({error:y,info:w})}},{key:"render",value:function(){const{message:y,description:w,id:v,children:G}=this.props,{error:C,info:Re}=this.state,$=(Re==null?void 0:Re.componentStack)||null,je=typeof y=="undefined"?(C||"").toString():y,rn=typeof w=="undefined"?$:w;return C?O.createElement(fn,{id:v,type:"error",message:je,description:O.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},rn)}):G}}])}(O.Component);const a=fn;a.ErrorBoundary=Sn;var pn=a}}]);