ProductPropertyAddForm-d29aa3c5.js 2.0 KB

1
  1. import{d as D,r as u,x as L,w as U,o as p,C as c,A as s,f as n,D as f,a as l,k as j,a2 as q,P as J,a9 as R,V as S,W,J as Z,Z as B,_ as E,__tla as G}from"./index-286756b9.js";import{_ as H,__tla as I}from"./Dialog-4c2de357.js";import{b as K,__tla as M}from"./property-7385b8c3.js";import{u as N,__tla as O}from"./useMessage-084b1e70.js";let y,Q=Promise.all([(()=>{try{return G}catch{}})(),(()=>{try{return I}catch{}})(),(()=>{try{return M}catch{}})(),(()=>{try{return O}catch{}})()]).then(async()=>{y=E(D({name:"ProductPropertyForm",__name:"ProductPropertyAddForm",props:{propertyList:{type:Array,default:()=>{}}},setup(v,{expose:h}){const{t:P}=J(),V=N(),t=u(!1),o=u(!1),r=u({name:""}),b=L({name:[{required:!0,message:"\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),d=u(),_=u([]),w=v;U(()=>w.propertyList,e=>{e&&(_.value=e)},{deep:!0,immediate:!0}),h({open:async()=>{t.value=!0,k()}});const x=async()=>{if(d&&await d.value.validate()){o.value=!0;try{const e=r.value,a=await K(e);_.value.push({id:a,...r.value,values:[]}),V.success(P("common.createSuccess")),t.value=!1}finally{o.value=!1}}},k=()=>{var e;r.value={name:""},(e=d.value)==null||e.resetFields()};return(e,a)=>{const A=R,F=S,g=W,i=Z,C=H,z=B;return p(),c(C,{modelValue:l(t),"onUpdate:modelValue":a[2]||(a[2]=m=>q(t)?t.value=m:null),title:"\u6DFB\u52A0\u5546\u54C1\u5C5E\u6027"},{footer:s(()=>[n(i,{disabled:l(o),type:"primary",onClick:x},{default:s(()=>[f("\u786E \u5B9A")]),_:1},8,["disabled"]),n(i,{onClick:a[1]||(a[1]=m=>t.value=!1)},{default:s(()=>[f("\u53D6 \u6D88")]),_:1})]),default:s(()=>[j((p(),c(g,{ref_key:"formRef",ref:d,model:l(r),rules:l(b),"label-width":"80px"},{default:s(()=>[n(F,{label:"\u5C5E\u6027\u540D\u79F0",prop:"name"},{default:s(()=>[n(A,{modelValue:l(r).name,"onUpdate:modelValue":a[0]||(a[0]=m=>l(r).name=m),placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[z,l(o)]])]),_:1},8,["modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/mall/product/spu/form/ProductPropertyAddForm.vue"]])});export{Q as __tla,y as default};