PropertyForm-7a4ea0d3.js 2.3 KB

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