var m=(d,i,o)=>new Promise((p,t)=>{var c=l=>{try{r(o.next(l))}catch(e){t(e)}},f=l=>{try{r(o.throw(l))}catch(e){t(e)}},r=l=>l.done?p(l.value):Promise.resolve(l.value).then(c,f);r((o=o.apply(d,i)).next())});import{d as j,r as _,K as N,j as n,o as v,h as y,w as a,b as $,e as u,k,c as q,F as E,v as F,E as L}from"./index-90c78f99.js";const R={class:"flex justify-center"},O=j({__name:"server-dialog",props:{visible:{type:Boolean,default:!1,required:!0},data:Object},emits:["close"],setup(d,{emit:i}){const o=d,p=_(),t=_({ips:[]}),c={ips:[{required:!0,message:"请选择服务器ip"}]},f=l=>m(this,null,function*(){l&&(yield l.validate(e=>m(this,null,function*(){e&&(L.success("关联成功！"),i("close",!0))})))}),r=_();return N(()=>o.visible,l=>{l?console.log(o.data):t.value={ips:[]}}),(l,e)=>{const g=n("el-option"),w=n("el-select"),x=n("el-form-item"),C=n("el-form"),b=n("el-button"),V=n("el-dialog");return v(),y(V,{"model-value":d.visible,title:"关联服务器",width:574,"destroy-on-close":"",onClose:e[3]||(e[3]=s=>i("close"))},{footer:a(()=>[$("div",R,[u(b,{type:"primary",onClick:e[1]||(e[1]=s=>f(p.value))},{default:a(()=>[k("确定")]),_:1}),u(b,{onClick:e[2]||(e[2]=s=>i("close"))},{default:a(()=>[k("取消")]),_:1})])]),default:a(()=>[u(C,{ref_key:"formRef",ref:p,"label-suffix":":",model:t.value,rules:c,"label-width":"90"},{default:a(()=>[u(x,{label:"服务器ip",prop:"ips"},{default:a(()=>[u(w,{modelValue:t.value.ips,"onUpdate:modelValue":e[0]||(e[0]=s=>t.value.ips=s),multiple:"",filterable:"",class:"w-full"},{default:a(()=>[(v(!0),q(E,null,F(r.value,(s,B)=>(v(),y(g,{key:B,label:s.ip,value:s.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["model-value"])}}});export{O as _};
