UserTab-58f51fa8.js 5.7 KB

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