import{aT as Z,aL as ee,a0 as te,ax as oe,W as ae,M as D}from"./index.17037962789732.js";import"./index.170379627897337.js";import"./index.170379627897315.js";import"./index.1703796278973300.js";import"./index.170379627897317.js";import"./index.1703796278973301.js";import"./index.1703796278973302.js";import"./index.170379627897332.js";import"./index.1703796278973303.js";import"./index.170379627897339.js";import"./index.170379627897316.js";import"./index.170379627897314.js";import"./index.1703796278973304.js";import"./index.1703796278973305.js";import"./index.1703796278973306.js";import"./index.170379627897336.js";import{_ as ne}from"./index.vue_vue_type_script_setup_true_name_PermissionButton_lang.1703796278973.js";import"./index.170379627897318.js";import"./index.170379627897319.js";import"./index.170379627897320.js";import"./index.170379627897321.js";import"./index.170379627897322.js";import"./index.170379627897323.js";import"./index.170379627897324.js";import"./index.170379627897325.js";import"./index.170379627897326.js";import"./index.170379627897327.js";import"./index.170379627897328.js";import"./Item.1703796278973.js";import{a as se}from"./comm.1703796278973.js";import{b as le,d as re}from"./device.17037962789733.js";import{f as ie}from"./area.1703796278973.js";import{_ as de}from"./index.vue_vue_type_script_setup_true_name_modifyDrawer_lang.17037962789732.js";import{a as ce}from"./dayjs.min.1703796278973.js";import{d as F,k as e,m as M,p as pe,v as me,V as j,a3 as ue,r as C,o as I,c as B,a as n,b as s,u as t,z as c,M as b,t as _e,A as fe,x as ye,F as ve,h as he,G as xe,H as ge}from"./vue.1703796278973.js";import{_ as ke}from"./_plugin-vue_export-helper.1703796278973.js";import"./index.17037962789733.js";import"./isArray.1703796278973.js";import"./editor.api.1703796278973.js";import"./preload-helper.1703796278973.js";import"./monaco.contribution.1703796278973.js";import"./permission.1703796278973.js";import"./system.1703796278973.js";import"./index.170379627897333.js";import"./index.170379627897334.js";import"./default.1703796278973.js";import"./consts.1703796278973.js";import"./404.1703796278973.js";import"./index.1703796278973318.js";import"./index.170379627897329.js";import"./index.170379627897330.js";import"./store.1703796278973.js";import"./moment.1703796278973.js";const T=m=>(xe("data-v-815ab370"),m=m(),ge(),m),Ce={class:"left-tree"},Ie=T(()=>c("h3",null,"监控区域",-1)),be={class:"delete_content"},Te=["src"],Ke=T(()=>c("p",{class:"delete_content title"},"确认删除这条信息吗?",-1)),we=T(()=>c("p",{class:"delete_content desc"},"删除后无法恢复,确定要删除吗?",-1)),Se=F({name:"Category"}),Ae=F({...Se,setup(m){const p=e([]),d=e([]);e(2),e([]),M(p,()=>{console.log("expandedKeys",p)}),M(d,()=>{console.log("selectedKeys",d)});const u=e([]),f=e({}),y=e();e([]);const _=e({}),v=e(""),h=e(0),K=e(0),J=e(!1);let x=e(),O=e(0);const g=e(!1),k=e(!1),V=e("object"),q=e([{title:"",dataIndex:"name",search:{type:"string",componentProps:{placeholder:"请输入关键字"},defaultValue:"123123"}}]),N=(o,a)=>{const l=a.node;x.value={where:"areaId="+l.id}},w=e([]);pe(()=>{ie().then(o=>{console.log("=========findArea========",o.result),w.value=o.result})});const Y=o=>{console.log(o),k.value=!0,setTimeout(()=>{k.value=!1,g.value=!1},1e3)},E=o=>{console.log(o),g.value=!1},H=o=>{let a=[];for(let l in o)a.push(l+"="+o[l]);x.value={where:a.join(" and ")},u.value=[]},U=(o,a)=>{if(!o)return[];const l=[{key:"update",text:"编辑",tooltip:{title:"编辑"},icon:"EditOutlined",onClick:async()=>{v.value="编辑监控设备信息",h.value=2,_.value=o,j(()=>{y.value.show(o)})}},{key:"delete",text:"删除",tooltip:{title:"删除"},icon:"DeleteOutlined",popConfirm:{title:"确认删除?",okText:" 确定",cancelText:"取消",onConfirm:async()=>{(await re(o.id)).status===200?(D.success("操作成功!"),f.value.reload()):D.error("操作失败!")}}}];return O.value=l.length,l},S=me({columns:[{title:"编码",dataIndex:"code",key:"code"},{title:"名称",dataIndex:"name",key:"name"},{title:"设备类别",dataIndex:"deviceType",key:"deviceType"},{title:"访问地址",dataIndex:"serverAddr",key:"serverAddr"},{title:"设备型号",dataIndex:"model",key:"model"},{title:"品牌",dataIndex:"brand",key:"brand"},{title:"设备序号",dataIndex:"deviceSn",key:"deviceSn"},{title:"所属库房",dataIndex:"warehouse.name",key:"warehouse.name"},{title:"所属区域",dataIndex:"area.name",key:"area.name"},{title:"创建日期",dataIndex:"createTime",key:"createTime",scopedSlots:!0},{title:"操作",key:"action",fixed:"right",ellipsis:!0,scopedSlots:!0}],add:async()=>{v.value="新增监控设备信息",h.value=0,K.value=3,console.log("========selectedKeys====val===",d.value[0]),_.value={areaId:d.value[0]},j(()=>{y.value.show(_.value)})},refresh:()=>{f.value.reload()}}),{add:$,columns:Re,refresh:z}=ue(S);return(o,a)=>{const l=Z,A=ee,R=C("AIcon"),L=ne,P=te,G=oe,W=C("FullPage"),Q=ae,X=C("page-container");return I(),B(X,null,{default:n(()=>[s(l,{columns:t(q),onSearch:H,type:t(V)},null,8,["columns","type"]),s(W,{class:"monitor-page"},{default:n(()=>[c("div",Ce,[Ie,s(A,{expandedKeys:t(p),"onUpdate:expandedKeys":a[0]||(a[0]=r=>b(p)?p.value=r:null),selectedKeys:t(d),"onUpdate:selectedKeys":a[1]||(a[1]=r=>b(d)?d.value=r:null),"tree-data":t(w),fieldNames:{title:"name",key:"id",children:"children"},onSelect:N},null,8,["expandedKeys","selectedKeys","tree-data"])]),s(G,{ref_key:"tableRef",ref:f,columns:t(S).columns,request:t(le),model:"TABLE",expandedRowKeys:t(u),"onUpdate:expandedRowKeys":a[2]||(a[2]=r=>b(u)?u.value=r:null),scroll:{y:550},defaultParams:{paging:!1,sorts:[{name:"sortIndex",order:"asc"},{name:"createTime",order:"desc"}]},params:t(x),loading:t(J)},{headerTitle:n(()=>[s(P,null,{default:n(()=>[s(L,{type:"primary",onClick:t($),hasPermission:"device/Category:add"},{icon:n(()=>[s(R,{type:"PlusOutlined"})]),default:n(()=>[_e(" 新增监控设备 ")]),_:1},8,["onClick"])]),_:1})]),createTime:n(r=>[c("span",null,fe(t(ce)(r.createTime).format("YYYY-MM-DD HH:mm:ss")),1)]),action:n(r=>[s(P,null,{default:n(()=>[(I(!0),ye(ve,null,he(U(r,"table"),(i,Le)=>(I(),B(L,{key:i.key,disabled:i.disabled,popConfirm:i.popConfirm,hasPermission:"device/Category:"+i.key,tooltip:{...i.tooltip},onClick:i.onClick,type:"link",style:{padding:"0px"},danger:i.key==="delete"},{icon:n(()=>[s(R,{type:i.icon},null,8,["type"])]),_:2},1032,["disabled","popConfirm","hasPermission","tooltip","onClick","danger"]))),128))]),_:2},1024)]),_:1},8,["columns","request","expandedRowKeys","params","loading"])]),_:1}),s(de,{ref_key:"modifyRef",ref:y,formData:t(_),title:t(v),isAdd:t(h),isChild:t(K),onRefresh:t(z)},null,8,["formData","title","isAdd","isChild","onRefresh"]),s(Q,{visible:t(g),title:"确认删除",onOk:Y,onCancel:E,confirmLoading:t(k)},{default:n(()=>[c("p",be,[c("img",{src:t(se)("/question-mark.png"),alt:""},null,8,Te)]),Ke,we]),_:1},8,["visible","confirmLoading"])]),_:1})}}});const Lt=ke(Ae,[["__scopeId","data-v-815ab370"]]);export{Lt as default};