import{C as x,D as R,F as g}from"./element-plus.73c9e9a6.js";import{P as k}from"./index.fa58e261.js";import{a as L,b as V,c as G}from"./goods_label.0c2c9a3d.js";import"./lodash.403d4198.js";import{d as f,s as p,r as q,b as I,Z as m,o as P,c as U,U as l,L as r,u as a}from"./@vue.663bc523.js";const j={class:"edit-popup"},A=f({name:"goodsLabelEdit"}),H=f({...A,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(N,{expose:_,emit:b}){const c=b,i=p(),u=p(),n=q("add"),E=I(()=>n.value=="edit"?"\u7F16\u8F91\u5546\u54C1\u6807\u7B7E":"\u65B0\u589E\u5546\u54C1\u6807\u7B7E"),t=m({id:"",name:""}),v=m({name:[{required:!0,message:"\u8BF7\u8F93\u5165\u6807\u7B7E\u540D",trigger:"blur"}]}),d=async o=>{for(const e in t)o[e]!=null&&o[e]!=null&&(t[e]=o[e])},F=async o=>{const e=await L({id:o.id});d(e)},y=async()=>{var e,s;await((e=i.value)==null?void 0:e.validate());const o={...t};n.value=="edit"?await V(o):await G(o),(s=u.value)==null||s.close(),c("success")},B=(o="add")=>{var e;n.value=o,(e=u.value)==null||e.open()},w=()=>{c("close")};return _({open:B,setFormData:d,getDetail:F}),(o,e)=>{const s=x,C=R,D=g;return P(),U("div",j,[l(k,{ref_key:"popupRef",ref:u,title:a(E),async:!0,width:"550px",onConfirm:y,onClose:w},{default:r(()=>[l(D,{ref_key:"formRef",ref:i,model:a(t),"label-width":"90px",rules:a(v)},{default:r(()=>[l(C,{label:"\u6807\u7B7E\u540D",prop:"name",required:""},{default:r(()=>[l(s,{modelValue:a(t).name,"onUpdate:modelValue":e[0]||(e[0]=h=>a(t).name=h),clearable:"",placeholder:"\u8BF7\u8F93\u5165",readonly:!1},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{H as _};
