1 |
- import{d as K,i as O,r,R as W,o as n,x as c,aR as Z,a,w as i,h as w,n as k,Q as u,t as $,y as N,g as R,P as V,X as aa,Y as ea,D as ta,J as sa,_ as ra,__tla as la}from"./index-b362e1d5.js";import{_ as oa,__tla as na}from"./ContentWrap-a3bb871b.js";import{_ as ca,__tla as _a}from"./SPuUploadImg-8c588231.js";import{_ as ia,__tla as ua}from"./Dialog-71bebaff.js";import ma,{__tla as da}from"./MerchantUserForm-82b76445.js";import fa,{__tla as ya}from"./MerchantUserAssignRoleForm-9f98da13.js";import{C as h}from"./constants-637baed6.js";import{d as pa,e as ha,r as va,__tla as ga}from"./index-93c6401e.js";import{c as x,__tla as ba}from"./permission-87185876.js";import{u as ka,__tla as wa}from"./useMessage-7c1dd10e.js";import{__tla as Ea}from"./el-card-732e29b8.js";import{__tla as Aa}from"./SPuUploadImg.vue_vue_type_style_index_0_scoped_ba706063_lang-b4af8eb1.js";import{__tla as Da}from"./index-6b00d885.js";import{__tla as Ra}from"./el-image-viewer-68ae3e49.js";import{__tla as Va}from"./dict-9948b178.js";import{__tla as xa}from"./index-8ee570ce.js";import{__tla as Ca}from"./formatTime-053b1c05.js";import{__tla as ja}from"./index-530a231f.js";import{__tla as Ba}from"./index-9b5f7597.js";let T,Ia=Promise.all([(()=>{try{return la}catch{}})(),(()=>{try{return na}catch{}})(),(()=>{try{return _a}catch{}})(),(()=>{try{return ua}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 Da}catch{}})(),(()=>{try{return Ra}catch{}})(),(()=>{try{return Va}catch{}})(),(()=>{try{return xa}catch{}})(),(()=>{try{return Ca}catch{}})(),(()=>{try{return ja}catch{}})(),(()=>{try{return Ba}catch{}})()]).then(async()=>{let C,j,B,I;C={class:"left"},j={class:"right"},B=w("div",{style:{clear:"both"}},null,-1),I={class:"dialog-footer"},T=ra(K({__name:"MerchantUserTab",emits:["success"],setup(La,{expose:z,emit:P}){const{t:E}=O(),m=ka(),d=r(!1),s=r("info"),_=r(!1),A=r(""),l=r(!1),f=r("create"),o=r({}),D=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,D.value=p,f.value=e,A.value=E("action."+e),e=="view"&&(A.value="\u67E5\u770B"),l.value=e=="view",_.value=!0}});const v=P,L=r(),S=async()=>{var e;await((e=L.value)==null?void 0:e.submitForm())&&(v("success"),_.value=!1)},U=r(),M=async()=>{var e;await((e=U.value)==null?void 0:e.submitForm())&&(v("success"),_.value=!1)},J=async()=>{const e=o.value;try{const t=e.status===h.ENABLE?"\u505C\u7528":"\u542F\u7528";await m.confirm('\u786E\u8BA4\u8981"'+t+'""'+e.username+'"\u7528\u6237\u5417?'),await pa(e.id,e.status?h.ENABLE:h.DISABLE),m.success(e.username+"\u5DF2"+t),_.value=!1,v("success")}catch{e.status=e.status===h.ENABLE?h.DISABLE:h.ENABLE}},Q=async()=>{try{const e=o.value.id;await m.delConfirm("\u786E\u8BA4\u8981\u5220\u9664"+o.value.username+"\u5417?"),await ha(e),m.success(E("common.delSuccess")),_.value=!1,v("success")}catch{}},X=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 va(t,p),m.success("\u4FEE\u6539\u6210\u529F\uFF0C\u65B0\u5BC6\u7801\u662F\uFF1A"+p),_.value=!1,v("success")}catch{}};return(e,t)=>{const p=ca,F=aa,Y=ea,q=oa,g=ta,G=sa,H=W("hasPermi");return n(),c(ia,{title:a(A),modelValue:a(_),"onUpdate:modelValue":t[2]||(t[2]=b=>V(_)?_.value=b:null),width:"70%"},Z({default:i(()=>[N((n(),c(q,{style:{"max-height":"400px","min-height":"400px","overflow-y":"auto",border:"none"}},{default:i(()=>[w("div",C,[R(p,{modelValue:a(y),"onUpdate:modelValue":t[0]||(t[0]=b=>V(y)?y.value=b:null),disabled:a(l)},null,8,["modelValue","disabled"]),R(Y,{modelValue:a(s),"onUpdate:modelValue":t[1]||(t[1]=b=>V(s)?s.value=b:null),"tab-position":"left",class:"child-tabs"},{default:i(()=>[R(F,{label:"\u57FA\u672C\u4FE1\u606F",name:"info"}),a(f)!="create"?(n(),c(F,{key:0,label:"\u5206\u914D\u89D2\u8272",name:"AssignRoles"})):u("",!0)]),_:1},8,["modelValue"])]),w("div",j,[a(s)=="info"?(n(),c(ma,{key:0,obj:a(o),ref_key:"userFormRef",ref:L,merchantId:a(D),isDetail:a(l),avatar:a(y),openType:a(f)},null,8,["obj","merchantId","isDetail","avatar","openType"])):u("",!0),a(s)=="AssignRoles"?(n(),c(fa,{key:1,obj:a(o),ref_key:"userAssignRoleFormRef",ref:U,merchantId:a(D),isDetail:a(l)},null,8,["obj","merchantId","isDetail"])):u("",!0)]),B]),_:1})),[[G,a(d)]])]),_:2},[a(l)?void 0:{name:"footer",fn:i(()=>[w("div",I,[!a(l)&&a(s)=="info"&&a(x)(["system:user:delete"])&&a(f)!="create"?(n(),c(g,{key:0,loading:a(d),type:"danger",onClick:Q},{default:i(()=>[k("\u5220\u9664")]),_:1},8,["loading"])):u("",!0),a(l)||a(s)!="info"||a(f)=="create"?u("",!0):(n(),c(g,{key:1,type:a(o).status==1?"primary":"danger",loading:a(d),onClick:J},{default:i(()=>[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(),c(g,{key:2,loading:a(d),type:"primary",onClick:X},{default:i(()=>[k("\u91CD\u7F6E\u5BC6\u7801")]),_:1},8,["loading"])):u("",!0),a(l)||a(s)!="info"?u("",!0):N((n(),c(g,{key:3,loading:a(d),type:"primary",onClick:S},{default:i(()=>[k("\u4FDD\u5B58")]),_:1},8,["loading"])),[[H,["system:user:update"]]]),!a(l)&&a(s)=="AssignRoles"&&a(x)(["system:permission:assign-user-role"])?(n(),c(g,{key:4,loading:a(d),type:"primary",onClick:M},{default:i(()=>[k("\u4FDD\u5B58")]),_:1},8,["loading"])):u("",!0)])]),key:"0"}]),1032,["title","modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/system/sale/merchant/components/MerchantUserTab.vue"]])});export{Ia as __tla,T as default};
|