UserTab-1338f9fd.js 5.8 KB

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