1 |
- import{d as R,X,J as A,h as D,r as u,e as P,o as U,q as S,w as l,f as t,a,m as x,v as G,N as K,U as L,z as O,E as Q,i as T,C as W,B as Y,H as Z,__tla as $}from"./index-2eab2d23.js";import{_ as ee,__tla as ae}from"./Dialog-c2716df6.js";import{_ as le,__tla as te}from"./UploadImg-90fe71c2.js";import{S as p,__tla as se}from"./index-d43c56c7.js";import{u as re,__tla as ue}from"./useMessage-171aa63e.js";import{_ as oe}from"./_plugin-vue_export-helper-1b428a4d.js";import{__tla as de}from"./index-d3f876ab.js";import{__tla as ie}from"./el-image-viewer-5d14bc77.js";let I,me=Promise.all([(()=>{try{return $}catch{}})(),(()=>{try{return ae}catch{}})(),(()=>{try{return te}catch{}})(),(()=>{try{return se}catch{}})(),(()=>{try{return ue}catch{}})(),(()=>{try{return de}catch{}})(),(()=>{try{return ie}catch{}})()]).then(async()=>{I=oe(R({name:"SystemUserForm",__name:"MerchantStoreFrom",emits:["success"],setup(ce,{expose:k,emit:q}){const C=X();A(()=>C.getMobile);const{t:f}=D(),c=re(),i=u(!1),v=u(""),o=u(!1),y=u(""),e=u({name:"",id:void 0,status:1,merchantId:0,logoUrl:"",website:""}),F=P({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"}]}),b=u(!1),M=u("create");u(0),k({open:async(s,r,_)=>{if(M.value=s,v.value=f("action."+s),s=="view"&&(v.value="\u67E5\u770B"),b.value=s=="view",i.value=!0,y.value=s,B(),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 n=u(),g=q,j=async()=>{if(n&&await n.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"))),i.value=!1,g("success")}finally{o.value=!1}}},z=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}i.value=!1,c.success("\u5220\u9664\u6210\u529F"),g("success")},B=()=>{var s;e.value={name:"",id:void 0,status:1,merchantId:0,logoUrl:""},(s=n.value)==null||s.resetFields()};return(s,r)=>{const _=L,m=O,h=Q,w=T,E=le,H=W,V=Y,J=ee,N=Z;return U(),S(J,{title:a(v),modelValue:a(i),"onUpdate:modelValue":r[3]||(r[3]=d=>K(i)?i.value=d:null),width:"70%"},{footer:l(()=>[t(V,{disabled:a(o),type:"danger",onClick:z},{default:l(()=>[x("\u5220\u9664")]),_:1},8,["disabled"]),t(V,{disabled:a(o),type:"primary",onClick:j},{default:l(()=>[x("\u4FDD\u5B58")]),_:1},8,["disabled"])]),default:l(()=>[G((U(),S(H,{ref_key:"formRef",ref:n,model:a(e),rules:a(F),"label-width":"120px",style:{padding:"10px"},disabled:a(b)},{default:l(()=>[t(w,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:"website"},{default:l(()=>[t(_,{modelValue:a(e).website,"onUpdate:modelValue":r[1]||(r[1]=d=>a(e).website=d),placeholder:"\u8BF7\u8F93\u5165\u5E97\u94FA\u57DF\u540D"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),t(w,null,{default:l(()=>[t(h,{span:24},{default:l(()=>[t(m,{label:"\u9996\u9875\u56FE\u7247"},{default:l(()=>[t(E,{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"])),[[N,a(o)]])]),_:1},8,["title","modelValue"])}}}),[["__scopeId","data-v-10f4e4df"]])});export{me as __tla,I as default};
|