import{a5 as i}from"./index.17037962789732.js";import"./index.170379627897316.js";import"./index.170379627897317.js";import{n as p}from"./config.17037962789732.js";import{d as m,k as v,p as _,o as f,c as d,u as h}from"./vue.1703796278973.js";const b=m({__name:"RelationSelect",props:{value:{type:Array,default:()=>[{value:{}}]}},emits:["update:value","change"],setup(o,{emit:n}){const s=v([]);_(()=>{u()});const u=()=>{p.getRelationUsers({paging:!1,sorts:[{name:"createTime",order:"desc"}],terms:[{termType:"eq",column:"objectTypeName",value:"设备"}]}).then(e=>{e.status===200&&(s.value=e.result.map(a=>({label:a.name,value:a.relation})))})},c=(e,a)=>{const t=[{value:{objectType:"user",relation:e}}];n("update:value",t),n("change",t,a)};return(e,a)=>{var l,r;const t=i;return f(),d(t,{placeholder:"请选择关系",options:h(s),"show-search":"",value:o.value?(r=(l=o.value[0])==null?void 0:l.value)==null?void 0:r.relation:void 0,onChange:c},null,8,["options","value"])}}});export{b as _};
