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