import{d as j,n as q,r as m,f as A,o as w,l as V,w as r,i as n,a,j as h,C as O,y as D,U as E,H as G,K as J,J as K,N,_ as R,__tla as z}from"./index-2c56227b.js";import{_ as B,__tla as I}from"./Dialog-1050d437.js";import{g as L,b as M,f as Q,__tla as T}from"./property-c77cd070.js";import{u as W,__tla as X}from"./useMessage-96878a4a.js";let b,Y=Promise.all([(()=>{try{return z}catch{}})(),(()=>{try{return I}catch{}})(),(()=>{try{return T}catch{}})(),(()=>{try{return X}catch{}})()]).then(async()=>{b=R(j({name:"ProductPropertyForm",__name:"PropertyForm",emits:["success"],setup(Z,{expose:k,emit:P}){const{t:c}=q(),i=W(),s=m(!1),_=m(""),u=m(!1),p=m(""),t=m({id:void 0,name:""}),g=A({name:[{required:!0,message:"\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),d=m();k({open:async(l,e)=>{if(s.value=!0,_.value=c("action."+l),p.value=l,U(),e){u.value=!0;try{t.value=await L(e)}finally{u.value=!1}}}});const x=P,F=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 Q(l),i.success(c("common.updateSuccess"))),s.value=!1,x("success")}finally{u.value=!1}}},U=()=>{var l;t.value={id:void 0,name:""},(l=d.value)==null||l.resetFields()};return(l,e)=>{const f=E,v=G,C=J,y=K,H=B,S=N;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:F},{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(()=>[O((w(),V(C,{ref_key:"formRef",ref:d,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"])),[[S,a(u)]])]),_:1},8,["modelValue","title"])}}}),[["__file","E:/GAOHP_2023/mall/newfeifan-front/yudao-ui-admin-vue3/src/views/mall/product/property/PropertyForm.vue"]])});export{Y as __tla,b as default};
