MerchantStoreFrom-739cb4f0.js 2.9 KB

1
  1. import{d as q,y as B,e as D,Q as M,r,x as A,b as L,k as O,a as t,o as P,A as Q,B as l,f as a,a8 as R,V as W,I as Z,L as z,W as C,Z as E,__tla as G}from"./index-27238c60.js";import{_ as H,__tla as J}from"./UploadImg-83a97d9f.js";import{S as i,__tla as K}from"./index-3054a39e.js";import{u as N,__tla as T}from"./useMessage-b164220c.js";import{_ as X}from"./_plugin-vue_export-helper-1b428a4d.js";import{__tla as Y}from"./index-c750f61a.js";import{__tla as $}from"./el-image-viewer-1aec1b1e.js";let v,ee=Promise.all([(()=>{try{return G}catch{}})(),(()=>{try{return J}catch{}})(),(()=>{try{return K}catch{}})(),(()=>{try{return T}catch{}})(),(()=>{try{return Y}catch{}})(),(()=>{try{return $}catch{}})()]).then(async()=>{v=X(q({name:"SystemUserForm",__name:"MerchantStoreFrom",props:{obj:{type:Object,default:()=>({})},isDetail:{type:Boolean,default:!1}},emits:["success"],setup(p,{expose:g,emit:w}){const V=B();D(()=>V.getMobile);const{t:f}=M(),b=N(),U=r(!1);r("");const m=r(!1),S=r(""),e=r({name:"",id:void 0,status:1,merchantId:0,logoUrl:"",website:""}),j=A({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"}]}),n=p;r("create"),r(0);const d=r(),I=w;return g({submitForm:async()=>{if(d&&await d.value.validate()){m.value=!0;try{const o=e.value;return S.value==="create"?(await i.createShop(o),b.success(f("common.createSuccess"))):(await i.updateShop(o),b.success(f("common.updateSuccess"))),U.value=!1,I("success"),!0}finally{m.value=!1}}}}),L(()=>{var o;e.value.merchantId=n.obj.merchantId,e.value.id=n.obj.id,e.value={name:"",id:void 0,status:1,merchantId:0,logoUrl:""},(o=d.value)==null||o.resetFields(),(async()=>i.getShop(n.obj.id).then(s=>{e.value=s}))()}),(o,s)=>{const h=R,c=W,_=Z,y=z,x=H,F=C,k=E;return O((P(),Q(F,{ref_key:"formRef",ref:d,model:t(e),rules:t(j),"label-width":"120px",style:{padding:"10px"},disabled:p.isDetail},{default:l(()=>[a(y,null,{default:l(()=>[a(_,{span:12},{default:l(()=>[a(c,{label:"\u5E97\u94FA\u540D",prop:"name"},{default:l(()=>[a(h,{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(_,{span:12},{default:l(()=>[a(c,{label:"\u5E97\u94FA\u57DF\u540D",prop:"website"},{default:l(()=>[a(h,{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(_,{span:24},{default:l(()=>[a(c,{label:"\u9996\u9875\u56FE\u7247"},{default:l(()=>[a(x,{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"])),[[k,t(m)]])}}}),[["__scopeId","data-v-5b3a6838"]])});export{ee as __tla,v as default};