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