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