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