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