import{$ as N,av as R,aw as B,ax as E}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 V}from"./index.170379627897313.js";import"./index.170379627897319.js";import"./index.170379627897327.js";import"./index.170379627897335.js";import{a as q,k as z}from"./instance.1703796278973.js";import{a as F}from"./comm.1703796278973.js";import{d as S,k as x,p as L,w as $,r as I,o as G,x as H,b as s,a as r,j as M,z as d,u as w,A as p,t as O,F as Q,G as K,H as U}from"./vue.1703796278973.js";import{_ as W}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 k=i=>(K("data-v-13ea2833"),i=i(),U(),i),X=["src"],Y={style:{width:"calc(100% - 100px)"}},Z={style:{"font-size":"16px","font-weight":"600"}},P=k(()=>d("div",{class:"card-item-content-text"},"设备类型",-1)),ee=k(()=>d("div",{class:"card-item-content-text"},"产品名称",-1)),te=S({name:"Product"}),ae=S({...te,props:{value:{type:Array,default:[]},detail:{type:Object,default:()=>({})},productId:{type:String,default:""}},emits:["update:value","change"],setup(i,{emit:m}){const t=i,C=x(),l=x({terms:[]}),_=[{title:"ID",dataIndex:"id",width:300,search:{type:"string"}},{title:"设备名称",dataIndex:"name",search:{type:"string",first:!0}},{title:"创建时间",dataIndex:"createTime",key:"createTime",scopedSlots:!0,search:{type:"date"}},{title:"状态",dataIndex:"state",key:"state",scopedSlots:!0,search:{type:"select",options:[{label:"禁用",value:"notActive"},{label:"离线",value:"offline"},{label:"在线",value:"online"}]}}],T=e=>{l.value={...e,terms:[...e.terms,{terms:[{column:"productId",value:t==null?void 0:t.productId}]}]}},b=e=>{var o,n;const a=[];return(o=t.value[0])!=null&&o.value&&a.push({name:"id",value:(n=t.value[0])==null?void 0:n.value}),a.push({name:"createTime",order:"desc"}),e.sorts=a,z(e)},D=e=>{var a,o;((o=(a=t.value)==null?void 0:a[0])==null?void 0:o.value)===e.id?(m("update:value",void 0),m("change",{})):(m("update:value",[{value:e.id,name:e.name}]),m("change",e))};return L(()=>{var e,a,o,n;(a=(e=t.value)==null?void 0:e[0])!=null&&a.value&&q((n=(o=t.value)==null?void 0:o[0])==null?void 0:n.value).then(u=>{m("change",u.result)})}),$(()=>{var e;l.value={...l.value,terms:(e=l.value)!=null&&e.terms?[...l.value.terms||[],{terms:[{column:"productId",value:t==null?void 0:t.productId}]}]:[{terms:[{column:"productId",value:t==null?void 0:t.productId}]}]}}),(e,a)=>{const o=I("pro-search"),n=N,u=I("Ellipsis"),v=R,j=B,A=V,J=E;return G(),H(Q,null,[s(o,{columns:_,type:"simple",onSearch:T,class:"scene-search",target:"scene-trigger-device-device"}),s(n,{style:{margin:"0"}}),s(J,{ref_key:"actionRef",ref:C,model:"CARD",columns:_,params:w(l),request:b,gridColumn:2,bodyStyle:{paddingRight:0,paddingLeft:0}},{card:r(c=>{var f,h,g;return[s(A,{value:c,onClick:D,active:((f=i.value[0])==null?void 0:f.value)===c.id,status:(h=c.state)==null?void 0:h.value,statusText:(g=c.state)==null?void 0:g.text,statusNames:{online:"processing",offline:"error",notActive:"warning"}},{img:r(()=>[M(e.$slots,"img",{},()=>[d("img",{src:w(F)("/device/instance/device-card.png")},null,8,X)],!0)]),content:r(()=>[d("div",Y,[s(u,null,{default:r(()=>[d("span",Z,p(c.name),1)]),_:2},1024)]),s(j,{style:{"margin-top":"20px"}},{default:r(()=>[s(v,{span:12},{default:r(()=>{var y;return[P,d("div",null,p((y=c.deviceType)==null?void 0:y.text),1)]}),_:2},1024),s(v,{span:12},{default:r(()=>[ee,s(u,{style:{width:"100%"}},{default:r(()=>[O(p(c.productName),1)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1032,["value","active","status","statusText"])]}),_:3},8,["params"])],64)}}});const Fe=W(ae,[["__scopeId","data-v-13ea2833"]]);export{Fe as default};
