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