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