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