import{F as y}from"./element-plus.4a7d92a3.js";import{P as C}from"./index.66d65d7d.js";import{b as x,c as R,d as b}from"./store_finance_flow.146b9230.js";import"./lodash.9dc701ad.js";import{d as m,s as r,r as k,b as S,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"},A=m({name:"storeFinanceFlowEdit"}),Z=m({...A,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(L,{expose:f,emit:_}){const u=_,i=r(),s=r(),n=k("add"),F=S(()=>n.value=="edit"?"\u7F16\u8F91\u95E8\u5E97\u8D44\u91D1\u6D41\u6C34\u8868":"\u65B0\u589E\u95E8\u5E97\u8D44\u91D1\u6D41\u6C34\u8868"),t=p({id:""}),w=p({}),l=async o=>{for(const e in t)o[e]!=null&&o[e]!=null&&(t[e]=o[e])},D=async o=>{const e=await x({id:o.id});l(e)},v=async()=>{var e,a;await((e=i.value)==null?void 0:e.validate());const o={...t};n.value=="edit"?await R(o):await b(o),(a=s.value)==null||a.close(),u("success")},E=(o="add")=>{var e;n.value=o,(e=s.value)==null||e.open()},h=()=>{u("close")};return f({open:E,setFormData:l,getDetail:D}),(o,e)=>{const a=y;return B(),P("div",j,[d(C,{ref_key:"popupRef",ref:s,title:c(F),async:!0,width:"550px",onConfirm:v,onClose:h},{default:g(()=>[d(a,{ref_key:"formRef",ref:i,model:c(t),"label-width":"90px",rules:c(w)},null,8,["model","rules"])]),_:1},8,["title"])])}}});export{Z as _};
