ValueForm-42f9862a.js 2.7 KB

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