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