MerchantStoreFrom-2a3a5c80.js 3.5 KB

1
  1. import{d as R,Y,K as L,h as P,r as u,e as W,o as S,v as U,w as l,f as t,a,n as x,x as B,O as G,V as H,A as J,E as N,i as Q,D as T,C as X,I as Z,_ as $,__tla as ee}from"./index-8e30b17f.js";import{_ as ae,__tla as le}from"./Dialog-9917188a.js";import{_ as te,__tla as se}from"./UploadImg-1c51a097.js";import{S as p,__tla as re}from"./index-b9eb558c.js";import{u as ue,__tla as oe}from"./useMessage-ee50bd51.js";import{__tla as de}from"./index-7d9ab767.js";import{__tla as ne}from"./el-image-viewer-fb97741c.js";let I,me=Promise.all([(()=>{try{return ee}catch{}})(),(()=>{try{return le}catch{}})(),(()=>{try{return se}catch{}})(),(()=>{try{return re}catch{}})(),(()=>{try{return oe}catch{}})(),(()=>{try{return de}catch{}})(),(()=>{try{return ne}catch{}})()]).then(async()=>{I=$(R({name:"SystemUserForm",__name:"MerchantStoreFrom",emits:["success"],setup(ce,{expose:F,emit:k}){const C=Y();L(()=>C.getMobile);const{t:f}=P(),c=ue(),n=u(!1),v=u(""),o=u(!1),y=u(""),e=u({name:"",id:void 0,status:1,merchantId:0,logoUrl:""}),M=W({name:[{required:!0,message:"\u5E97\u94FA\u540D\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),V=u(!1),z=u("create");u(0),F({open:async(s,r,_)=>{if(z.value=s,v.value=f("action."+s),s=="view"&&(v.value="\u67E5\u770B"),V.value=s=="view",n.value=!0,y.value=s,q(),r.id){o.value=!0;try{p.getShop(r.id).then(m=>{e.value=m})}finally{o.value=!1}}e.value.merchantId=_,e.value.id=r.id}});const i=u(),w=k,D=async()=>{if(i&&await i.value.validate()){o.value=!0;try{const s=e.value;y.value==="create"?(await p.createShop(s),c.success(f("common.createSuccess"))):(await p.updateShop(s),c.success(f("common.updateSuccess"))),n.value=!1,w("success")}finally{o.value=!1}}},j=async()=>{await c.confirm("\u662F\u5426\u786E\u8BA4\u5220\u9664"+e.value.name+"\uFF1F");try{await p.deleteShop(e.value.id)}catch{o.value=!1}n.value=!1,c.success("\u5220\u9664\u6210\u529F"),w("success")},q=()=>{var s;e.value={name:"",id:void 0,status:1,merchantId:0,logoUrl:""},(s=i.value)==null||s.resetFields()};return(s,r)=>{const _=H,m=J,h=N,b=Q,A=te,E=T,g=X,K=ae,O=Z;return S(),U(K,{title:a(v),modelValue:a(n),"onUpdate:modelValue":r[3]||(r[3]=d=>G(n)?n.value=d:null),width:"70%"},{footer:l(()=>[t(g,{disabled:a(o),type:"danger",onClick:j},{default:l(()=>[x("\u5220\u9664")]),_:1},8,["disabled"]),t(g,{disabled:a(o),type:"primary",onClick:D},{default:l(()=>[x("\u4FDD\u5B58")]),_:1},8,["disabled"])]),default:l(()=>[B((S(),U(E,{ref_key:"formRef",ref:i,model:a(e),rules:a(M),"label-width":"120px",style:{padding:"10px"},disabled:a(V)},{default:l(()=>[t(b,null,{default:l(()=>[t(h,{span:12},{default:l(()=>[t(m,{label:"\u5E97\u94FA\u540D",prop:"name"},{default:l(()=>[t(_,{modelValue:a(e).name,"onUpdate:modelValue":r[0]||(r[0]=d=>a(e).name=d),placeholder:"\u8BF7\u8F93\u5165\u5E97\u94FA\u540D"},null,8,["modelValue"])]),_:1})]),_:1}),t(h,{span:12},{default:l(()=>[t(m,{label:"\u5E97\u94FA\u57DF\u540D",prop:"name"},{default:l(()=>[t(_,{modelValue:a(e).name,"onUpdate:modelValue":r[1]||(r[1]=d=>a(e).name=d),placeholder:"\u8BF7\u8F93\u5165\u5E97\u94FA\u57DF\u540D"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),t(b,null,{default:l(()=>[t(h,{span:24},{default:l(()=>[t(m,{label:"\u9996\u9875\u56FE\u7247"},{default:l(()=>[t(A,{modelValue:a(e).logoUrl,"onUpdate:modelValue":r[2]||(r[2]=d=>a(e).logoUrl=d),limit:1,"is-show-tip":!1},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules","disabled"])),[[O,a(o)]])]),_:1},8,["title","modelValue"])}}}),[["__scopeId","data-v-aaae34f1"],["__file","D:/zx/mall-newfeifan-zx-admin/src/views/system/sale/merchant/components/MerchantStoreFrom.vue"]])});export{me as __tla,I as default};