1 |
- import{d as B,i as G,r as m,f as P,o as g,x as b,w as t,g as u,a,n as _,y as J,P as R,W,B as A,ai as E,aj as H,G as K,D as L,J as M,_ as N,__tla as O}from"./index-3fb48822.js";import{_ as Q,__tla as T}from"./Dialog-7d4425a0.js";import{S as p,__tla as X}from"./index-9433e8d9.js";import{u as Y,__tla as Z}from"./useMessage-b6c78c26.js";let S,$=Promise.all([(()=>{try{return O}catch{}})(),(()=>{try{return T}catch{}})(),(()=>{try{return X}catch{}})(),(()=>{try{return Z}catch{}})()]).then(async()=>{S=N(B({name:"ShopForm",__name:"ShopForm",emits:["success"],setup(ee,{expose:w,emit:x}){const{t:i}=G(),v=Y(),o=m(!1),f=m(""),d=m(!1),h=m(""),l=m({id:void 0,name:void 0,status:void 0,merchantId:void 0}),I=P({name:[{required:!0,message:"\u5E97\u94FA\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],status:[{required:!0,message:"\u5E97\u94FA\u72B6\u6001\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],merchantId:[{required:!0,message:"\u5546\u6237id\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),n=m();w({open:async(s,e)=>{if(o.value=!0,f.value=i("action."+s),h.value=s,k(),e){d.value=!0;try{l.value=await p.getShop(e)}finally{d.value=!1}}}});const F=x,U=async()=>{await n.value.validate(),d.value=!0;try{const s=l.value;h.value==="create"?(await p.createShop(s),v.success(i("common.createSuccess"))):(await p.updateShop(s),v.success(i("common.updateSuccess"))),o.value=!1,F("success")}finally{d.value=!1}},k=()=>{var s;l.value={id:void 0,name:void 0,status:void 0,merchantId:void 0},(s=n.value)==null||s.resetFields()};return(s,e)=>{const y=W,c=A,q=E,z=H,C=K,V=L,D=Q,j=M;return g(),b(D,{title:a(f),modelValue:a(o),"onUpdate:modelValue":e[4]||(e[4]=r=>R(o)?o.value=r:null)},{footer:t(()=>[u(V,{onClick:U,type:"primary",disabled:a(d)},{default:t(()=>[_("\u786E \u5B9A")]),_:1},8,["disabled"]),u(V,{onClick:e[3]||(e[3]=r=>o.value=!1)},{default:t(()=>[_("\u53D6 \u6D88")]),_:1})]),default:t(()=>[J((g(),b(C,{ref_key:"formRef",ref:n,model:a(l),rules:a(I),"label-width":"100px"},{default:t(()=>[u(c,{label:"\u5E97\u94FA\u540D\u79F0",prop:"name"},{default:t(()=>[u(y,{modelValue:a(l).name,"onUpdate:modelValue":e[0]||(e[0]=r=>a(l).name=r),placeholder:"\u8BF7\u8F93\u5165\u5E97\u94FA\u540D\u79F0"},null,8,["modelValue"])]),_:1}),u(c,{label:"\u5E97\u94FA\u72B6\u6001",prop:"status"},{default:t(()=>[u(z,{modelValue:a(l).status,"onUpdate:modelValue":e[1]||(e[1]=r=>a(l).status=r)},{default:t(()=>[u(q,{label:"1"},{default:t(()=>[_("\u8BF7\u9009\u62E9\u5B57\u5178\u751F\u6210")]),_:1})]),_:1},8,["modelValue"])]),_:1}),u(c,{label:"\u5546\u6237id",prop:"merchantId"},{default:t(()=>[u(y,{modelValue:a(l).merchantId,"onUpdate:modelValue":e[2]||(e[2]=r=>a(l).merchantId=r),placeholder:"\u8BF7\u8F93\u5165\u5546\u6237id"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[j,a(d)]])]),_:1},8,["title","modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/system/sale/shop/ShopForm.vue"]])});export{$ as __tla,S as default};
|