import{u as D}from"./useInstance.233fbdde.js";import{a as x,b as w}from"./list.7fe3efab.js";import{d as L,r as m,b as M,p as I,c as n,e as i,k as V,i as o,h as u,u as a,f as R,j as N,m as c,t as U,F as j,a2 as q,q as S,E as T}from"./index.0308b213.js";const $=c("\u63D0\u4EA4"),z=c("\u53D6\u6D88"),K=L({props:{modelValue:{type:Boolean,default:!1},uid:{default:0}},emits:["update:modelValue","onClose"],setup(A,{emit:f}){const d=A,{global:E}=D();let s=m(!1);const _=m(),t=M({groupid:""});let g=m([]);const B=()=>{x(d.uid).then(l=>{t.groupid=l.data.groupid,g.value=l.groups})};I(()=>d.modelValue,l=>{s.value=l,l&&B()});const v=()=>{w(d.uid,t).then(l=>{T({message:"\u66F4\u65B0\u4F1A\u5458\u7B49\u7EA7\u4FE1\u606F\u6210\u529F",type:"success"}),p()})},p=()=>{f("update:modelValue",!1),f("onClose"),E.$resetForm(_.value,t)};return(l,r)=>{const C=n("el-option"),k=n("el-select"),b=n("el-form-item"),F=n("el-button"),h=n("el-dialog");return i(),V(h,{modelValue:a(s),"onUpdate:modelValue":r[1]||(r[1]=e=>S(s)?s.value=e:s=e),title:"\u4F1A\u5458\u7B49\u7EA7",width:"50%",onClose:p},{default:o(()=>[u(a(q),{ref_key:"formRef",ref:_,model:a(t),"label-width":"140px"},{default:o(()=>[u(b,{label:"\u4F1A\u5458\u7B49\u7EA7",prop:"groupid"},{default:o(()=>[u(k,{modelValue:a(t).groupid,"onUpdate:modelValue":r[0]||(r[0]=e=>a(t).groupid=e),placeholder:"\u8BF7\u9009\u62E9\u4F1A\u5458\u7B49\u7EA7",clearable:""},{default:o(()=>[(i(!0),R(j,null,N(a(g),(e,y)=>(i(),V(C,{key:`member-group-${y}`,value:e.id,label:e.title},{default:o(()=>[c(U(e.title),1)]),_:2},1032,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),u(b,null,{default:o(()=>[u(F,{type:"primary",onClick:v},{default:o(()=>[$]),_:1}),u(F,{onClick:p},{default:o(()=>[z]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])}}});export{K as _};
