import{d as F,r as f,b as A,p as B,c as n,e as g,k as V,i as e,h as a,u as d,f as P,j as w,m as i,t as N,F as R,a2 as S,cS as T,cT as U,E as j}from"./index.0308b213.js";const I=i("\u5168\u9009"),L=i("\u63D0\u4EA4"),M=i("\u53D6\u6D88"),G=F({props:{id:{default:0},modelValue:{type:Boolean,default:!1}},emits:["update:modelValue","onClose"],setup(b,{emit:k}){const c=b,r=f(!1),u=f([]),p=f(),l=A({id:0,plugins:[]});B(()=>c.modelValue,o=>{r.value=o,o&&c.id&&(l.id=c.id,x())});const C=()=>{l.plugins=u.value.map(o=>o.id)},x=()=>{T({id:l.id}).then(o=>{l.plugins=o.plugins||[],u.value=o.plugin_list||[],console.log(l,u.value,p,p.value)})},y=()=>{U(l).then(()=>{j.success("\u4FEE\u6539\u5E73\u53F0\u63D2\u4EF6\u6210\u529F"),m()})},m=()=>{k("update:modelValue",!1),k("onClose")};return(o,s)=>{const _=n("el-button"),h=n("el-form-item"),E=n("el-checkbox"),v=n("el-checkbox-group"),D=n("el-dialog");return g(),V(D,{modelValue:r.value,"onUpdate:modelValue":s[1]||(s[1]=t=>r.value=t),title:"\u7BA1\u7406\u63D2\u4EF6",width:"50%","destroy-on-close":"",onClose:m},{footer:e(()=>[a(_,{type:"primary",onClick:y},{default:e(()=>[L]),_:1}),a(_,{type:"danger",onClick:m},{default:e(()=>[M]),_:1})]),default:e(()=>[a(d(S),{ref_key:"formRef",ref:p,model:d(l),"label-width":"130px"},{default:e(()=>[a(h,null,{default:e(()=>[a(_,{type:"primary",onClick:C},{default:e(()=>[I]),_:1})]),_:1}),a(h,null,{default:e(()=>[a(v,{modelValue:d(l).plugins,"onUpdate:modelValue":s[0]||(s[0]=t=>d(l).plugins=t)},{default:e(()=>[(g(!0),P(R,null,w(u.value,(t,q)=>(g(),V(E,{key:t.id,label:t.id},{default:e(()=>[i(N(t.name),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])}}});export{G as _};
