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