UserTab-3669a27b.js 4.9 KB

1
  1. import{d as q,h as G,r as _,Q as H,o as l,v as o,aZ as J,a,w as u,g as k,n as g,P as c,t as K,x as V,f as j,O as F,W as M,X as Y,C as $,I as aa,_ as ea,__tla as ta}from"./index-e3afde76.js";import{_ as sa,__tla as ra}from"./ContentWrap-5f2f4872.js";import{_ as la,__tla as oa}from"./Dialog-c20523c4.js";import ia,{__tla as na}from"./UserForm-6344987f.js";import _a,{__tla as ua}from"./UserAssignRoleForm-9edfea4e.js";import{C as f}from"./constants-40f13f5e.js";import{d as ca,e as ma,r as ya,__tla as da}from"./index-13bb02f9.js";import{c as E,__tla as fa}from"./permission-5aaf11fe.js";import{u as pa,__tla as va}from"./useMessage-0b1b25bd.js";import{__tla as ha}from"./el-card-6198c22a.js";import{__tla as ga}from"./el-tree-select-58251b07.js";import{__tla as ka}from"./dict-a141296d.js";import"./tree-0af4953a.js";import{__tla as wa}from"./index-568847d8.js";import{__tla as ba}from"./index-3eb0dcf8.js";import{__tla as Aa}from"./index-c6c6bb97.js";import{__tla as Ea}from"./index-b4090625.js";let N,Ca=Promise.all([(()=>{try{return ta}catch{}})(),(()=>{try{return ra}catch{}})(),(()=>{try{return oa}catch{}})(),(()=>{try{return na}catch{}})(),(()=>{try{return ua}catch{}})(),(()=>{try{return da}catch{}})(),(()=>{try{return fa}catch{}})(),(()=>{try{return va}catch{}})(),(()=>{try{return ha}catch{}})(),(()=>{try{return ga}catch{}})(),(()=>{try{return ka}catch{}})(),(()=>{try{return wa}catch{}})(),(()=>{try{return ba}catch{}})(),(()=>{try{return Aa}catch{}})(),(()=>{try{return Ea}catch{}})()]).then(async()=>{let C,x,D,B;C={class:"left"},x={class:"right"},D=k("div",{style:{clear:"both"}},null,-1),B={class:"dialog-footer"},N=ea(q({__name:"UserTab",emits:["success"],setup(xa,{expose:T,emit:U}){const{t:w}=G(),m=pa(),y=_(!1),s=_("info"),i=_(!1),b=_(""),n=_(!1),d=_("create"),r=_({});T({open:async(e,t)=>{r.value=t,d.value=e,b.value=w("action."+e),e=="view"&&(b.value="\u67E5\u770B"),n.value=e=="view",i.value=!0}});const p=U,L=_(),I=async()=>{var e;await((e=L.value)==null?void 0:e.submitForm())&&(p("success"),i.value=!1)},R=_(),P=async()=>{var e;await((e=R.value)==null?void 0:e.submitForm())&&(p("success"),i.value=!1)},S=async()=>{const e=r.value;try{const t=e.status===f.ENABLE?"\u505C\u7528":"\u542F\u7528";await m.confirm('\u786E\u8BA4\u8981"'+t+'""'+e.username+'"\u7528\u6237\u5417?'),await ca(e.id,e.status?f.ENABLE:f.DISABLE),m.success(e.username+"\u5DF2"+t),i.value=!1,p("success")}catch{e.status=e.status===f.ENABLE?f.DISABLE:f.ENABLE}},z=async()=>{try{const e=r.value.id;await m.delConfirm("\u786E\u8BA4\u8981\u5220\u9664"+r.value.username+"\u5417?"),await ma(e),m.success(w("common.delSuccess")),i.value=!1,p("success")}catch{}},O=async e=>{try{const t=r.value.id,v=(await m.prompt('\u8BF7\u8F93\u5165"'+r.value.username+'"\u7684\u65B0\u5BC6\u7801',w("common.reminder"))).value;await ya(t,v),m.success("\u4FEE\u6539\u6210\u529F\uFF0C\u65B0\u5BC6\u7801\u662F\uFF1A"+v),i.value=!1,p("success")}catch{}};return(e,t)=>{const v=M,Q=Y,W=sa,h=$,X=aa,Z=H("hasPermi");return l(),o(la,{title:a(b),modelValue:a(i),"onUpdate:modelValue":t[1]||(t[1]=A=>F(i)?i.value=A:null),width:"70%"},J({default:u(()=>[V((l(),o(W,{style:{"max-height":"360px","min-height":"360px","overflow-y":"auto",border:"none"}},{default:u(()=>[k("div",C,[j(Q,{modelValue:a(s),"onUpdate:modelValue":t[0]||(t[0]=A=>F(s)?s.value=A:null),"tab-position":"left"},{default:u(()=>[j(v,{label:"\u57FA\u672C\u4FE1\u606F",name:"info"}),a(d)!="create"?(l(),o(v,{key:0,label:"\u5206\u914D\u89D2\u8272",name:"AssignRoles"})):c("",!0)]),_:1},8,["modelValue"])]),k("div",x,[a(s)=="info"?(l(),o(ia,{key:0,obj:a(r),ref_key:"userFormRef",ref:L,isDetail:a(n),openType:a(d)},null,8,["obj","isDetail","openType"])):c("",!0),a(s)=="AssignRoles"?(l(),o(_a,{key:1,obj:a(r),ref_key:"userAssignRoleFormRef",ref:R,isDetail:a(n)},null,8,["obj","isDetail"])):c("",!0)]),D]),_:1})),[[X,a(y)]])]),_:2},[a(n)?void 0:{name:"footer",fn:u(()=>[k("div",B,[!a(n)&&a(s)=="info"&&a(E)(["system:user:delete"])&&a(d)!="create"?(l(),o(h,{key:0,loading:a(y),type:"danger",onClick:z},{default:u(()=>[g("\u5220\u9664")]),_:1},8,["loading"])):c("",!0),a(n)||a(s)!="info"||a(d)=="create"?c("",!0):(l(),o(h,{key:1,type:a(r).status==1?"primary":"danger",loading:a(y),onClick:S},{default:u(()=>[g(K(a(r).status==1?"\u542F\u7528":"\u505C\u7528"),1)]),_:1},8,["type","loading"])),!a(n)&&a(s)=="info"&&a(E)(["system:user:update-password"])&&a(d)!="create"?(l(),o(h,{key:2,loading:a(y),type:"primary",onClick:O},{default:u(()=>[g("\u91CD\u7F6E\u5BC6\u7801")]),_:1},8,["loading"])):c("",!0),a(n)||a(s)!="info"?c("",!0):V((l(),o(h,{key:3,loading:a(y),type:"primary",onClick:I},{default:u(()=>[g("\u4FDD\u5B58")]),_:1},8,["loading"])),[[Z,["system:user:update"]]]),!a(n)&&a(s)=="AssignRoles"&&a(E)(["system:permission:assign-user-role"])?(l(),o(h,{key:4,loading:a(y),type:"primary",onClick:P},{default:u(()=>[g("\u4FDD\u5B58")]),_:1},8,["loading"])):c("",!0)])]),key:"0"}]),1032,["title","modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/system/user/UserTab.vue"]])});export{Ca as __tla,N as default};