import{d as A,Q as B,r as m,x as E,o as i,A as c,B as s,f as r,a as e,E as y,k as K,c as M,F as Q,R as W,a2 as D,a8 as P,V as Z,S as q,U as z,W as G,K as H,Z as J,__tla as L}from"./index-92ad187a.js";import{_ as N,__tla as O}from"./Dialog-44c9fa34.js";import{b as T,__tla as X}from"./index-54fdad0d.js";import{g as Y,u as $,__tla as aa}from"./index-07d35dd2.js";import{u as ea,__tla as la}from"./useMessage-d9788660.js";let k,ta=Promise.all([(()=>{try{return L}catch{}})(),(()=>{try{return O}catch{}})(),(()=>{try{return X}catch{}})(),(()=>{try{return aa}catch{}})(),(()=>{try{return la}catch{}})()]).then(async()=>{k=A({name:"MpUserForm",__name:"UserForm",emits:["success"],setup(sa,{expose:V,emit:h}){const{t:b}=B(),g=ea(),u=m(!1),o=m(!1),l=m({id:void 0,nickname:void 0,remark:void 0,tagIds:[]}),I=E({}),n=m(),p=m([]);V({open:async d=>{if(u.value=!0,x(),d){o.value=!0;try{l.value=await Y(d)}finally{o.value=!1}}p.value=await T()}});const U=h,w=async()=>{if(n&&await n.value.validate()){o.value=!0;try{await $(l.value),g.success(b("common.updateSuccess")),u.value=!1,U("success")}finally{o.value=!1}}},x=()=>{var d;l.value={id:void 0,nickname:void 0,remark:void 0,tagIds:[]},(d=n.value)==null||d.resetFields()};return(d,t)=>{const f=P,_=Z,F=q,C=z,R=G,v=H,S=N,j=J;return i(),c(S,{modelValue:e(u),"onUpdate:modelValue":t[4]||(t[4]=a=>D(u)?u.value=a:null),title:"\u4FEE\u6539"},{footer:s(()=>[r(v,{disabled:e(o),type:"primary",onClick:w},{default:s(()=>[y("\u786E \u5B9A")]),_:1},8,["disabled"]),r(v,{onClick:t[3]||(t[3]=a=>u.value=!1)},{default:s(()=>[y("\u53D6 \u6D88")]),_:1})]),default:s(()=>[K((i(),c(R,{ref_key:"formRef",ref:n,model:e(l),rules:e(I),"label-width":"80px"},{default:s(()=>[r(_,{label:"\u6635\u79F0",prop:"nickname"},{default:s(()=>[r(f,{modelValue:e(l).nickname,"onUpdate:modelValue":t[0]||(t[0]=a=>e(l).nickname=a),placeholder:"\u8BF7\u8F93\u5165\u6635\u79F0"},null,8,["modelValue"])]),_:1}),r(_,{label:"\u5907\u6CE8",prop:"remark"},{default:s(()=>[r(f,{modelValue:e(l).remark,"onUpdate:modelValue":t[1]||(t[1]=a=>e(l).remark=a),placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"},null,8,["modelValue"])]),_:1}),r(_,{label:"\u6807\u7B7E",prop:"tagIds"},{default:s(()=>[r(C,{modelValue:e(l).tagIds,"onUpdate:modelValue":t[2]||(t[2]=a=>e(l).tagIds=a),clearable:"",multiple:"",placeholder:"\u8BF7\u9009\u62E9\u6807\u7B7E"},{default:s(()=>[(i(!0),M(Q,null,W(e(p),a=>(i(),c(F,{key:a.tagId,label:a.name,value:a.tagId},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[j,e(o)]])]),_:1},8,["modelValue"])}}})});export{k as _,ta as __tla};
