MerchantStoreFrom-ba314165.js 2.9 KB

1
  1. import{d as M,Y as k,K as q,h as z,r,e as K,k as A,x as B,a as t,o as E,v as O,w as l,f as a,V as P,A as R,E as Y,i as C,D as G,I as H,_ as J,__tla as L}from"./index-430b3151.js";import{_ as N,__tla as Q}from"./UploadImg-2f818d4f.js";import{S as _,__tla as T}from"./index-4d4ee646.js";import{u as W,__tla as X}from"./useMessage-d226ba89.js";import{__tla as Z}from"./index-255e3b1c.js";import{__tla as $}from"./el-image-viewer-467ebe35.js";let y,ee=Promise.all([(()=>{try{return L}catch{}})(),(()=>{try{return Q}catch{}})(),(()=>{try{return T}catch{}})(),(()=>{try{return X}catch{}})(),(()=>{try{return Z}catch{}})(),(()=>{try{return $}catch{}})()]).then(async()=>{y=J(M({name:"SystemUserForm",__name:"MerchantStoreFrom",props:{obj:{type:Object,default:()=>({})},isDetail:{type:Boolean,default:!1}},emits:["success"],setup(p,{expose:g,emit:w}){const V=k();q(()=>V.getMobile);const{t:f}=z(),h=W(),S=r(!1);r("");const n=r(!1),U=r(""),e=r({name:"",id:void 0,status:1,merchantId:0,logoUrl:"",website:""}),x=K({name:[{required:!0,message:"\u5E97\u94FA\u540D\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],logoUrl:[{required:!0,message:"\u5E97\u94FA\u540D\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),d=p;r("create"),r(0);const m=r(),j=w;return g({submitForm:async()=>{if(m&&await m.value.validate()){n.value=!0;try{const o=e.value;return U.value==="create"?(await _.createShop(o),h.success(f("common.createSuccess"))):(await _.updateShop(o),h.success(f("common.updateSuccess"))),S.value=!1,j("success"),!0}finally{n.value=!1}}}}),A(()=>{var o;e.value.merchantId=d.obj.merchantId,e.value.id=d.obj.id,e.value={name:"",id:void 0,status:1,merchantId:0,logoUrl:""},(o=m.value)==null||o.resetFields(),(async()=>_.getShop(d.obj.id).then(s=>{e.value=s}))()}),(o,s)=>{const b=P,c=R,i=Y,v=C,I=N,F=G,D=H;return B((E(),O(F,{ref_key:"formRef",ref:m,model:t(e),rules:t(x),"label-width":"120px",style:{padding:"10px"},disabled:p.isDetail},{default:l(()=>[a(v,null,{default:l(()=>[a(i,{span:12},{default:l(()=>[a(c,{label:"\u5E97\u94FA\u540D",prop:"name"},{default:l(()=>[a(b,{modelValue:t(e).name,"onUpdate:modelValue":s[0]||(s[0]=u=>t(e).name=u),placeholder:"\u8BF7\u8F93\u5165\u5E97\u94FA\u540D"},null,8,["modelValue"])]),_:1})]),_:1}),a(i,{span:12},{default:l(()=>[a(c,{label:"\u5E97\u94FA\u57DF\u540D",prop:"website"},{default:l(()=>[a(b,{modelValue:t(e).website,"onUpdate:modelValue":s[1]||(s[1]=u=>t(e).website=u),placeholder:"\u8BF7\u8F93\u5165\u5E97\u94FA\u57DF\u540D"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),a(v,null,{default:l(()=>[a(i,{span:24},{default:l(()=>[a(c,{label:"\u9996\u9875\u56FE\u7247"},{default:l(()=>[a(I,{modelValue:t(e).logoUrl,"onUpdate:modelValue":s[2]||(s[2]=u=>t(e).logoUrl=u),limit:1,"is-show-tip":!1},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules","disabled"])),[[D,t(n)]])}}}),[["__scopeId","data-v-aaae34f1"],["__file","D:/zx/mall-newfeifan-zx-admin/src/views/system/sale/merchant/components/MerchantStoreFrom.vue"]])});export{ee as __tla,y as default};