import{F as k}from"./element-plus.78e68aed.js";import{P as B}from"./index.9547d0cc.js";import{c as C,d as D,e as E}from"./store_order.3b045142.js";import"./lodash.60201f64.js";import{d as m,s as u,r as F,b as O,Z as d,o as b,c as S,U as p,L as A,u as c}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 n=_,i=u(),a=u(),r=F("add"),v=O(()=>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 C({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 D(t):await E(t),(s=a.value)==null||s.close(),n("success")},x=(t="add")=>{var e;r.value=t,(e=a.value)==null||e.open()},R=()=>{n("close")};return f({open:x,setFormData:l,getDetail:w}),(t,e)=>{const s=k;return b(),S("div",P,[p(B,{ref_key:"popupRef",ref:a,title:c(v),async:!0,width:"550px",onConfirm:y,onClose:R},{default:A(()=>[p(s,{ref_key:"formRef",ref:i,model:c(o),"label-width":"90px",rules:c(h)},null,8,["model","rules"])]),_:1},8,["title"])])}}});export{Z as _};
