MerchantStoreFrom-b146a6d0.js 2.9 KB

1
  1. import{d as M,b as z,e as k,B as q,r,g as B,z as E,D as J,a as t,o as O,k as P,w as l,i as a,Y as R,I as Y,E as A,p as C,J as G,M as H,_ as K,__tla as L}from"./index-2f799233.js";import{_ as N,__tla as Q}from"./UploadImg-d46c0539.js";import{S as _,__tla as T}from"./index-8ff8e589.js";import{u as W,__tla as X}from"./useMessage-e567ad40.js";import{__tla as Z}from"./index-5f6db4a5.js";import{__tla as $}from"./el-image-viewer-8e9e3571.js";let v,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()=>{v=K(M({name:"SystemUserForm",__name:"MerchantStoreFrom",props:{obj:{type:Object,default:()=>({})},isDetail:{type:Boolean,default:!1}},emits:["success"],setup(p,{expose:g,emit:w}){const S=z();k(()=>S.getMobile);const{t:f}=q(),h=W(),U=r(!1);r("");const m=r(!1),V=r(""),e=r({name:"",id:void 0,status:1,merchantId:0,logoUrl:"",website:""}),j=B({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 n=r(),x=w;return g({submitForm:async()=>{if(n&&await n.value.validate()){m.value=!0;try{const o=e.value;return V.value==="create"?(await _.createShop(o),h.success(f("common.createSuccess"))):(await _.updateShop(o),h.success(f("common.updateSuccess"))),U.value=!1,x("success"),!0}finally{m.value=!1}}}}),E(()=>{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=n.value)==null||o.resetFields(),(async()=>_.getShop(d.obj.id).then(s=>{e.value=s}))()}),(o,s)=>{const b=R,c=Y,i=A,y=C,I=N,F=G,D=H;return J((O(),P(F,{ref_key:"formRef",ref:n,model:t(e),rules:t(j),"label-width":"120px",style:{padding:"10px"},disabled:p.isDetail},{default:l(()=>[a(y,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(y,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(m)]])}}}),[["__scopeId","data-v-aaae34f1"],["__file","D:/zx/mall-newfeifan-zx-business/src/views/system/sale/merchant/components/MerchantStoreFrom.vue"]])});export{ee as __tla,v as default};