import{d as S,h as q,r as m,e as A,o as V,v as h,w as r,f as n,a,n as w,x as I,P as j,W as R,A as W,D as B,C as E,I as G,_ as H,__tla as J}from"./index-04f8d540.js";import{_ as K,__tla as L}from"./Dialog-9afb5ba5.js";import{g as M,b as N,f as O,__tla as Q}from"./property-39a7ad7a.js";import{u as T,__tla as X}from"./useMessage-9c37e840.js";let b,Y=Promise.all([(()=>{try{return J}catch{}})(),(()=>{try{return L}catch{}})(),(()=>{try{return Q}catch{}})(),(()=>{try{return X}catch{}})()]).then(async()=>{b=H(S({name:"ProductPropertyForm",__name:"PropertyForm",emits:["success"],setup(Z,{expose:x,emit:k}){const{t:d}=q(),i=T(),s=m(!1),_=m(""),u=m(!1),p=m(""),t=m({id:void 0,name:""}),P=A({name:[{required:!0,message:"\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),c=m();x({open:async(l,e)=>{if(s.value=!0,_.value=d("action."+l),p.value=l,C(),e){u.value=!0;try{t.value=await M(e)}finally{u.value=!1}}}});const g=k,F=async()=>{if(c&&await c.value.validate()){u.value=!0;try{const l=t.value;p.value==="create"?(await N(l),i.success(d("common.createSuccess"))):(await O(l),i.success(d("common.updateSuccess"))),s.value=!1,g("success")}finally{u.value=!1}}},C=()=>{var l;t.value={id:void 0,name:""},(l=c.value)==null||l.resetFields()};return(l,e)=>{const f=R,v=W,U=B,y=E,z=K,D=G;return V(),h(z,{modelValue:a(s),"onUpdate:modelValue":e[3]||(e[3]=o=>j(s)?s.value=o:null),title:a(_)},{footer:r(()=>[n(y,{disabled:a(u),type:"primary",onClick:F},{default:r(()=>[w("\u786E \u5B9A")]),_:1},8,["disabled"]),n(y,{onClick:e[2]||(e[2]=o=>s.value=!1)},{default:r(()=>[w("\u53D6 \u6D88")]),_:1})]),default:r(()=>[I((V(),h(U,{ref_key:"formRef",ref:c,model:a(t),rules:a(P),"label-width":"80px"},{default:r(()=>[n(v,{label:"\u540D\u79F0",prop:"name"},{default:r(()=>[n(f,{modelValue:a(t).name,"onUpdate:modelValue":e[0]||(e[0]=o=>a(t).name=o),placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0"},null,8,["modelValue"])]),_:1}),n(v,{label:"\u5907\u6CE8",prop:"remark"},{default:r(()=>[n(f,{modelValue:a(t).remark,"onUpdate:modelValue":e[1]||(e[1]=o=>a(t).remark=o),placeholder:"\u8BF7\u8F93\u5165\u5185\u5BB9",type:"textarea"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[D,a(u)]])]),_:1},8,["modelValue","title"])}}}),[["__file","D:/zx/mall-newfeifan-zx-business/src/views/mall/product/property/PropertyForm.vue"]])});export{Y as __tla,b as default};
