MerchantUserTab-c89f8fc8.js 5.7 KB

1
  1. import{d as Q,P as W,r,a4 as X,o as n,C as _,a_ as Y,a,A as u,B as w,D as k,a3 as i,E as $,k as N,f as C,a2 as D,aa,ab as ea,J as ta,Z as sa,_ as ra,__tla as la}from"./index-54aa57d8.js";import{_ as oa,__tla as na}from"./ContentWrap-260746ab.js";import{_ as _a,__tla as ca}from"./SPuUploadImg-d377301f.js";import{_ as ua,__tla as ia}from"./Dialog-7bb778a5.js";import ma,{__tla as da}from"./MerchantUserForm-f745f2a8.js";import fa,{__tla as ya}from"./MerchantUserAssignRoleForm-a897faa7.js";import{C as v}from"./constants-c811e5ff.js";import{d as pa,e as va,r as ha,__tla as ga}from"./index-050fcf20.js";import{c as x,__tla as ba}from"./permission-1c0fa4cd.js";import{u as ka,__tla as wa}from"./useMessage-f56cafbb.js";import{__tla as Ea}from"./el-card-e7d6628c.js";import{__tla as Aa}from"./SPuUploadImg.vue_vue_type_style_index_0_scoped_ba706063_lang-03e554d4.js";import{__tla as Va}from"./index-1a846221.js";import{__tla as Ca}from"./el-image-viewer-ec0edec4.js";import{__tla as Da}from"./dict-573b3b04.js";import{__tla as xa}from"./index-b3e8e609.js";import{__tla as Ba}from"./formatTime-e6197688.js";import{__tla as ja}from"./index-9e4bebda.js";import{__tla as Ia}from"./index-81a68108.js";let T,La=Promise.all([(()=>{try{return la}catch{}})(),(()=>{try{return na}catch{}})(),(()=>{try{return ca}catch{}})(),(()=>{try{return ia}catch{}})(),(()=>{try{return da}catch{}})(),(()=>{try{return ya}catch{}})(),(()=>{try{return ga}catch{}})(),(()=>{try{return ba}catch{}})(),(()=>{try{return wa}catch{}})(),(()=>{try{return Ea}catch{}})(),(()=>{try{return Aa}catch{}})(),(()=>{try{return Va}catch{}})(),(()=>{try{return Ca}catch{}})(),(()=>{try{return Da}catch{}})(),(()=>{try{return xa}catch{}})(),(()=>{try{return Ba}catch{}})(),(()=>{try{return ja}catch{}})(),(()=>{try{return Ia}catch{}})()]).then(async()=>{let B,j,I,L;B={class:"left"},j={class:"right"},I=w("div",{style:{clear:"both"}},null,-1),L={class:"dialog-footer"},T=ra(Q({__name:"MerchantUserTab",emits:["success"],setup(Ra,{expose:z,emit:P}){const{t:E}=W(),m=ka(),d=r(!1),s=r("info"),c=r(!1),A=r(""),l=r(!1),f=r("create"),o=r({}),V=r(0),y=r("avatar");z({open:async(e,t,p)=>{t.avatar==""?y.value="https://mall-ffkj.oss-cn-guangzhou.aliyuncs.com/2e05b76706334aef023b85ec6aef6ffd4615aae3d06f302aa7d273e97f263025.png":y.value=t.avatar,s.value="info",o.value=t,V.value=p,f.value=e,A.value=E("action."+e),e=="view"&&(A.value="\u67E5\u770B"),l.value=e=="view",c.value=!0}});const h=P,R=r(),S=async()=>{var e;await((e=R.value)==null?void 0:e.submitForm())&&(h("success"),c.value=!1)},U=r(),M=async()=>{var e;await((e=U.value)==null?void 0:e.submitForm())&&(h("success"),c.value=!1)},J=async()=>{const e=o.value;try{const t=e.status===v.ENABLE?"\u505C\u7528":"\u542F\u7528";await m.confirm('\u786E\u8BA4\u8981"'+t+'""'+e.username+'"\u7528\u6237\u5417?'),await pa(e.id,e.status?v.ENABLE:v.DISABLE),m.success(e.username+"\u5DF2"+t),c.value=!1,h("success")}catch{e.status=e.status===v.ENABLE?v.DISABLE:v.ENABLE}},Z=async()=>{try{const e=o.value.id;await m.delConfirm("\u786E\u8BA4\u8981\u5220\u9664"+o.value.username+"\u5417?"),await va(e),m.success(E("common.delSuccess")),c.value=!1,h("success")}catch{}},q=async e=>{try{const t=o.value.id,p=(await m.prompt('\u8BF7\u8F93\u5165"'+o.value.username+'"\u7684\u65B0\u5BC6\u7801',E("common.reminder"))).value;await ha(t,p),m.success("\u4FEE\u6539\u6210\u529F\uFF0C\u65B0\u5BC6\u7801\u662F\uFF1A"+p),c.value=!1,h("success")}catch{}};return(e,t)=>{const p=_a,F=aa,G=ea,H=oa,g=ta,K=sa,O=X("hasPermi");return n(),_(ua,{title:a(A),modelValue:a(c),"onUpdate:modelValue":t[2]||(t[2]=b=>D(c)?c.value=b:null),width:"70%"},Y({default:u(()=>[N((n(),_(H,{style:{"max-height":"400px","min-height":"400px","overflow-y":"auto",border:"none"}},{default:u(()=>[w("div",B,[C(p,{modelValue:a(y),"onUpdate:modelValue":t[0]||(t[0]=b=>D(y)?y.value=b:null),disabled:a(l)},null,8,["modelValue","disabled"]),C(G,{modelValue:a(s),"onUpdate:modelValue":t[1]||(t[1]=b=>D(s)?s.value=b:null),"tab-position":"left",class:"child-tabs"},{default:u(()=>[C(F,{label:"\u57FA\u672C\u4FE1\u606F",name:"info"}),a(f)!="create"?(n(),_(F,{key:0,label:"\u5206\u914D\u89D2\u8272",name:"AssignRoles"})):i("",!0)]),_:1},8,["modelValue"])]),w("div",j,[a(s)=="info"?(n(),_(ma,{key:0,obj:a(o),ref_key:"userFormRef",ref:R,merchantId:a(V),isDetail:a(l),avatar:a(y),openType:a(f)},null,8,["obj","merchantId","isDetail","avatar","openType"])):i("",!0),a(s)=="AssignRoles"?(n(),_(fa,{key:1,obj:a(o),ref_key:"userAssignRoleFormRef",ref:U,merchantId:a(V),isDetail:a(l)},null,8,["obj","merchantId","isDetail"])):i("",!0)]),I]),_:1})),[[K,a(d)]])]),_:2},[a(l)?void 0:{name:"footer",fn:u(()=>[w("div",L,[!a(l)&&a(s)=="info"&&a(x)(["system:user:delete"])&&a(f)!="create"?(n(),_(g,{key:0,loading:a(d),type:"danger",onClick:Z},{default:u(()=>[k("\u5220\u9664")]),_:1},8,["loading"])):i("",!0),a(l)||a(s)!="info"||a(f)=="create"?i("",!0):(n(),_(g,{key:1,type:a(o).status==1?"primary":"danger",loading:a(d),onClick:J},{default:u(()=>[k($(a(o).status==1?"\u542F\u7528":"\u505C\u7528"),1)]),_:1},8,["type","loading"])),!a(l)&&a(s)=="info"&&a(x)(["system:user:update-password"])&&a(f)!="create"?(n(),_(g,{key:2,loading:a(d),type:"primary",onClick:q},{default:u(()=>[k("\u91CD\u7F6E\u5BC6\u7801")]),_:1},8,["loading"])):i("",!0),a(l)||a(s)!="info"?i("",!0):N((n(),_(g,{key:3,loading:a(d),type:"primary",onClick:S},{default:u(()=>[k("\u4FDD\u5B58")]),_:1},8,["loading"])),[[O,["system:user:update"]]]),!a(l)&&a(s)=="AssignRoles"&&a(x)(["system:permission:assign-user-role"])?(n(),_(g,{key:4,loading:a(d),type:"primary",onClick:M},{default:u(()=>[k("\u4FDD\u5B58")]),_:1},8,["loading"])):i("",!0)])]),key:"0"}]),1032,["title","modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/system/sale/merchant/components/MerchantUserTab.vue"]])});export{La as __tla,T as default};