import{$ as j,av as q,aw as D,ax as J}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 R}from"./index.170379627897313.js";import"./index.170379627897319.js";import"./index.170379627897327.js";import"./index.170379627897335.js";import{d as B,g as L,q as V,a as $}from"./product.17037962789737.js";import{q as E}from"./category.1703796278973.js";import{g as F}from"./department.1703796278973.js";import{a as z}from"./comm.1703796278973.js";import{a as A}from"./setting.1703796278973.js";import{d as x,k as g,p as G,r as y,o as O,x as H,b as r,a as o,j as M,z as d,u as v,A as m,t as w,F as Q,G as U,H as W}from"./vue.1703796278973.js";import{_ as X}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 b=c=>(U("data-v-1454b456"),c=c(),W(),c),Y=["src"],Z={style:{width:"calc(100% - 100px)"}},P={style:{"font-size":"16px","font-weight":"600"}},ee=b(()=>d("div",{class:"card-item-content-text"},"设备类型",-1)),te=b(()=>d("div",{class:"card-item-content-text"},"接入方式",-1)),ae=x({name:"Product"}),re=x({...ae,props:{rowKey:{type:String,default:""},detail:{type:Object,default:()=>({})}},emits:["update:rowKey","update:detail","change"],setup(c,{emit:i}){const n=c,I=g(),_=g({}),h=[{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:"accessProvider",width:150,ellipsis:!0,hideInTable:!0,search:{type:"select",options:()=>L().then(e=>{const t=e.result||[];return A(t)})}},{title:"接入方式",dataIndex:"accessName",width:150,ellipsis:!0,search:{type:"select",options:()=>V().then(e=>e.result.map(t=>({label:t.name,value:t.id})))}},{title:"设备类型",dataIndex:"deviceType",width:150,search:{type:"select",options:[{label:"直连设备",value:"device"},{label:"网关子设备",value:"childrenDevice"},{label:"网关设备",value:"gateway"}]}},{title:"状态",dataIndex:"state",width:"90px",search:{type:"select",options:[{label:"禁用",value:0},{label:"正常",value:1}]}},{title:"说明",dataIndex:"describe",ellipsis:!0,width:300},{dataIndex:"classifiedId",title:"分类",hideInTable:!0,search:{type:"treeSelect",options:()=>new Promise(e=>{E({paging:!1}).then(t=>{e(t.result)})}),componentProps:{fieldNames:{label:"name",value:"id"}}}},{dataIndex:"id$dim-assets",title:"所属组织",hideInTable:!0,search:{type:"treeSelect",options:()=>new Promise(e=>{F({paging:!1}).then(t=>{const l=p=>p.map(s=>(s.children&&(s.children=l(s.children)),{...s,value:JSON.stringify({assetType:"product",targets:[{type:"org",id:s.id}]})}));e(l(t.result)||[])})})}}],T=e=>{_.value=e},S=e=>{const t=[];return n.rowKey&&t.push({name:"id",value:n.rowKey}),t.push({name:"createTime",order:"desc"}),e.sorts=t,$(e)},C=e=>{(n==null?void 0:n.rowKey)===e.id?(i("update:rowKey",""),i("update:detail",{}),i("change",{})):(i("update:rowKey",e.id),i("update:detail",e),i("change",e))};return G(()=>{n.rowKey&&B(n.rowKey).then(e=>{e.status===200&&(i("update:detail",e.result),i("change",e.result,!0))})}),(e,t)=>{const l=y("pro-search"),p=j,s=y("Ellipsis"),f=q,K=D,N=R,k=J;return O(),H(Q,null,[r(l,{columns:h,type:"simple",onSearch:T,class:"scene-search",target:"scene-trigger-device-product"}),r(p,{style:{margin:"0"}}),r(k,{ref_key:"actionRef",ref:I,model:"CARD",columns:h,params:v(_),request:S,gridColumn:2,bodyStyle:{paddingRight:0,paddingLeft:0}},{card:o(a=>[r(N,{value:a,active:c.rowKey===a.id,status:String(a.state),statusText:a.state===1?"正常":"禁用",statusNames:{1:"processing",0:"error"},onClick:u=>C(a)},{img:o(()=>[M(e.$slots,"img",{},()=>[d("img",{width:80,height:80,src:a.photoUrl||v(z)("/device-product.png")},null,8,Y)],!0)]),content:o(()=>[d("div",Z,[r(s,null,{default:o(()=>[d("span",P,m(a.name),1)]),_:2},1024)]),r(K,null,{default:o(()=>[r(f,{span:12},{default:o(()=>[ee,r(s,null,{default:o(()=>{var u;return[w(m((u=a.deviceType)==null?void 0:u.text),1)]}),_:2},1024)]),_:2},1024),r(f,{span:12},{default:o(()=>[te,r(s,null,{default:o(()=>[w(m((a==null?void 0:a.accessName)||"未接入"),1)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1032,["value","active","status","statusText","onClick"])]),_:3},8,["params"])],64)}}});const Ge=X(re,[["__scopeId","data-v-1454b456"]]);export{Ge as default};