ShopForm-57285a89.js 3.3 KB

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