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