import{F as D}from"./element-plus.4a7d92a3.js";import{P as w}from"./index.a19e7573.js";import{a as E,b as x,c as P}from"./user_product_storage_log.cdba7895.js";import{t as R}from"./index.9fc4c153.js";import{d as m,s as l,r as b,b as k,Z as d,o as B,c as L,U as p,L as S,u as r}from"./@vue.18505fe0.js";const U={class:"edit-popup"},A=m({name:"userProductStorageLogEdit"}),Z=m({...A,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(M,{expose:f,emit:_}){const c=_,i=l(),s=l(),u=b("add"),y=k(()=>u.value=="edit"?"\u7F16\u8F91\u7528\u6237\u5546\u54C1\u50A8\u5B58\u64CD\u4F5C\u65E5\u5FD7":"\u65B0\u589E\u7528\u6237\u5546\u54C1\u50A8\u5B58\u64CD\u4F5C\u65E5\u5FD7"),o=d({id:""}),C=d({}),n=async t=>{for(const e in o)t[e]!=null&&t[e]!=null&&(o[e]=t[e]);o.create_time=R(o.create_time,"yyyy-mm-dd hh:MM:ss")},h=async t=>{const e=await E({id:t.id});n(e)},v=async()=>{var e,a;await((e=i.value)==null?void 0:e.validate());const t={...o};u.value=="edit"?await x(t):await P(t),(a=s.value)==null||a.close(),c("success")},F=(t="add")=>{var e;u.value=t,(e=s.value)==null||e.open()},g=()=>{c("close")};return f({open:F,setFormData:n,getDetail:h}),(t,e)=>{const a=D;return B(),L("div",U,[p(w,{ref_key:"popupRef",ref:s,title:r(y),async:!0,width:"550px",onConfirm:v,onClose:g},{default:S(()=>[p(a,{ref_key:"formRef",ref:i,model:r(o),"label-width":"90px",rules:r(C)},null,8,["model","rules"])]),_:1},8,["title"])])}}});export{Z as _};
