ShopStatusForm-398602e7.js 2.6 KB

1
  1. import{ar as r,d as q,i as B,r as d,f as G,o as w,x as g,w as i,g as c,a as s,n as x,y as J,P as R,W as T,B as W,G as A,D as E,J as H,_ as I,__tla as K}from"./index-b362e1d5.js";import{_ as L,__tla as N}from"./Dialog-71bebaff.js";import{u as Q,__tla as X}from"./useMessage-7c1dd10e.js";let S,n,b,Y=Promise.all([(()=>{try{return K}catch{}})(),(()=>{try{return N}catch{}})(),(()=>{try{return X}catch{}})()]).then(async()=>{n={getShopStatusPage:async a=>await r.get({url:"/sale/shop-status/page",params:a}),getShopStatus:async a=>await r.get({url:"/sale/shop-status/get?id="+a}),createShopStatus:async a=>await r.post({url:"/sale/shop-status/create",data:a}),updateShopStatus:async a=>await r.put({url:"/sale/shop-status/update",data:a}),deleteShopStatus:async a=>await r.delete({url:"/sale/shop-status/delete?id="+a}),exportShopStatus:async a=>await r.download({url:"/sale/shop-status/export-excel",params:a})},S=I(q({name:"ShopStatusForm",__name:"ShopStatusForm",emits:["success"],setup(a,{expose:V,emit:F}){const{t:m}=B(),h=Q(),l=d(!1),v=d(""),u=d(!1),y=d(""),o=d({id:void 0,name:void 0}),P=G({name:[{required:!0,message:"\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),_=d();V({open:async(e,t)=>{if(l.value=!0,v.value=m("action."+e),y.value=e,j(),t){u.value=!0;try{o.value=await n.getShopStatus(t)}finally{u.value=!1}}}});const k=F,z=async()=>{await _.value.validate(),u.value=!0;try{const e=o.value;y.value==="create"?(await n.createShopStatus(e),h.success(m("common.createSuccess"))):(await n.updateShopStatus(e),h.success(m("common.updateSuccess"))),l.value=!1,k("success")}finally{u.value=!1}},j=()=>{var e;o.value={id:void 0,name:void 0},(e=_.value)==null||e.resetFields()};return(e,t)=>{const C=T,D=W,O=A,f=E,M=L,U=H;return w(),g(M,{title:s(v),modelValue:s(l),"onUpdate:modelValue":t[2]||(t[2]=p=>R(l)?l.value=p:null)},{footer:i(()=>[c(f,{onClick:z,type:"primary",disabled:s(u)},{default:i(()=>[x("\u786E \u5B9A")]),_:1},8,["disabled"]),c(f,{onClick:t[1]||(t[1]=p=>l.value=!1)},{default:i(()=>[x("\u53D6 \u6D88")]),_:1})]),default:i(()=>[J((w(),g(O,{ref_key:"formRef",ref:_,model:s(o),rules:s(P),"label-width":"100px"},{default:i(()=>[c(D,{label:"\u540D\u79F0",prop:"name"},{default:i(()=>[c(C,{modelValue:s(o).name,"onUpdate:modelValue":t[0]||(t[0]=p=>s(o).name=p),placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[U,s(u)]])]),_:1},8,["title","modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/system/sale/shopstatus/ShopStatusForm.vue"]]),b=Object.freeze(Object.defineProperty({__proto__:null,default:S},Symbol.toStringTag,{value:"Module"}))});export{S,Y as __tla,n as a,b};