import{F as k}from"./element-plus.78e68aed.js";import{P as C}from"./index.d2805ba2.js";import{x as D,y as E,z as F}from"./index.de0baa52.js";import"./lodash.60201f64.js";import{d as m,s as u,r as b,b as U,Z as p,o as B,c as P,U as d,L as g,u as c}from"./@vue.18505fe0.js";const j={class:"edit-popup"},z=m({name:"userEdit"}),V=m({...z,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(A,{expose:f,emit:_}){const r=_,i=u(),a=u(),n=b("add"),v=U(()=>n.value=="edit"?"\u7F16\u8F91\u7528\u6237\u8868":"\u65B0\u589E\u7528\u6237\u8868"),o=p({id:""}),y=p({}),l=async t=>{for(const e in o)t[e]!=null&&t[e]!=null&&(o[e]=t[e])},h=async t=>{const e=await D({id:t.id});l(e)},w=async()=>{var e,s;await((e=i.value)==null?void 0:e.validate());const t={...o};n.value=="edit"?await E(t):await F(t),(s=a.value)==null||s.close(),r("success")},x=(t="add")=>{var e;n.value=t,(e=a.value)==null||e.open()},R=()=>{r("close")};return f({open:x,setFormData:l,getDetail:h}),(t,e)=>{const s=k;return B(),P("div",j,[d(C,{ref_key:"popupRef",ref:a,title:c(v),async:!0,width:"550px",onConfirm:w,onClose:R},{default:g(()=>[d(s,{ref_key:"formRef",ref:i,model:c(o),"label-width":"90px",rules:c(y)},null,8,["model","rules"])]),_:1},8,["title"])])}}});export{V as _};
