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

4 lines
47 KiB
JavaScript

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[782],{16711:function(mt,Ke,t){t.d(Ke,{AA:function(){return b},Bq:function(){return P},DE:function(){return G},Dx:function(){return Ie},Jk:function(){return $},OQ:function(){return s},UO:function(){return Ge},Wf:function(){return r},iI:function(){return Pe},uz:function(){return $e}});var P="200",r={1:"VDI",3:"VOI"},Qe={1:"\u5168\u76D8\u8FD8\u539F",2:"\u6570\u636E\u76D8\u8FD8\u539F",3:"\u5B9A\u65F6\u8FD8\u539F",0:"\u4E0D\u8FD8\u539F"},b={1:"\u57DF\u7528\u6237",0:"\u672C\u5730\u7528\u6237"},Pe={1:"\u5973",2:"\u7537"},G={1:"\u4E00\u7EA7",2:"\u4E8C\u7EA7",3:"\u4E09\u7EA7"},Ge={1:"\u542F\u7528",2:"\u7981\u7528"},s=[{value:1,label:"\u57DF\u7528\u6237"},{value:0,label:"\u672C\u5730\u7528\u6237"}],$=[{value:1,label:"VDI"},{value:3,label:"VOI"}],$e=[{value:1,label:"\u5973"},{value:2,label:"\u7537"}],Ie=[{value:1,label:"\u4E00\u7EA7"},{value:2,label:"\u4E8C\u7EA7"},{value:3,label:"\u4E09\u7EA7"}]},72915:function(mt,Ke,t){var P=t(97857),r=t.n(P),Qe=t(13769),b=t.n(Qe),Pe=t(67294),G=t(31673),Ge=t(85893),s=["treeData","titleField","keyField","childrenField","onCheck"],$=function(Ie){var be=Ie.treeData,Te=Ie.titleField,ke=Ie.keyField,Le=Ie.childrenField,pe=Le===void 0?"children":Le,Ze=Ie.onCheck,Xe=b()(Ie,s),Oe=function Ue(v){return v.map(function(w){var me=r()({title:w[Te],key:w[ke]},w);return w[pe]&&Array.isArray(w[pe])&&(me.children=Ue(w[pe])),me})},ze=Oe(be),He=function(v,w){var me=[];Array.isArray(v)?me=v:me=v.checked,Ze==null||Ze(me,w.checkedNodes,w)};return(0,Ge.jsx)(G.Z,r()({treeData:ze,onCheck:He},Xe))};Ke.Z=$},89087:function(mt,Ke,t){t.r(Ke),t.d(Ke,{default:function(){return er}});var P=t(15009),r=t.n(P),Qe=t(99289),b=t.n(Qe),Pe=t(97857),G=t.n(Pe),Ge=t(5574),s=t.n(Ge),$=t(16711),$e=t(72915),Ie=t(86231),be=t(6510),Te="/api/nex/v1";function ke(D){return Le.apply(this,arguments)}function Le(){return Le=b()(r()().mark(function D(l){return r()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,be.request)("".concat(Te,"/device/select/page"),{method:"POST",data:l}));case 1:case"end":return n.stop()}},D)})),Le.apply(this,arguments)}function pe(D){return Ze.apply(this,arguments)}function Ze(){return Ze=b()(r()().mark(function D(l){return r()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,be.request)("".concat(Te,"/device/query"),{method:"POST",data:l}));case 1:case"end":return n.stop()}},D)})),Ze.apply(this,arguments)}function Xe(D){return Oe.apply(this,arguments)}function Oe(){return Oe=b()(r()().mark(function D(l){return r()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,be.request)("".concat(Te,"/device/delete"),{method:"POST",data:l}));case 1:case"end":return n.stop()}},D)})),Oe.apply(this,arguments)}function ze(D){return He.apply(this,arguments)}function He(){return He=b()(r()().mark(function D(l){return r()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,be.request)("".concat(Te,"/device/update"),{method:"POST",data:l}));case 1:case"end":return n.stop()}},D)})),He.apply(this,arguments)}function Ue(D){return v.apply(this,arguments)}function v(){return v=b()(r()().mark(function D(l){return r()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,be.request)("".concat(Te,"/device/user/mapping/add"),{method:"POST",data:l}));case 1:case"end":return n.stop()}},D)})),v.apply(this,arguments)}function w(D){return me.apply(this,arguments)}function me(){return me=b()(r()().mark(function D(l){return r()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,be.request)("".concat(Te,"/device/user/mapping/select"),{method:"POST",data:l}));case 1:case"end":return n.stop()}},D)})),me.apply(this,arguments)}function c(D){return ct.apply(this,arguments)}function ct(){return ct=b()(r()().mark(function D(l){return r()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,be.request)("".concat(Te,"/image/select/page"),{method:"POST",data:l}));case 1:case"end":return n.stop()}},D)})),ct.apply(this,arguments)}function dt(D){return st.apply(this,arguments)}function st(){return st=b()(r()().mark(function D(l){return r()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,be.request)("".concat(Te,"/device/image/mapping/select"),{method:"POST",data:l}));case 1:case"end":return n.stop()}},D)})),st.apply(this,arguments)}function vt(D){return qe.apply(this,arguments)}function qe(){return qe=b()(r()().mark(function D(l){return r()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",(0,be.request)("".concat(Te,"/device/image/mapping/add"),{method:"POST",data:l}));case 1:case"end":return n.stop()}},D)})),qe.apply(this,arguments)}var lt=t(39231),ht=t(80882),Ne=t(87740),gt=t(24969),Dt=t(48689),_t=t(87462),a=t(67294),ft={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"},u=ft,o=t(72298),h=function(l,T){return a.createElement(o.Z,(0,_t.Z)({},l,{ref:T,icon:u}))},_=a.forwardRef(h),I=_,m=t(68872),H=t(83062),S=t(77683),Ae=t(55241),F=t(86738),Ee=t(31800),tt=t(74330),Ve=t(65128),Re={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"},E=t(86587),rt=t(2975),et=t(78957),jt=t(13769),Bt=t.n(jt),e=t(85893),Et=["dataSource","onDelete","isSerial","isAction","scrollY"],wt=function(l){var T=l.dataSource,n=l.onDelete,Q=l.isSerial,ne=Q===void 0?!0:Q,te=l.isAction,Z=te===void 0?!0:te,le=l.scrollY,ie=le===void 0?400:le,ve=Bt()(l,Et);return(0,e.jsx)("div",{children:(0,e.jsx)(Ve.Z,G()({dataSource:T,scroll:{y:ie}},ve))})},St=wt,xt={content_wrap:"content_wrap___IzyVq",search_wrap:"search_wrap___vyvi6"},Ft=function(l){var T=l.onUserTableSelect,n=l.selectedRowKeys,Q=(0,a.useState)(!1),ne=s()(Q,2),te=ne[0],Z=ne[1],le=(0,a.useState)([]),ie=s()(le,2),ve=ie[0],Se=ie[1],he=(0,a.useState)(),ue=s()(he,2),X=ue[0],De=ue[1],ye=(0,a.useState)(1),oe=s()(ye,2),ce=oe[0],ae=oe[1],je=(0,a.useState)(20),J=s()(je,2),A=J[0],R=J[1],M=(0,a.useState)(0),k=s()(M,2),W=k[0],se=k[1];(0,a.useEffect)(function(){C()},[X,ce,A]);var C=function(){var g=b()(r()().mark(function d(){var j,p,V,ge,y,B,K,Ce,de,z;return r()().wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return j={page_size:A,page_num:ce},X&&(j.keywords=X),Z(!0),Y.prev=3,Y.next=6,c(j);case 6:p=Y.sent,console.log("imagesRes=========",p),V=p||{},ge=V.code,y=V.data,B=y||{},K=B.data,Ce=K===void 0?[]:K,de=B.total,z=de===void 0?0:de,ge===$.Bq?(Se(Ce),se(z),Z(!1)):(m.ZP.error(p.message||"\u83B7\u53D6\u955C\u50CF\u5217\u8868\u5931\u8D25"),Z(!1)),Y.next=17;break;case 13:Y.prev=13,Y.t0=Y.catch(3),m.ZP.error("\u83B7\u53D6\u955C\u50CF\u5217\u8868\u5931\u8D25"),Z(!1);case 17:case"end":return Y.stop()}},d,null,[[3,13]])}));return function(){return g.apply(this,arguments)}}(),x=[{title:"\u5E8F\u53F7",dataIndex:"order",key:"order",width:80,render:function(d,j,p){return(0,e.jsx)("span",{children:p+1})}},{title:"\u955C\u50CF\u540D\u79F0",dataIndex:"image_name",render:function(d){return(0,e.jsx)(H.Z,{children:d||"--"})}}],L=function(d){De(d),ae(1)},q=function(d,j){ae(d),R(j)},U=function(d,j){ae(1),R(j)};return(0,e.jsxs)("div",{className:xt.content_wrap,children:[(0,e.jsx)("div",{className:xt.search_wrap,children:(0,e.jsx)(Ee.Z.Search,{placeholder:"\u955C\u50CF\u540D\u79F0...",onSearch:L,enterButton:!0,allowClear:!0,style:{width:"300px",marginLeft:"10px"}})}),(0,e.jsx)(Ve.Z,{columns:x,dataSource:ve,rowKey:"id",loading:te,rowSelection:{selectedRowKeys:n,preserveSelectedRowKeys:!0,onChange:T},pagination:{current:ce,pageSize:A,total:W,simple:!0,onChange:q,onShowSizeChange:U,showSizeChanger:!1,showQuickJumper:!1,pageSizeOptions:["10","20","50","100"]},scroll:{x:"max-content",y:300}})]})},nt=Ft,Pt=function(l){var T=l.placement,n=T===void 0?"bottomLeft":T,Q=l.value,ne=l.onChange,te=(0,a.useState)(!1),Z=s()(te,2),le=Z[0],ie=Z[1],ve=(0,a.useState)([]),Se=s()(ve,2),he=Se[0],ue=Se[1],X=(0,a.useState)([]),De=s()(X,2),ye=De[0],oe=De[1],ce=(0,a.useState)([]),ae=s()(ce,2),je=ae[0],J=ae[1],A=(0,a.useState)([]),R=s()(A,2),M=R[0],k=R[1];(0,a.useEffect)(function(){var g=[],d=[];Q&&Q.length>0&&(Q.forEach(function(j){g.push(j),d.push(j.id)}),ue(Q),oe(d),J(g))},[Q]);var W=function(){ie(!1),oe([]),J([])},se=function(){var d=[];(je||[]).forEach(function(j){d.push({id:j.id,image_name:j.image_name})}),ue(d),ne(d),W()},C=function(d,j){oe(d),J(j)},x=function(d){k(d)},L=function(d){if(d){var j=d||{},p=j.id,V=he.filter(function(K){return K.id!==p}),ge=[];V.map(function(K){return ge.push(K.id)}),ue(V),oe(ge),J(V),ne(V),k([])}else{var y=he.filter(function(K){return!M.includes(K.id)}),B=[];y.map(function(K){return B.push(K.id)}),ue(y),k([]),oe(B),J(y),ne(y)}},q=(0,e.jsxs)("div",{style:{width:"600px"},children:[(0,e.jsx)(nt,{onUserTableSelect:C,selectedRowKeys:ye}),(0,e.jsxs)("div",{style:{borderTop:"1px solid #e8e8e8",marginTop:"10px",paddingTop:"10px",display:"flex",justifyContent:"center"},children:[(0,e.jsx)(S.ZP,{onClick:se,style:{marginRight:"30px"},type:"primary",children:"\u786E\u5B9A"}),(0,e.jsx)(S.ZP,{onClick:W,children:"\u53D6\u6D88"})]})]}),U=function(){var d=[{title:"\u5E8F\u53F7",dataIndex:"order",key:"order",width:80,render:function(p,V,ge){return(0,e.jsx)("span",{children:ge+1})}},{title:"\u955C\u50CF\u540D\u79F0",dataIndex:"image_name",key:"image_name",render:function(p){return(0,e.jsx)(H.Z,{children:p||"--"})}},{title:"\u64CD\u4F5C",key:"action",width:150,align:"center",render:function(p,V){return(0,e.jsx)(F.Z,{title:"",placement:"bottom",description:"\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664?",onConfirm:function(){return L(V)},okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",children:(0,e.jsx)(S.ZP,{type:"link",children:"\u5220\u9664"})})}}];return d};return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(et.Z,{style:{marginBottom:"10px"},children:[(0,e.jsx)(Ae.Z,{content:q,title:"",trigger:"click",open:le,onOpenChange:ie,placement:n,children:(0,e.jsx)(S.ZP,{children:"\u6DFB\u52A0"})}),(0,e.jsx)(F.Z,{title:"",placement:"bottomRight",description:"\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664?",onConfirm:function(){return L()},disabled:M.length===0,okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",children:(0,e.jsx)(S.ZP,{disabled:M.length===0,children:"\u5220\u9664"})})]}),(0,e.jsx)(St,{dataSource:he,onDelete:L,columns:U(),scrollY:400,rowKey:"id",pagination:!1,rowSelection:{bindTableKeys:M,onChange:x}})]})},$t=Pt,At={model_content:"model_content___MsF87"},Be=function(l){var T=l.onCancel,n=l.onOk,Q=l.confirmLoading,ne=Q===void 0?!1:Q,te=l.dataDetial,Z=te||{},le=Z.recordData,ie=Z.visible,ve=le||{},Se=ve.device_id,he=E.Z.useForm(),ue=s()(he,1),X=ue[0],De=(0,a.useState)([]),ye=s()(De,2),oe=ye[0],ce=ye[1];(0,a.useEffect)(function(){var J={device_id:Se};dt(J).then(function(A){var R=A||{},M=R.code,k=R.data,W=k===void 0?[]:k;if(M===$.Bq&&W&&W.length){var se=[];W.forEach(function(x){se.push({id:x.image_id,image_name:x.image_name})}),ce(W);var C={image_list:se};X.setFieldsValue(C)}})},[ie,X,le]);var ae=function(A){vt(A).then(function(R){var M=R||{},k=M.code;k===$.Bq?(m.ZP.success("\u7ED1\u5B9A\u6210\u529F"),n&&n()):m.ZP.error("\u7ED1\u5B9A\u5931\u8D25")})},je=function(){var J=b()(r()().mark(function A(){var R,M,k,W,se;return r()().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return x.prev=0,x.next=3,X.validateFields();case 3:R=x.sent,M=R||{},k=M.image_list,console.log("image_list=====",k),k&&k.length>0?(W=[],k.forEach(function(L){var q={device_id:Se,image_id:L.id},U=oe.filter(function(g){return g.image_id===L.id});U&&U.length===1&&(q.id=U[0].id),W.push(G()({},q))}),se={data:W},ae(se)):m.ZP.info("\u8BF7\u5148\u9009\u62E9\u7ED1\u5B9A\u7684\u955C\u50CF"),x.next=12;break;case 9:x.prev=9,x.t0=x.catch(0),m.ZP.error("\u8BF7\u68C0\u67E5\u8868\u5355\u5B57\u6BB5");case 12:case"end":return x.stop()}},A,null,[[0,9]])}));return function(){return J.apply(this,arguments)}}();return(0,e.jsx)(rt.Z,{title:"\u7ED1\u5B9A\u955C\u50CF",open:ie,onCancel:T,onOk:je,confirmLoading:ne,width:1200,maskClosable:!1,centered:!0,destroyOnHidden:!0,cancelText:"\u53D6\u6D88",okText:"\u786E\u5B9A",footer:null,children:(0,e.jsx)("div",{className:At.model_content,children:(0,e.jsxs)(E.Z,{form:X,onFinish:je,labelCol:{span:4},wrapperCol:{span:19},layout:"horizontal",style:{paddingTop:"20px",paddingBottom:"20px"},children:[(0,e.jsx)(E.Z.Item,{name:"image_list",label:"\u9009\u62E9\u955C\u50CF",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7EC8\u7AEF\u578B\u53F7"}],children:(0,e.jsx)($t,{})}),(0,e.jsxs)(E.Z.Item,{label:null,children:[(0,e.jsx)(S.ZP,{type:"primary",htmlType:"submit",style:{marginRight:"20px"},children:"\u786E\u5B9A"}),(0,e.jsx)(S.ZP,{onClick:T,children:"\u53D6\u6D88"})]})]})})})},Rt=Be,Mt=t(55355),kt=t(40056),yt=t(49199),Ct=t(56558),Tt={content_wrap:"content_wrap___t2j0e",search_wrap:"search_wrap___MKaSL"},Ot=function(l){var T=l.treeData,n=l.onUserTableSelect,Q=l.selectedRowKeys,ne=(0,a.useState)([]),te=s()(ne,2),Z=te[0],le=te[1],ie=(0,a.useState)(!1),ve=s()(ie,2),Se=ve[0],he=ve[1],ue=(0,a.useState)(),X=s()(ue,2),De=X[0],ye=X[1],oe=(0,a.useState)(""),ce=s()(oe,2),ae=ce[0],je=ce[1],J=(0,a.useState)(1),A=s()(J,2),R=A[0],M=A[1],k=(0,a.useState)(20),W=s()(k,2),se=W[0],C=W[1],x=(0,a.useState)(0),L=s()(x,2),q=L[0],U=L[1],g=function(){var y=b()(r()().mark(function B(){var K,Ce,de,z,O,Y,xe,Je,at,bt;return r()().wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:return K={page_size:se,page_num:R},De&&(K.user_group_id=De),ae&&(K.user_name=ae),he(!0),Me.prev=4,Me.next=7,(0,lt.lE)(K);case 7:Ce=Me.sent,console.log("res======",Ce),de=Ce||{},z=de.code,O=de.data,Y=O===void 0?{}:O,xe=Y||{},Je=xe.data,at=xe.total,bt=at===void 0?0:at,z===$.Bq?(le(Je||[]),U(bt),he(!1)):(m.ZP.error(Ce.message||"\u83B7\u53D6\u7528\u6237\u5217\u8868\u5931\u8D25"),he(!1)),Me.next=17;break;case 14:Me.prev=14,Me.t0=Me.catch(4),m.ZP.error("\u83B7\u53D6\u7528\u6237\u5217\u8868\u5931\u8D25");case 17:case"end":return Me.stop()}},B,null,[[4,14]])}));return function(){return y.apply(this,arguments)}}();(0,a.useEffect)(function(){g()},[De,ae]);var d=[{title:"\u5E8F\u53F7",dataIndex:"order",key:"order",width:80,align:"center",render:function(B,K,Ce){return(0,e.jsx)("span",{children:Ce+1})}},{title:"\u7528\u6237\u540D",dataIndex:"user_name",key:"user_name",align:"center",render:function(B){return(0,e.jsx)(H.Z,{children:B||"--"})}}],j=function(B){je(B),M(1)},p=function(B,K){M(B),C(K)},V=function(B,K){M(1),C(K)},ge=function(B){ye(B)};return(0,e.jsxs)("div",{className:Tt.content_wrap,children:[(0,e.jsxs)("div",{className:Tt.search_wrap,children:[(0,e.jsx)(Ct.Z,{style:{width:"300px"},showSearch:!0,allowClear:!0,treeDefaultExpandAll:!0,placeholder:"\u8BF7\u9009\u62E9\u7528\u6237\u5206\u7EC4",treeData:T,onChange:ge,fieldNames:{label:"name",value:"id",children:"children"}}),(0,e.jsx)(Ee.Z.Search,{placeholder:"\u7528\u6237\u540D",onSearch:j,enterButton:!0,allowClear:!0,style:{width:"200px",marginLeft:"10px"}})]}),(0,e.jsx)(Ve.Z,{columns:d,dataSource:Z,loading:Se,rowKey:"id",rowSelection:{selectedRowKeys:Q,preserveSelectedRowKeys:!0,onChange:n},pagination:{current:R,pageSize:se,total:q,simple:!0,onChange:p,onShowSizeChange:V,showSizeChanger:!1,showQuickJumper:!1},scroll:{x:"max-content",y:300}})]})},Lt=Ot,Ut=function(l){var T=l.placement,n=T===void 0?"bottomLeft":T,Q=l.orgTreeData,ne=l.value,te=l.onChange,Z=(0,a.useState)(!1),le=s()(Z,2),ie=le[0],ve=le[1],Se=(0,a.useState)([]),he=s()(Se,2),ue=he[0],X=he[1],De=(0,a.useState)([]),ye=s()(De,2),oe=ye[0],ce=ye[1],ae=(0,a.useState)([]),je=s()(ae,2),J=je[0],A=je[1],R=(0,a.useState)([]),M=s()(R,2),k=M[0],W=M[1],se=(0,a.useState)([]),C=s()(se,2),x=C[0],L=C[1],q=(0,a.useState)([]),U=s()(q,2),g=U[0],d=U[1];(0,a.useEffect)(function(){var de=[],z=[],O=[],Y=[];ne&&ne.length>0&&(ne.forEach(function(xe){xe.type===1?(de.push(xe),O.push(xe.id)):(z.push(xe),Y.push(xe.id))}),X(ne),ce(O),A(de),W(Y),L(z))},[ne]);var j=function(z,O){W(z),L(O)},p=function(){ve(!1),ce([]),A([]),W([]),L([])},V=function(){var z=[];(J||[]).forEach(function(O){z.push({id:O.id,name:O.user_name,type:1,table_id:"user_".concat(O.id)})}),(x||[]).forEach(function(O){z.push({id:O.id,name:O.name,type:2,table_id:"group_".concat(O.id)})}),X(z),te&&te(z),p()},ge=function(z,O){ce(z),A(O)},y=function(z){d(z)},B=function(z){if(z){var O=z||{},Y=O.table_id,xe=ue.filter(function(at){return at.table_id!==Y});X(xe),d([]),te&&te(xe)}else{var Je=ue.filter(function(at){return!g.includes(at.table_id)});X(Je),d([]),te&&te(Je)}},K=function(){var z=[{title:"\u5E8F\u53F7",dataIndex:"order",key:"order",width:80,align:"center",render:function(Y,xe,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)(H.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,xe){return(0,e.jsx)(F.Z,{title:"",placement:"bottom",description:"\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664?",onConfirm:function(){return B(xe)},okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",children:(0,e.jsx)(S.ZP,{type:"link",children:"\u5220\u9664"})})}}];return z},Ce=(0,e.jsxs)("div",{style:{width:"600px"},children:[(0,e.jsx)(kt.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)(yt.Z,{children:[(0,e.jsx)(yt.Z.TabPane,{tab:"\u5206\u7EC4",children:(0,e.jsx)($e.Z,{checkable:!0,multiple:!0,checkStrictly:!0,treeData:Q,titleField:"name",keyField:"id",childrenField:"children",defaultExpandAll:!0,onCheck:j,checkedKeys:k,icon:(0,e.jsx)(Mt.Z,{style:{fontSize:"15px"}})})},"1"),(0,e.jsx)(yt.Z.TabPane,{tab:"\u7528\u6237",children:(0,e.jsx)(Lt,{treeData:Q,onUserTableSelect:ge,selectedRowKeys:oe})},"2")]}),(0,e.jsxs)("div",{style:{borderTop:"1px solid #e8e8e8",marginTop:"10px",paddingTop:"10px",display:"flex",justifyContent:"center"},children:[(0,e.jsx)(S.ZP,{onClick:V,style:{marginRight:"30px"},type:"primary",children:"\u786E\u5B9A"}),(0,e.jsx)(S.ZP,{onClick:p,children:"\u53D6\u6D88"})]})]});return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(et.Z,{style:{marginBottom:"10px"},children:[(0,e.jsx)(Ae.Z,{content:Ce,title:"",trigger:"click",open:ie,onOpenChange:ve,placement:n,children:(0,e.jsx)(S.ZP,{children:"\u6DFB\u52A0"})}),(0,e.jsx)(F.Z,{title:"",placement:"bottomRight",description:"\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664?",onConfirm:function(){return B()},disabled:g.length===0,okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",children:(0,e.jsx)(S.ZP,{disabled:g.length===0,children:"\u5220\u9664"})})]}),(0,e.jsx)(St,{dataSource:ue,onDelete:B,scrollY:400,rowKey:"table_id",pagination:!1,columns:K(),rowSelection:{bindTableKeys:g,onChange:y}})]})},Kt=Ut,zt={model_content:"model_content___DaYce"},Ye=function(l){var T=l.onCancel,n=l.onOk,Q=l.confirmLoading,ne=Q===void 0?!1:Q,te=l.dataDetial,Z=te||{},le=Z.recordData,ie=Z.visible,ve=le||{},Se=ve.device_id,he=ve.device_group_id,ue=(0,a.useState)([]),X=s()(ue,2),De=X[0],ye=X[1],oe=(0,a.useState)([]),ce=s()(oe,2),ae=ce[0],je=ce[1],J=E.Z.useForm(),A=s()(J,1),R=A[0],M=function(){var se=b()(r()().mark(function C(){var x,L,q,U,g,d,j,p,V;return r()().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return x={type:1},y.prev=1,y.next=4,(0,lt.ib)(x);case 4:L=y.sent,console.log("result=====",L),q=L||{},U=q.code,g=q.data,d=g===void 0?[]:g,U===$.Bq?d.length>0&&(j=d[0]||{},p=j.children,V=p===void 0?[]:p,ye(V)):m.ZP.error(L.message||"\u83B7\u53D6\u7EC8\u7AEF\u5206\u7EC4\u5931\u8D25"),y.next=13;break;case 10:y.prev=10,y.t0=y.catch(1),m.ZP.error("\u83B7\u53D6\u7EC8\u7AEF\u5206\u7EC4\u5931\u8D25");case 13:case"end":return y.stop()}},C,null,[[1,10]])}));return function(){return se.apply(this,arguments)}}();(0,a.useEffect)(function(){M()},[ie]),(0,a.useEffect)(function(){if(Se){var se={device_id:Se};w(se).then(function(C){var x=C||{},L=x.code,q=x.data,U=q===void 0?[]:q;if(L===$.Bq&&U&&U.length>0){var g=[];U.map(function(j){var p=j||{},V=p.type,ge=p.user_id,y=p.user_name,B=p.user_group_id,K=p.user_group_name,Ce=G()({},j);delete Ce.id,V===1?g.push({table_id:"user_".concat(ge),id:ge,name:y,user_name:y,type:V}):g.push({table_id:"group_".concat(B),id:B,name:K,type:V})}),je(U);var d={user_list:g};R.setFieldsValue(d)}})}},[ie,R,le]);var k=function(C){Ue(C).then(function(x){var L=x||{},q=L.code;q===$.Bq?(m.ZP.success("\u7ED1\u5B9A\u6210\u529F"),n()):m.ZP.error("\u7ED1\u5B9A\u5931\u8D25")}).catch(function(){})},W=function(){var se=b()(r()().mark(function C(){var x,L,q,U,g,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:x=p.sent,L=x||{},q=L.user_list,U=q===void 0?[]:q,g=[],U&&U.length>0&&(U.forEach(function(V){var ge=V||{},y=ge.type,B=ge.id;if(y===1){var K={device_id:Se,device_group_id:he,type:y,user_id:B},Ce=ae.filter(function(O){return O.user_id===V.id&&O.type===1});Ce&&Ce.length===1&&(K.id=Ce[0].id),g.push(K)}else{var de={device_id:Se,device_group_id:he,type:y,user_group_id:B},z=ae.filter(function(O){return O.user_group_id===V.id&&O.type===2});z&&z.length===1&&(de.id=z[0].id),g.push(de)}}),d={data:g},k(d)),p.next=12;break;case 9:p.prev=9,p.t0=p.catch(0),m.ZP.error("\u8BF7\u68C0\u67E5\u8868\u5355\u5B57\u6BB5");case 12:case"end":return p.stop()}},C,null,[[0,9]])}));return function(){return se.apply(this,arguments)}}();return(0,e.jsx)(rt.Z,{title:"\u7ED1\u5B9A\u7528\u6237",open:ie,onCancel:T,onOk:W,confirmLoading:ne,width:1200,maskClosable:!1,centered:!0,destroyOnHidden:!0,cancelText:"\u53D6\u6D88",okText:"\u786E\u5B9A",footer:null,children:(0,e.jsx)("div",{className:zt.model_content,children:(0,e.jsxs)(E.Z,{form:R,onFinish:W,labelCol:{span:4},wrapperCol:{span:19},layout:"horizontal",style:{paddingTop:"20px",paddingBottom:"20px"},children:[(0,e.jsx)(E.Z.Item,{name:"user_list",label:"\u9009\u62E9\u7528\u6237",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u7ED1\u5B9A\u7528\u6237"}],children:(0,e.jsx)(Kt,{orgTreeData:De})}),(0,e.jsxs)(E.Z.Item,{label:null,children:[(0,e.jsx)(S.ZP,{type:"primary",htmlType:"submit",style:{marginRight:"20px"},children:"\u786E\u5B9A"}),(0,e.jsx)(S.ZP,{onClick:T,children:"\u53D6\u6D88"})]})]})})})},it=Ye,It=t(74656),Qt=function(l){var T=l.orgTreeData,n=l.onCancel,Q=l.onOk,ne=l.confirmLoading,te=ne===void 0?!1:ne,Z=l.currentDeviceInfo,le=Z||{},ie=le.recordData,ve=le.visible,Se=le.selectedOrg,he=ie||{},ue=he.id,X=he.device_name,De=E.Z.useForm(),ye=s()(De,1),oe=ye[0];(0,a.useEffect)(function(){var je={id:ue};pe(je).then(function(J){console.log("res=======",J);var A=J||{},R=A.code,M=A.data;if(R===$.Bq){var k=G()({},M);oe.setFieldsValue(k)}})},[ve,oe,ie,Se]);var ce=function(){var je=b()(r()().mark(function J(){var A,R,M,k,W;return r()().wrap(function(C){for(;;)switch(C.prev=C.next){case 0:return C.prev=0,C.next=3,oe.validateFields();case 3:return A=C.sent,R=G()(G()({},A),{},{id:ue}),C.next=7,ze(R);case 7:M=C.sent,k=M||{},W=k.code,W===$.Bq&&(m.ZP.success("\u4FDD\u5B58\u6210\u529F"),Q&&Q()),C.next=15;break;case 12:C.prev=12,C.t0=C.catch(0),m.ZP.error("\u4FDD\u5B58\u5931\u8D25");case 15:case"end":return C.stop()}},J,null,[[0,12]])}));return function(){return je.apply(this,arguments)}}(),ae={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)(rt.Z,{title:ue?"".concat(X,"\u7EC8\u7AEF\u4FE1\u606F\u4FEE\u6539"):"\u65B0\u589E\u7EC8\u7AEF",open:ve,onCancel:n,onOk:ce,confirmLoading:te,width:600,maskClosable:!1,centered:!0,destroyOnHidden:!0,cancelText:"\u53D6\u6D88",okText:"\u786E\u5B9A",footer:null,children:(0,e.jsxs)(E.Z,{form:oe,onFinish:ce,labelCol:{span:5},wrapperCol:{span:18},layout:"horizontal",style:{paddingTop:"20px",paddingBottom:"20px"},validateMessages:ae,children:[(0,e.jsx)(E.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)(Ee.Z,{})}),(0,e.jsx)(E.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)(Ee.Z,{})}),(0,e.jsx)(E.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)(Ct.Z,{showSearch:!0,allowClear:!1,treeDefaultExpandAll:!0,placeholder:"\u8BF7\u9009\u62E9\u7EC8\u7AEF\u5206\u7EC4",treeData:T,fieldNames:{label:"name",value:"id",children:"children"}})}),(0,e.jsx)(E.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)(It.Z,{options:$.Jk})}),(0,e.jsx)(E.Z.Item,{name:"model",label:"\u578B\u53F7",rules:[{required:!1,message:"\u8BF7\u8F93\u5165\u663E\u793A\u540D\u79F0"}],children:(0,e.jsx)(Ee.Z,{})}),(0,e.jsx)(E.Z.Item,{name:"ip_addr",label:"IP\u5730\u5740",rules:[{required:!1,message:"\u8BF7\u8F93\u5165IP\u5730\u5740"}],children:(0,e.jsx)(Ee.Z,{placeholder:"\u8BF7\u8F93\u5165IP\u5730\u5740"})}),(0,e.jsx)(E.Z.Item,{name:"mac_addr",label:"MAC\u5730\u5740",rules:[{required:!1,message:"\u8BF7\u8F93\u5165MAC\u5730\u5740"}],children:(0,e.jsx)(Ee.Z,{})}),(0,e.jsx)(E.Z.Item,{name:"description",label:"\u63CF\u8FF0",rules:[{required:!1,message:"\u8BF7\u8F93\u5165\u7EC8\u7AEF\u578B\u53F7"}],children:(0,e.jsx)(Ee.Z.TextArea,{rows:4})}),(0,e.jsxs)(E.Z.Item,{label:null,children:[(0,e.jsx)(S.ZP,{type:"primary",htmlType:"submit",style:{marginRight:"20px"},children:"\u786E\u5B9A"}),(0,e.jsx)(S.ZP,{onClick:n,children:"\u53D6\u6D88"})]})]})})},Xt=Qt,qt=function(){var l=(0,a.useState)([]),T=s()(l,2),n=T[0],Q=T[1],ne=(0,a.useState)(),te=s()(ne,2),Z=te[0],le=te[1],ie=(0,a.useState)([]),ve=s()(ie,2),Se=ve[0],he=ve[1],ue=(0,a.useState)(!1),X=s()(ue,2),De=X[0],ye=X[1],oe=(0,a.useState)(""),ce=s()(oe,2),ae=ce[0],je=ce[1],J=(0,a.useState)([]),A=s()(J,2),R=A[0],M=A[1],k=(0,a.useState)(""),W=s()(k,2),se=W[0],C=W[1],x=(0,a.useState)(!1),L=s()(x,2),q=L[0],U=L[1],g=(0,a.useState)(1),d=s()(g,2),j=d[0],p=d[1],V=(0,a.useState)(20),ge=s()(V,2),y=ge[0],B=ge[1],K=(0,a.useState)(0),Ce=s()(K,2),de=Ce[0],z=Ce[1],O=(0,a.useState)(!1),Y=s()(O,2),xe=Y[0],Je=Y[1],at=(0,a.useState)({visible:!1}),bt=s()(at,2),Nt=bt[0],Me=bt[1],tr=(0,a.useState)({visible:!1}),Ht=s()(tr,2),Vt=Ht[0],Wt=Ht[1],rr=(0,a.useState)({visible:!1}),Yt=s()(rr,2),Jt=Yt[0],Gt=Yt[1];(0,a.useEffect)(function(){Zt()},[]);var nr=function f(i,N){return N?i.reduce(function(ee,fe){var Fe,We=(Fe=fe.name)===null||Fe===void 0?void 0:Fe.toLowerCase().includes(N.toLowerCase());if(We)ee.push(G()({},fe));else if(fe.children&&fe.children.length>0){var re=f(fe.children,N);re.length>0&&ee.push(G()(G()({},fe),{},{children:re}))}return ee},[]):i},ar=nr(n,se);(0,a.useEffect)(function(){pt()},[ae,Z,j,y]);var Zt=function(){var f=b()(r()().mark(function i(){var N,ee,fe,Fe,We,re,ut,ot,we;return r()().wrap(function(_e){for(;;)switch(_e.prev=_e.next){case 0:return U(!0),N={type:2},_e.prev=2,_e.next=5,(0,lt.ib)(N);case 5:ee=_e.sent,console.log("result=====",ee),fe=ee||{},Fe=fe.code,We=fe.data,re=We===void 0?[]:We,Fe===$.Bq?(re.length>0&&(ut=re[0]||{},ot=ut.children,we=ot===void 0?[]:ot,Q(we)),U(!1)):(U(!1),m.ZP.error(ee.message||"\u83B7\u53D6\u7EC8\u7AEF\u5206\u7EC4\u5931\u8D25")),_e.next=15;break;case 11:_e.prev=11,_e.t0=_e.catch(2),m.ZP.error("\u83B7\u53D6\u7EC8\u7AEF\u5206\u7EC4\u5931\u8D25"),U(!1);case 15:case"end":return _e.stop()}},i,null,[[2,11]])}));return function(){return f.apply(this,arguments)}}(),pt=function(){var f=b()(r()().mark(function i(){var N,ee,fe,Fe,We,re,ut,ot,we;return r()().wrap(function(_e){for(;;)switch(_e.prev=_e.next){case 0:return N={page_size:y,page_num:j},Z&&(N.device_group_id=Z),ae&&(N.device_name=ae),ye(!0),_e.prev=4,_e.next=7,ke(N);case 7:ee=_e.sent,console.log("result=====",ee),fe=ee||{},Fe=fe.code,We=fe.data,re=We||{},ut=re.data,ot=re.total,we=ot===void 0?0:ot,Fe===$.Bq?(he(ut),z(we),ye(!1)):(m.ZP.error(ee.message||"\u83B7\u53D6\u7EC8\u7AEF\u5217\u8868\u5931\u8D25"),ye(!1)),_e.next=18;break;case 14:_e.prev=14,_e.t0=_e.catch(4),m.ZP.error("\u83B7\u53D6\u7EC8\u7AEF\u5217\u8868\u5931\u8D25"),ye(!1);case 18:case"end":return _e.stop()}},i,null,[[4,14]])}));return function(){return f.apply(this,arguments)}}(),sr=function(){var f=b()(r()().mark(function i(N){var ee,fe,Fe,We,re,ut;return r()().wrap(function(we){for(;;)switch(we.prev=we.next){case 0:return we.prev=0,ee=N||{},fe=ee.id,Fe={id:fe||R},we.next=5,Xe(Fe);case 5:We=we.sent,re=We||{},ut=re.code,ut===$.Bq&&(m.ZP.success("\u7EC8\u7AEF\u5220\u9664\u6210\u529F"),M([]),pt()),we.next=13;break;case 10:we.prev=10,we.t0=we.catch(0),m.ZP.error("\u7EC8\u7AEF\u5220\u9664\u5931\u8D25");case 13:case"end":return we.stop()}},i,null,[[0,10]])}));return function(N){return f.apply(this,arguments)}}(),lr=function(i){Me({recordData:G()({},i),visible:!0})},ir=[{title:"\u5E8F\u53F7",dataIndex:"order",key:"order",width:60,align:"center",render:function(i,N,ee){return(0,e.jsx)("span",{children:ee+1})}},{title:"\u7EC8\u7AEF\u540D\u79F0",dataIndex:"device_name",key:"device_name",width:250,ellipsis:!0,align:"center",render:function(i){return(0,e.jsx)(H.Z,{title:i||"",children:i||"--"})}},{title:"\u5E8F\u5217\u53F7",dataIndex:"device_id",key:"device_id",width:250,align:"center",ellipsis:!0,render:function(i){return(0,e.jsx)(H.Z,{title:i||"",children:i||"--"})}},{title:"\u7EC8\u7AEF\u5206\u7EC4",dataIndex:"device_group_name",key:"device_group_name",width:200,align:"center",ellipsis:!0,render:function(i){return(0,e.jsx)("div",{children:(0,e.jsx)(H.Z,{title:i||"",children:i||"--"})})}},{title:"\u7C7B\u578B",dataIndex:"device_type",key:"device_type",width:150,align:"center",ellipsis:!0,render:function(i){var N=i;return(0,e.jsx)(H.Z,{title:$.Wf[N]||"--",children:$.Wf[N]||"--"})}},{title:"\u578B\u53F7",dataIndex:"model",key:"model",width:150,align:"center",ellipsis:!0,render:function(i){return(0,e.jsx)("div",{children:(0,e.jsx)(H.Z,{title:i||"",children:i||"--"})})}},{title:"IP\u5730\u5740",dataIndex:"ip_addr",key:"ip_addr",width:200,ellipsis:!0,align:"center",render:function(i){return(0,e.jsx)("div",{children:(0,e.jsx)(H.Z,{title:i||"",children:i||"--"})})}},{title:"MAC\u5730\u5740",dataIndex:"mac_addr",key:"mac_addr",ellipsis:!0,align:"center",width:200,render:function(i){return(0,e.jsx)("div",{children:(0,e.jsx)(H.Z,{title:i||"",children:i||"--"})})}},{title:"\u5907\u6CE8",dataIndex:"description",key:"description",ellipsis:!0,align:"center",width:200,render:function(i){return(0,e.jsx)("div",{children:(0,e.jsx)(H.Z,{title:i||"",children:i||"--"})})}},{title:"\u64CD\u4F5C",key:"actions",align:"center",width:150,fixed:"right",render:function(i,N){return(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,e.jsx)(S.ZP,{type:"link",onClick:function(){return lr(N)},children:"\u7F16\u8F91"}),(0,e.jsx)(Ae.Z,{placement:"bottomRight",content:(0,e.jsxs)("div",{children:[(0,e.jsx)(F.Z,{title:"",description:"\u5220\u9664\u64CD\u4F5C\u4E0D\u53EF\u9006\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664?",onConfirm:function(){return sr(N)},okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",children:(0,e.jsx)(S.ZP,{type:"link",children:"\u5220\u9664"})}),(0,e.jsx)("div",{children:(0,e.jsx)(S.ZP,{type:"link",onClick:function(){Wt({recordData:N,visible:!0})},children:"\u7ED1\u5B9A\u7528\u6237"})}),(0,e.jsx)("div",{children:(0,e.jsx)(S.ZP,{type:"link",onClick:function(){Gt({recordData:N,visible:!0})},children:"\u7ED1\u5B9A\u955C\u50CF"})})]}),children:(0,e.jsxs)("a",{onClick:function(fe){return fe.preventDefault()},children:["\u66F4\u591A",(0,e.jsx)(ht.Z,{style:{fontSize:"0.7rem"}})]})})]})}}],ur=function(i){i.length>0&&(le(i[0]),p(1))},or=function(i,N){p(i),B(N)},cr=function(i,N){p(1),B(N)},gr=function(i){console.log("selectedRowKeys changed: ",i),M(i)},dr=function(){var f=b()(r()().mark(function i(){var N,ee,fe,Fe;return r()().wrap(function(re){for(;;)switch(re.prev=re.next){case 0:if(!Z){re.next=13;break}return re.prev=1,N={id:Z},re.next=5,(0,lt.FU)(N);case 5:ee=re.sent,fe=ee||{},Fe=fe.code,Fe===$.Bq&&(m.ZP.success("\u5206\u7EC4\u5220\u9664\u6210\u529F"),Zt()),re.next=13;break;case 10:re.prev=10,re.t0=re.catch(1),m.ZP.error("\u5206\u7EC4\u5220\u9664\u5931\u8D25");case 13:case"end":return re.stop()}},i,null,[[1,10]])}));return function(){return f.apply(this,arguments)}}(),fr=function(){Zt()},pr=function(){Me({recordData:{},visible:!1}),pt()},mr=function(){Wt({recordData:{},visible:!1}),pt()},vr=function(){Gt({recordData:{},visible:!1}),pt()};return(0,e.jsxs)("div",{className:Re.user_content,children:[(0,e.jsxs)("div",{className:Re.left_content,children:[(0,e.jsxs)("div",{className:Re.search,children:[(0,e.jsxs)("div",{style:{paddingBottom:"5px"},children:[(0,e.jsx)(S.ZP,{type:"text",style:{marginRight:"8px",fontSize:"16px"},icon:(0,e.jsx)(Ne.Z,{}),onClick:function(){return Zt()},title:"\u5237\u65B0",loading:q}),(0,e.jsx)(S.ZP,{type:"text",style:{marginRight:"8px",fontSize:"16px"},icon:(0,e.jsx)(gt.Z,{}),onClick:function(){return Je(!0)}}),(0,e.jsx)(F.Z,{title:"",description:"\u5220\u9664\u64CD\u4F5C\u4E0D\u53EF\u9006\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664?",onConfirm:function(){return dr()},okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",disabled:!Z,children:(0,e.jsx)(S.ZP,{type:"text",style:{fontSize:"16px"},icon:(0,e.jsx)(Dt.Z,{}),disabled:!Z})})]}),(0,e.jsx)(Ee.Z.Search,{placeholder:"\u8BF7\u8F93\u5165\u5206\u7EC4\u540D",style:{marginBottom:6},onSearch:function(i){return C(i)},onChange:function(i){return C(i.target.value)}})]}),(0,e.jsx)("div",{className:Re.tree_box,children:(0,e.jsx)(tt.Z,{spinning:q,delay:100,children:(0,e.jsx)($e.Z,{treeData:ar,titleField:"name",keyField:"id",childrenField:"children",defaultExpandAll:!0,onSelect:ur,showIcon:!0,selectedKeys:Z?[Z]:[],icon:(0,e.jsx)(I,{style:{fontSize:"15px"}})})})})]}),(0,e.jsx)("div",{className:Re.right_content,children:(0,e.jsxs)("div",{className:Re.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)(Ee.Z.Search,{placeholder:"\u7EC8\u7AEF\u540D\u79F0",value:ae,onChange:function(i){return je(i.target.value)},style:{width:300},onSearch:function(i){console.log("Search user:",i),p(1)}}),(0,e.jsx)(S.ZP,{style:{marginRight:"8px",marginLeft:"8px"},onClick:pt,icon:(0,e.jsx)(Ne.Z,{}),title:"\u5237\u65B0",loading:De})]})})]}),(0,e.jsx)("div",{className:Re.teble_box,children:(0,e.jsx)("div",{className:"images-list-table",children:(0,e.jsx)(Ve.Z,{columns:ir,dataSource:Se,loading:De,rowKey:"id",pagination:{current:j,pageSize:y,total:de,onChange:or,onShowSizeChange:cr,showSizeChanger:!0,showQuickJumper:!0,pageSizeOptions:["10","20","50","100"],showTotal:function(i){return"\u5171".concat(i,"\u6761\u6570\u636E")}},scroll:{x:"max-content",y:"max-content"},style:{height:"100%",display:"flex",flexDirection:"column"}})})})]})}),xe&&(0,e.jsx)(Ie.Z,{visible:xe,type:2,title:"\u65B0\u589E\u7EC8\u7AEF\u5206\u7EC4",onCancel:function(){Je(!1)},selectedOrg:Z,onOk:function(){fr()},orgTreeData:n}),Nt.visible&&(0,e.jsx)(Xt,{selectedOrg:Z,orgTreeData:n,currentDeviceInfo:Nt,onCancel:function(){Me({recordData:{},visible:!1})},onOk:function(){pr()}}),Vt.visible&&(0,e.jsx)(it,{dataDetial:Vt,onCancel:function(){Wt({recordData:{},visible:!1})},onOk:function(){mr()}}),Jt.visible&&(0,e.jsx)(Rt,{dataDetial:Jt,onCancel:function(){Gt({recordData:{},visible:!1})},onOk:function(){vr()}})]})},er=qt},86231:function(mt,Ke,t){var P=t(15009),r=t.n(P),Qe=t(99289),b=t.n(Qe),Pe=t(5574),G=t.n(Pe),Ge=t(16711),s=t(39231),$=t(86587),$e=t(68872),Ie=t(2975),be=t(31800),Te=t(56558),ke=t(77683),Le=t(67294),pe=t(85893),Ze=function(Oe){var ze=Oe.title,He=ze===void 0?"\u65B0\u589E\u5206\u7EC4":ze,Ue=Oe.visible,v=Oe.onCancel,w=Oe.onOk,me=Oe.orgTreeData,c=Oe.selectedOrg,ct=Oe.type,dt=(0,Le.useState)(!1),st=G()(dt,2),vt=st[0],qe=st[1],lt=$.Z.useForm(),ht=G()(lt,1),Ne=ht[0];(0,Le.useEffect)(function(){if(c){var a={parent_id:c};Ne.setFieldsValue(a)}},[Ue,Ne,c]);var gt=function(){Ne.submit()},Dt=function(){Ne.resetFields(),v()},_t=function(){var a=b()(r()().mark(function ft(){var u,o,h,_,I,m,H,S;return r()().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return F.next=2,Ne.validateFields();case 2:return u=F.sent,qe(!0),F.prev=4,console.log("values=====",u),o=u||{},h=o.name,_=o.parent_id,I={name:h,type:ct,parent_id:_},F.next=10,(0,s.EJ)(I);case 10:m=F.sent,qe(!1),H=m||{},S=H.code,S===Ge.Bq&&($e.ZP.success("\u6DFB\u52A0\u6210\u529F"),Ne.resetFields(),v(),w()),F.next=20;break;case 16:F.prev=16,F.t0=F.catch(4),qe(!1),$e.ZP.error("\u521B\u5EFA\u7528\u6237\u5206\u7EC4\u5931\u8D25");case 20:case"end":return F.stop()}},ft,null,[[4,16]])}));return function(){return a.apply(this,arguments)}}();return(0,pe.jsx)(Ie.Z,{title:He,open:Ue,onOk:gt,onCancel:Dt,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",centered:!0,destroyOnHidden:!0,width:600,footer:null,children:(0,pe.jsx)("div",{style:{height:"300px"},children:(0,pe.jsxs)($.Z,{form:Ne,labelCol:{span:5},wrapperCol:{span:18},layout:"horizontal",onFinish:_t,style:{paddingTop:"20px",paddingBottom:"20px"},children:[(0,pe.jsx)($.Z.Item,{name:"name",label:"\u5206\u7EC4\u540D",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5206\u7EC4\u540D!"}],children:(0,pe.jsx)(be.Z,{placeholder:"\u8BF7\u8F93\u5165\u5206\u7EC4\u540D"})}),(0,pe.jsx)($.Z.Item,{name:"parent_id",label:"\u7236\u5206\u7EC4\u540D",children:(0,pe.jsx)(Te.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,pe.jsxs)($.Z.Item,{label:null,children:[(0,pe.jsx)(ke.ZP,{type:"primary",htmlType:"submit",style:{marginRight:"20px"},loading:vt,children:"\u786E\u5B9A"}),(0,pe.jsx)(ke.ZP,{onClick:v,children:"\u53D6\u6D88"})]})]})})})};Ke.Z=Ze},39231:function(mt,Ke,t){t.d(Ke,{EJ:function(){return Ge},FU:function(){return Ie},GA:function(){return Oe},cn:function(){return Le},h8:function(){return He},ib:function(){return $},lE:function(){return Te},uz:function(){return Ze}});var P=t(15009),r=t.n(P),Qe=t(99289),b=t.n(Qe),Pe=t(6510),G="/api/nex/v1";function Ge(v){return s.apply(this,arguments)}function s(){return s=b()(r()().mark(function v(w){return r()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.abrupt("return",(0,Pe.request)("".concat(G,"/user/device/group/add"),{method:"POST",data:w}));case 1:case"end":return c.stop()}},v)})),s.apply(this,arguments)}function $(v){return $e.apply(this,arguments)}function $e(){return $e=b()(r()().mark(function v(w){return r()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.abrupt("return",(0,Pe.request)("".concat(G,"/user/device/group/query"),{method:"POST",data:w}));case 1:case"end":return c.stop()}},v)})),$e.apply(this,arguments)}function Ie(v){return be.apply(this,arguments)}function be(){return be=b()(r()().mark(function v(w){return r()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.abrupt("return",(0,Pe.request)("".concat(G,"/user/device/group/delete"),{method:"POST",data:w}));case 1:case"end":return c.stop()}},v)})),be.apply(this,arguments)}function Te(v){return ke.apply(this,arguments)}function ke(){return ke=b()(r()().mark(function v(w){return r()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.abrupt("return",(0,Pe.request)("".concat(G,"/user/select/page"),{method:"POST",data:w}));case 1:case"end":return c.stop()}},v)})),ke.apply(this,arguments)}function Le(v){return pe.apply(this,arguments)}function pe(){return pe=b()(r()().mark(function v(w){return r()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.abrupt("return",(0,Pe.request)("".concat(G,"/user/add"),{method:"POST",data:w}));case 1:case"end":return c.stop()}},v)})),pe.apply(this,arguments)}function Ze(v){return Xe.apply(this,arguments)}function Xe(){return Xe=b()(r()().mark(function v(w){return r()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.abrupt("return",(0,Pe.request)("".concat(G,"/user/update"),{method:"POST",data:w}));case 1:case"end":return c.stop()}},v)})),Xe.apply(this,arguments)}function Oe(v){return ze.apply(this,arguments)}function ze(){return ze=b()(r()().mark(function v(w){return r()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.abrupt("return",(0,Pe.request)("".concat(G,"/user/query"),{method:"POST",data:w}));case 1:case"end":return c.stop()}},v)})),ze.apply(this,arguments)}function He(v){return Ue.apply(this,arguments)}function Ue(){return Ue=b()(r()().mark(function v(w){return r()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.abrupt("return",(0,Pe.request)("".concat(G,"/user/delete"),{method:"POST",data:w}));case 1:case"end":return c.stop()}},v)})),Ue.apply(this,arguments)}},40056:function(mt,Ke,t){t.d(Ke,{Z:function(){return ft}});var P=t(67294),r=t(89739),Qe=t(4340),b=t(97937),Pe=t(21640),G=t(78860),Ge=t(93967),s=t.n(Ge),$=t(29372),$e=t(64217),Ie=t(42550),be=t(96159),Te=t(53124),ke=t(11568),Le=t(14747),pe=t(83559);const Ze=(u,o,h,_,I)=>({background:u,border:`${(0,ke.bf)(_.lineWidth)} ${_.lineType} ${o}`,[`${I}-icon`]:{color:h}}),Xe=u=>{const{componentCls:o,motionDurationSlow:h,marginXS:_,marginSM:I,fontSize:m,fontSizeLG:H,lineHeight:S,borderRadiusLG:Ae,motionEaseInOutCirc:F,withDescriptionIconSize:Ee,colorText:tt,colorTextHeading:Ve,withDescriptionPadding:Re,defaultPadding:E}=u;return{[o]:Object.assign(Object.assign({},(0,Le.Wf)(u)),{position:"relative",display:"flex",alignItems:"center",padding:E,wordWrap:"break-word",borderRadius:Ae,[`&${o}-rtl`]:{direction:"rtl"},[`${o}-content`]:{flex:1,minWidth:0},[`${o}-icon`]:{marginInlineEnd:_,lineHeight:0},"&-description":{display:"none",fontSize:m,lineHeight:S},"&-message":{color:Ve},[`&${o}-motion-leave`]:{overflow:"hidden",opacity:1,transition:`max-height ${h} ${F}, opacity ${h} ${F},
padding-top ${h} ${F}, padding-bottom ${h} ${F},
margin-bottom ${h} ${F}`},[`&${o}-motion-leave-active`]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0}}),[`${o}-with-description`]:{alignItems:"flex-start",padding:Re,[`${o}-icon`]:{marginInlineEnd:I,fontSize:Ee,lineHeight:0},[`${o}-message`]:{display:"block",marginBottom:_,color:Ve,fontSize:H},[`${o}-description`]:{display:"block",color:tt}},[`${o}-banner`]:{marginBottom:0,border:"0 !important",borderRadius:0}}},Oe=u=>{const{componentCls:o,colorSuccess:h,colorSuccessBorder:_,colorSuccessBg:I,colorWarning:m,colorWarningBorder:H,colorWarningBg:S,colorError:Ae,colorErrorBorder:F,colorErrorBg:Ee,colorInfo:tt,colorInfoBorder:Ve,colorInfoBg:Re}=u;return{[o]:{"&-success":Ze(I,_,h,u,o),"&-info":Ze(Re,Ve,tt,u,o),"&-warning":Ze(S,H,m,u,o),"&-error":Object.assign(Object.assign({},Ze(Ee,F,Ae,u,o)),{[`${o}-description > pre`]:{margin:0,padding:0}})}}},ze=u=>{const{componentCls:o,iconCls:h,motionDurationMid:_,marginXS:I,fontSizeIcon:m,colorIcon:H,colorIconHover:S}=u;return{[o]:{"&-action":{marginInlineStart:I},[`${o}-close-icon`]:{marginInlineStart:I,padding:0,overflow:"hidden",fontSize:m,lineHeight:(0,ke.bf)(m),backgroundColor:"transparent",border:"none",outline:"none",cursor:"pointer",[`${h}-close`]:{color:H,transition:`color ${_}`,"&:hover":{color:S}}},"&-close-text":{color:H,transition:`color ${_}`,"&:hover":{color:S}}}}},He=u=>({withDescriptionIconSize:u.fontSizeHeading3,defaultPadding:`${u.paddingContentVerticalSM}px 12px`,withDescriptionPadding:`${u.paddingMD}px ${u.paddingContentHorizontalLG}px`});var Ue=(0,pe.I$)("Alert",u=>[Xe(u),Oe(u),ze(u)],He),v=function(u,o){var h={};for(var _ in u)Object.prototype.hasOwnProperty.call(u,_)&&o.indexOf(_)<0&&(h[_]=u[_]);if(u!=null&&typeof Object.getOwnPropertySymbols=="function")for(var I=0,_=Object.getOwnPropertySymbols(u);I<_.length;I++)o.indexOf(_[I])<0&&Object.prototype.propertyIsEnumerable.call(u,_[I])&&(h[_[I]]=u[_[I]]);return h};const w={success:r.Z,info:G.Z,error:Qe.Z,warning:Pe.Z},me=u=>{const{icon:o,prefixCls:h,type:_}=u,I=w[_]||null;return o?(0,be.wm)(o,P.createElement("span",{className:`${h}-icon`},o),()=>({className:s()(`${h}-icon`,o.props.className)})):P.createElement(I,{className:`${h}-icon`})},c=u=>{const{isClosable:o,prefixCls:h,closeIcon:_,handleClose:I,ariaProps:m}=u,H=_===!0||_===void 0?P.createElement(b.Z,null):_;return o?P.createElement("button",Object.assign({type:"button",onClick:I,className:`${h}-close-icon`,tabIndex:0},m),H):null};var dt=P.forwardRef((u,o)=>{const{description:h,prefixCls:_,message:I,banner:m,className:H,rootClassName:S,style:Ae,onMouseEnter:F,onMouseLeave:Ee,onClick:tt,afterClose:Ve,showIcon:Re,closable:E,closeText:rt,closeIcon:et,action:jt,id:Bt}=u,e=v(u,["description","prefixCls","message","banner","className","rootClassName","style","onMouseEnter","onMouseLeave","onClick","afterClose","showIcon","closable","closeText","closeIcon","action","id"]),[Et,wt]=P.useState(!1),St=P.useRef(null);P.useImperativeHandle(o,()=>({nativeElement:St.current}));const{getPrefixCls:xt,direction:Ft,closable:nt,closeIcon:Pt,className:$t,style:At}=(0,Te.dj)("alert"),Be=xt("alert",_),[Rt,Mt,kt]=Ue(Be),yt=Ye=>{var it;wt(!0),(it=u.onClose)===null||it===void 0||it.call(u,Ye)},Ct=P.useMemo(()=>u.type!==void 0?u.type:m?"warning":"info",[u.type,m]),Tt=P.useMemo(()=>typeof E=="object"&&E.closeIcon||rt?!0:typeof E=="boolean"?E:et!==!1&&et!==null&&et!==void 0?!0:!!nt,[rt,et,E,nt]),Ot=m&&Re===void 0?!0:Re,Lt=s()(Be,`${Be}-${Ct}`,{[`${Be}-with-description`]:!!h,[`${Be}-no-icon`]:!Ot,[`${Be}-banner`]:!!m,[`${Be}-rtl`]:Ft==="rtl"},$t,H,S,kt,Mt),Ut=(0,$e.Z)(e,{aria:!0,data:!0}),Kt=P.useMemo(()=>typeof E=="object"&&E.closeIcon?E.closeIcon:rt||(et!==void 0?et:typeof nt=="object"&&nt.closeIcon?nt.closeIcon:Pt),[et,E,rt,Pt]),zt=P.useMemo(()=>{const Ye=E!=null?E:nt;if(typeof Ye=="object"){const{closeIcon:it}=Ye;return v(Ye,["closeIcon"])}return{}},[E,nt]);return Rt(P.createElement($.ZP,{visible:!Et,motionName:`${Be}-motion`,motionAppear:!1,motionEnter:!1,onLeaveStart:Ye=>({maxHeight:Ye.offsetHeight}),onLeaveEnd:Ve},({className:Ye,style:it},It)=>P.createElement("div",Object.assign({id:Bt,ref:(0,Ie.sQ)(St,It),"data-show":!Et,className:s()(Lt,Ye),style:Object.assign(Object.assign(Object.assign({},At),Ae),it),onMouseEnter:F,onMouseLeave:Ee,onClick:tt,role:"alert"},Ut),Ot?P.createElement(me,{description:h,icon:u.icon,prefixCls:Be,type:Ct}):null,P.createElement("div",{className:`${Be}-content`},I?P.createElement("div",{className:`${Be}-message`},I):null,h?P.createElement("div",{className:`${Be}-description`},h):null),jt?P.createElement("div",{className:`${Be}-action`},jt):null,P.createElement(c,{isClosable:Tt,prefixCls:Be,closeIcon:Kt,handleClose:yt,ariaProps:zt}))))}),st=t(15671),vt=t(43144),qe=t(61120),lt=t(78814),ht=t(82963);function Ne(u,o,h){return o=(0,qe.Z)(o),(0,ht.Z)(u,(0,lt.Z)()?Reflect.construct(o,h||[],(0,qe.Z)(u).constructor):o.apply(u,h))}var gt=t(60136),_t=function(u){function o(){var h;return(0,st.Z)(this,o),h=Ne(this,o,arguments),h.state={error:void 0,info:{componentStack:""}},h}return(0,gt.Z)(o,u),(0,vt.Z)(o,[{key:"componentDidCatch",value:function(_,I){this.setState({error:_,info:I})}},{key:"render",value:function(){const{message:_,description:I,id:m,children:H}=this.props,{error:S,info:Ae}=this.state,F=(Ae==null?void 0:Ae.componentStack)||null,Ee=typeof _=="undefined"?(S||"").toString():_,tt=typeof I=="undefined"?F:I;return S?P.createElement(dt,{id:m,type:"error",message:Ee,description:P.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},tt)}):H}}])}(P.Component);const a=dt;a.ErrorBoundary=_t;var ft=a}}]);