import{d as D,i as S,r as m,f as B,o as b,x as w,w as r,g as n,a,q as V,y as j,Q as G,X as J,B as M,G as Q,D as R,J as X,_ as A,__tla as E}from"./index-7d5b26d3.js";import{_ as H,__tla as I}from"./Dialog-2be588df.js";import{g as K,b as L,f as N,__tla as O}from"./property-308ebf05.js";import{u as T,__tla as W}from"./useMessage-c81eaa5b.js";let h,Y=Promise.all([(()=>{try{return E}catch{}})(),(()=>{try{return I}catch{}})(),(()=>{try{return O}catch{}})(),(()=>{try{return W}catch{}})()]).then(async()=>{h=A(D({name:"ProductPropertyForm",__name:"PropertyForm",emits:["success"],setup(Z,{expose:x,emit:k}){const{t:d}=S(),i=T(),s=m(!1),_=m(""),u=m(!1),p=m(""),t=m({id:void 0,name:""}),g=B({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,U(),e){u.value=!0;try{t.value=await K(e)}finally{u.value=!1}}}});const P=k,F=async()=>{if(c&&await c.value.validate()){u.value=!0;try{const l=t.value;p.value==="create"?(await L(l),i.success(d("common.createSuccess"))):(await N(l),i.success(d("common.updateSuccess"))),s.value=!1,P("success")}finally{u.value=!1}}},U=()=>{var l;t.value={id:void 0,name:""},(l=c.value)==null||l.resetFields()};return(l,e)=>{const f=J,v=M,q=Q,y=R,z=H,C=X;return b(),w(z,{modelValue:a(s),"onUpdate:modelValue":e[3]||(e[3]=o=>G(s)?s.value=o:null),title:a(_)},{footer:r(()=>[n(y,{disabled:a(u),type:"primary",onClick:F},{default:r(()=>[V("\u786E \u5B9A")]),_:1},8,["disabled"]),n(y,{onClick:e[2]||(e[2]=o=>s.value=!1)},{default:r(()=>[V("\u53D6 \u6D88")]),_:1})]),default:r(()=>[j((b(),w(q,{ref_key:"formRef",ref:c,model:a(t),rules:a(g),"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"])),[[C,a(u)]])]),_:1},8,["modelValue","title"])}}}),[["__file","D:/zx/mall-newfeifan-zx-business/src/views/mall/product/property/PropertyForm.vue"]])});export{Y as __tla,h as default};
