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