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