import{a9 as C,a5 as I}from"./index.17037962789732.js";import"./index.170379627897316.js";import"./index.170379627897317.js";import{A as S,B as h}from"./instance.1703796278973.js";import{d as x,k as u,w as i,o as r,c,a as d,x as k,F as O,h as V,u as p,t as B,A as P,M as b}from"./vue.1703796278973.js";const E=x({__name:"MSelect",props:{modelValue:{type:String,default:void 0},type:{type:String,default:"POINT"},id:{type:String,default:""},edgeId:{type:String,default:""}},emits:["update:modelValue"],setup(f,{emit:m}){const a=f,_=(e,t)=>t.label.toLowerCase().indexOf(e.toLowerCase())>=0,s=u([]),n=u(void 0);i(()=>{n.value=a.modelValue});const g=e=>{m("update:modelValue",e)},v=async e=>{var t;if(e){const l=await S(a.edgeId,{terms:[{terms:[{column:"channelId",value:e}]}]});l.status===200&&(s.value=((t=l.result)==null?void 0:t[0])||[])}else return[]},y=async e=>{var t;if(e){const l=await h(a.edgeId,{terms:[{terms:[{column:"collectorId",value:e}]}]});l.status===200&&(s.value=((t=l.result)==null?void 0:t[0])||[])}else return[]};return i(()=>{a.id?a.type==="POINT"?y(a.id):v(a.id):s.value=[]}),(e,t)=>{const l=C,w=I;return r(),c(w,{allowClear:"",value:p(n),"onUpdate:value":t[0]||(t[0]=o=>b(n)?n.value=o:null),onChange:g,placeholder:"请选择",style:{width:"100%"}},{default:d(()=>[(r(!0),k(O,null,V(p(s),o=>(r(),c(l,{key:o.id,value:o.id,label:o.name,"filter-option":_},{default:d(()=>[B(P(o.name),1)]),_:2},1032,["value","label"]))),128))]),_:1},8,["value"])}}});export{E as _};
