import{v as K,$ as j,av as k,aw as q,ax as D}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 N}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{g as J,q as P,a as R}from"./product.17037962789737.js";import{q as B}from"./category.1703796278973.js";import{g as F}from"./department.1703796278973.js";import{a as L}from"./comm.1703796278973.js";import{a as A}from"./setting.1703796278973.js";import{d as g,k as m,r as E,o as V,x as $,b as o,a as n,j as z,z as c,u as f,A as G,F as O,G as H,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 y=s=>(H("data-v-e6aba416"),s=s(),Q(),s),M=["src"],W={style:{width:"calc(100% - 100px)"}},X={style:{"font-size":"16px","font-weight":"600"}},Y=y(()=>c("div",{class:"card-item-content-text"}," 设备类型 ",-1)),Z=y(()=>c("div",null,"直连设备",-1)),ee=g({name:"Product"}),te=g({...ee,props:{rowKey:{type:String,default:""},detail:{type:Object,default:()=>({})}},emits:["update:rowKey","update:detail","change"],setup(s,{emit:d}){const l=s,v=m(),u=m({}),_=m(!0),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:()=>J().then(e=>A(e.result||[]))}},{title:"接入方式",dataIndex:"accessName",width:150,ellipsis:!0,search:{type:"select",options:()=>P().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=>{B({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 r=p=>p.map(a=>(a.children&&(a.children=r(a.children)),{...a,value:JSON.stringify({assetType:"product",targets:[{type:"org",id:a.id}]})}));e(r(t.result)||[])})})}}],w=e=>{u.value=e},x=async e=>{const t=[];l.rowKey&&t.push({name:"id",value:l.rowKey}),t.push({name:"createTime",order:"desc"}),e.sorts=t;const r=await R(e);if(r.success&&l.rowKey&&_.value){const p=r.result.data.find(a=>a.id===l.rowKey);d("update:detail",p),_.value=!1}return{...r}},I=e=>{d("update:rowKey",e.id),d("update:detail",e),d("change",e)};return(e,t)=>{const r=K,p=j,a=E("Ellipsis"),b=k,S=q,T=N,C=D;return V(),$(O,null,[o(r,{columns:h,type:"simple",onSearch:w,class:"scene-search",target:"scene-triggrt-device-device"}),o(p,{style:{margin:"0"}}),o(C,{ref_key:"actionRef",ref:v,model:"CARD",columns:h,params:f(u),request:x,gridColumn:2,gridColumns:[2,2,2],bodyStyle:{paddingRight:0,paddingLeft:0}},{card:n(i=>[o(T,{value:i,active:s.rowKey===i.id,status:i.state,statusText:i.state===1?"正常":"禁用",statusNames:{1:"processing",0:"error"},onClick:I},{img:n(()=>[z(e.$slots,"img",{},()=>[c("img",{width:"80",height:"80",src:i.photoUrl||f(L)("/device-product.png")},null,8,M)],!0)]),content:n(()=>[c("div",W,[o(a,null,{default:n(()=>[c("span",X,G(i.name),1)]),_:2},1024)]),o(S,null,{default:n(()=>[o(b,{span:12},{default:n(()=>[Y,Z]),_:1})]),_:1})]),_:2},1032,["value","active","status","statusText"])]),_:3},8,["params"])],64)}}});const Xe=U(te,[["__scopeId","data-v-e6aba416"]]);export{Xe as default};