import{p as f}from"./index-CTMAUNGp.js";import{R as v,a9 as V}from"./element-plus-DNKe9-lk.js";import{l as g,aK as b,r as n,aJ as y,b as M,m as R,M as _,K as k,u as m,B as I,R as h}from"./vue-chunks-DyZSmvoe.js";const C=g({__name:"selectRoom",props:b({formModel:{type:Object,default:()=>({})}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(d){const l=n([]),t=n(!1),u=n(!1);let e=y(d,"modelValue");const i=()=>{u.value=!1,V(e.value)&&(l.value=(e.value||[]).map(a=>({label:a.name,value:a})))};M(()=>{u.value=!0,setTimeout(()=>{i()},300)});const p=(a,r)=>{t.value=!0,f({name:a}).then(o=>{t.value=!1;const c=(o.list||[]).map(s=>({label:s.name,value:{uniqueId:s.uniqueId,name:s.name,roomId:s.roomId}}));l.value=c}).catch(o=>{t.value=!1,l.value=[]})};return(a,r)=>u.value?h("",!0):(R(),_(m(v),k({key:0,modelValue:m(e),"onUpdate:modelValue":r[0]||(r[0]=o=>I(e)?e.value=o:e=o),loading:t.value,filterable:"",remote:""},a.$attrs,{"value-key":"name",options:l.value,"remote-method":p}),null,16,["modelValue","loading","options"]))}});export{C as _};
