import{L as j,ax as z,W as L}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.170379627897333.js";import{o as O}from"./comm.1703796278973.js";import{q as V}from"./resource.1703796278973.js";import{a as Y}from"./dayjs.min.1703796278973.js";import{_ as J}from"./Result.vue_vue_type_script_setup_true_lang.1703796278973.js";import{b as H}from"./product.17037962789737.js";import{d as K,k as a,r as y,o as h,c as v,a as n,z as x,b as c,t as I,u as t,A as b,B as $}from"./vue.1703796278973.js";const E={class:"resource-issue-alert"},_e=K({__name:"index",props:{data:{type:Object,default:()=>{}}},emits:["close"],setup(w,{emit:S}){const T=w,k={pageSize:10,sorts:[{name:"registerTime",order:"desc"}],terms:[{terms:[{termType:"eq",column:"productId$product-info",value:"accessProvider is official-edge-gateway"}],type:"and"}]},m=a({}),C=a(),p=a([]),l=a([]),d=a(!1),o=new Map;o.set("online","success"),o.set("offline","error"),o.set("notActive","warning");const u=[{title:"ID",dataIndex:"id",key:"id",ellipsis:!0,width:200,fixed:"left",search:{type:"string"}},{title:"产品名称",dataIndex:"productName",key:"productName",ellipsis:!0,search:{type:"select",rename:"productId",first:!0,options:()=>new Promise(s=>{H({paging:!1}).then(r=>{s(r.result.map(i=>({label:i.name,value:i.id})))})})}},{title:"设备名称",ellipsis:!0,dataIndex:"name",key:"name",search:{type:"string"}},{title:"注册时间",dataIndex:"registerTime",key:"registerTime",width:200,scopedSlots:!0,search:{type:"date",rename:"registryTime"}},{title:"状态",dataIndex:"state",key:"state",scopedSlots:!0,search:{type:"select",options:[{label:"禁用",value:"notActive"},{label:"离线",value:"offline"},{label:"在线",value:"online"}]}}],N=(s,r)=>{p.value=[...s],l.value=r},q=s=>{m.value=s},A=()=>{l.value.length?d.value=!0:O("请选择设备","error")},_=()=>{S("close")};return(s,r)=>{const i=y("AIcon"),B=y("pro-search"),M=j,R=z,D=L;return h(),v(D,{visible:"",title:"下发设备",width:1e3,onOk:A,onCancel:_},{default:n(()=>[x("div",E,[c(i,{type:"InfoCircleOutlined",style:{"margin-right":"10px"}}),I("离线设备无法进行设备模板下发 ")]),c(B,{columns:u,target:"edge-resource-issue",onSearch:q,type:"simple",class:"resource-issue-search"}),c(R,{ref_key:"edgeResourceIssueRef",ref:C,columns:u,request:t(V),defaultParams:k,params:t(m),model:"TABLE",bodyStyle:{padding:0},rowSelection:{selectedRowKeys:t(p),onChange:N},pagination:{showSizeChanger:!0,pageSizeOptions:["10","20","50","100"]}},{state:n(e=>{var g,f;return[c(M,{text:(g=e.state)==null?void 0:g.text,status:t(o).get((f=e.state)==null?void 0:f.value)},null,8,["text","status"])]}),sourceId:n(e=>[I(b(e.sourceName),1)]),registerTime:n(e=>[x("span",null,b(e!=null&&e.registerTime?t(Y)(e.registerTime).format("YYYY-MM-DD HH:mm:ss"):""),1)]),_:1},8,["request","params","rowSelection"]),t(d)?(h(),v(J,{key:0,data:T.data,list:t(l),onClose:_},null,8,["data","list"])):$("",!0)]),_:1})}}});export{_e as _};
