import{V as k,v as A,$ as R,av as T,aw as L,ax as B}from"./index.17037962789732.js";import"./index.1703796278973300.js";import"./index.170379627897315.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{_ as E}from"./index.170379627897313.js";import"./index.170379627897319.js";import"./index.170379627897327.js";import"./index.170379627897335.js";import"./index.170379627897318.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.170379627897328.js";import"./Item.1703796278973.js";import{a as J}from"./comm.1703796278973.js";import{k as N}from"./instance.1703796278973.js";import{d as y,k as V,l as q,r as z,o as F,x as $,b as i,a,u as m,j as G,z as r,A as d,F as H,G as O,H as Q}from"./vue.1703796278973.js";import{_ as U}from"./_plugin-vue_export-helper.1703796278973.js";import"./index.17037962789733.js";import"./dayjs.min.1703796278973.js";import"./isArray.1703796278973.js";import"./editor.api.1703796278973.js";import"./preload-helper.1703796278973.js";import"./monaco.contribution.1703796278973.js";import"./index.vue_vue_type_script_setup_true_lang.17037962789733.js";import"./index.170379627897333.js";import"./system.1703796278973.js";import"./index.170379627897334.js";import"./default.1703796278973.js";import"./permission.1703796278973.js";import"./consts.1703796278973.js";import"./404.1703796278973.js";const g=n=>(O("data-v-2324736b"),n=n(),Q(),n),M=["src"],W={style:{"font-size":"16px","font-weight":"600"}},X=g(()=>r("div",{class:"card-item-content-text"}," 设备类型 ",-1)),Y=g(()=>r("div",{class:"card-item-content-text"}," 产品名称 ",-1)),Z=y({name:"DeviceSelectList"}),P=y({...Z,props:{rowKeys:{type:Array,default:()=>[]},productId:{type:String,default:""}},emits:["update"],setup(n,{emit:x}){const c=n,l=V({}),w=q(()=>c.rowKeys.map(e=>e.value)),u=[{title:"ID",dataIndex:"id",width:300,ellipsis:!0,fixed:"left",search:{type:"string"}},{title:"设备名称",dataIndex:"name",width:200,ellipsis:!0,search:{type:"string",first:!0}},{title:"创建时间",dataIndex:"createTime",width:200,search:{type:"date"}},{title:"状态",dataIndex:"state",width:90,search:{type:"select",options:[{label:"禁用",value:"notActive"},{label:"离线",value:"offline"},{label:"在线",value:"online"}]}}],I=e=>{l.value=e},S=e=>{const t=[];c.rowKeys&&c.rowKeys.forEach(p=>{t.push({name:"id",value:p})}),t.push({name:"createTime",order:"desc"});const s=[...e.terms,{terms:[{column:"productId",value:c.productId}]}];return N({...e,terms:s,sorts:t})},b=e=>{const t=k(c.rowKeys),s=t.findIndex(p=>p.value===e.id);s!==-1?t.splice(s,1):t.push({name:e.name,value:e.id}),x("update",t)};return(e,t)=>{const s=A,p=R,C=z("Ellipsis"),_=T,D=L,K=E,j=B;return F(),$(H,null,[i(s,{columns:u,type:"simple",onSearch:I,class:"scene-search",target:"scene-triggrt-device-device"}),i(p,{style:{margin:"0"}}),i(j,{ref:"actionRef",model:"CARD",columns:u,request:S,gridColumn:2,params:m(l),bodyStyle:{paddingRight:0,paddingLeft:0}},{card:a(o=>{var v,f;return[i(K,{value:o,active:m(w).includes(o.id),status:(v=o.state)==null?void 0:v.value,statusText:(f=o.state)==null?void 0:f.text,statusNames:{online:"processing",offline:"error",notActive:"warning"},onClick:b},{img:a(()=>[G(e.$slots,"img",{},()=>[r("img",{width:"80",height:"80",src:o.photoUrl||m(J)("/device/instance/device-card.png")},null,8,M)],!0)]),content:a(()=>[i(C,{style:{width:"calc(100% - 100px)"}},{default:a(()=>[r("span",W,d(o.name),1)]),_:2},1024),i(D,null,{default:a(()=>[i(_,{span:12},{default:a(()=>{var h;return[X,r("div",null,d((h=o.deviceType)==null?void 0:h.text),1)]}),_:2},1024),i(_,{span:12},{default:a(()=>[Y,r("div",null,d(o.productName),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["value","active","status","statusText"])]}),_:3},8,["params"])],64)}}});const Qe=U(P,[["__scopeId","data-v-2324736b"]]);export{Qe as default};
