import{F as b}from"./element-plus.a63a26dd.js";import{P as k}from"./index.c69e7fd7.js";import{i as B,p as C,b as D}from"./store_order.1334fb6f.js";import"./lodash.2473fc51.js";import{d as m,s as u,r as E,b as F,Z as p,o as O,c as S,U as d,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=p({id:""}),h=p({}),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")},x=(t="add")=>{var e;r.value=t,(e=a.value)==null||e.open()},R=()=>{c("close")};return f({open:x,setFormData:l,getDetail:w}),(t,e)=>{const s=b;return O(),S("div",P,[d(k,{ref_key:"popupRef",ref:a,title:n(v),async:!0,width:"550px",onConfirm:y,onClose:R},{default:A(()=>[d(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 _};
