index-hYXhfEPz.js 4.7 KB

1
  1. var c=(e,u,s)=>new Promise((d,m)=>{var g=o=>{try{l(s.next(o))}catch(t){m(t)}},p=o=>{try{l(s.throw(o))}catch(t){m(t)}},l=o=>o.done?d(o.value):Promise.resolve(o.value).then(g,p);l((s=s.apply(e,u)).next())});import{i as F}from"./index-Ci2v5RRf.js";import{B as L,u as M}from"./useTable-CaBV0A9D.js";import{T as W}from"./index-BPgn07DB.js";import O from"./DeptTree-CKCz-dLl.js";import{u as P}from"./index-Bh1SitHa.js";import{U as $,c as E,s as N}from"./UserDrawer-D6pCCTa6.js";import{ao as V,v as j,bi as z,bj as T,ap as G,_ as H}from"./entry/index-CP6zkLsN-1726190694502.js";import{W as q,d as J,f as k,r as K,k as i,a6 as a,_ as y,a7 as I,a8 as r,G as R,a2 as B,a0 as U}from"./vue-CmlY4eyV.js";import{g as Q}from"./role-C4PaqxHm.js";import{l as X}from"./token-CZjT9vzr.js";import{bl as Y,bm as Z,M as x}from"./antd-Bp5u6ujY.js";import{P as ee}from"./index-DG9kSxBw.js";import"./ExclamationCircleOutlined-BR1Enpph.js";import"./useForm-DYTnyn58.js";import"./index-D5QnXKgB.js";import"./tree-Cz4SXb17.js";import"./copyTextToClipboard-o-L2h2rZ.js";import"./index-BAxfTGAN.js";import"./index-caYAhZot.js";import"./index-Ci1vkPDT.js";import"./index-B_Pz7KLI.js";import"./index-5JuY20kX.js";import"./useWindowSizeFn-c2oM7mG1.js";import"./plugin-BdCvh_fX.js";import"./uuid-BUBnBT7J.js";import"./onMountedOrActivated-C4hclMrd.js";import"./sortable.esm-CnNXHMH-.js";import"./useSortable-Dv9W1z21.js";import"./department-B6vcHhpB.js";import"./index-ownmt4lJ.js";import"./position-Joj7GbA2.js";import"./cloudFile-CVUE8zPI.js";import"./useContentViewHeight-DQ1krU9_.js";const oe=q("app-role",{state:()=>({roleInfo:[]}),getters:{getRoleInfo(){return this.roleInfo}},actions:{getRoleInfoFromServer(){return c(this,null,function*(){const e=yield Q({page:1,pageSize:1e3});this.roleInfo=e.data.data})}}}),te=J({name:"UserManagement",components:{BasicTable:L,UserDrawer:$,TableAction:W,PageWrapper:ee,Button:V,Row:Y,Col:Z,DeptTree:O},setup(){const{t:e}=j.useI18n(),{createMessage:u}=G(),s=k(),d=k(!1),m=K({}),[g,{openDrawer:p}]=P();oe().getRoleInfoFromServer();const[o,{reload:t,getSelectRows:w}]=M({title:e("sys.user.userList"),api:z,columns:E,formConfig:{labelWidth:120,schemas:N},useSearchForm:!0,showTableSetting:!0,bordered:!0,showIndexColumn:!1,clickToRowSelect:!1,actionColumn:{width:60,title:e("common.action"),dataIndex:"action",fixed:"right"},rowKey:"id",rowSelection:{type:"checkbox",onChange:(n,h)=>{s.value=n,d.value=n.length>0}}});function b(){p(!0,{isUpdate:!1})}function C(n){p(!0,{record:n,isUpdate:!0})}function D(n){return c(this,null,function*(){if(n.nickname==="admin"){u.warn(e("common.notAllowDeleteAdminData"));return}(yield T({ids:[n.id]})).code===0&&(yield t())})}function S(){return c(this,null,function*(){x.confirm({title:e("common.deleteConfirm"),icon:i(F.ExclamationCircleOutlined),onOk(){return c(this,null,function*(){const h=s.value;if(w().filter(A=>A.nickname==="admin").length>0){u.warn(e("common.notAllowDeleteAdminData"));return}(yield T({ids:h})).code===0&&(yield t())})},onCancel(){}})})}function _(n){m.departmentId=n,t()}function f(n){return c(this,null,function*(){(yield X(n.id)).code===0&&(yield t())})}function v(){return c(this,null,function*(){yield t()})}return{t:e,registerTable:o,registerDrawer:g,handleCreate:b,handleEdit:C,handleLogout:f,handleDelete:D,handleSuccess:v,handleBatchDelete:S,handleSelect:_,showDeleteButton:d,searchInfo:m}}});function ne(e,u,s,d,m,g){const p=a("DeptTree"),l=a("Col"),o=a("Button"),t=a("a-button"),w=a("TableAction"),b=a("BasicTable"),C=a("Row"),D=a("UserDrawer"),S=a("PageWrapper");return y(),I(S,{dense:"",contentFullHeight:""},{default:r(()=>[i(C,null,{default:r(()=>[i(l,{span:5},{default:r(()=>[i(p,{onSelect:e.handleSelect},null,8,["onSelect"])]),_:1}),i(l,{span:19},{default:r(()=>[i(b,{onRegister:e.registerTable,searchInfo:e.searchInfo},{tableTitle:r(()=>[e.showDeleteButton?(y(),I(o,{key:0,type:"primary",danger:"",preIcon:"ant-design:delete-outlined",onClick:e.handleBatchDelete},{default:r(()=>[R(B(e.t("common.delete")),1)]),_:1},8,["onClick"])):U("",!0)]),toolbar:r(()=>[i(t,{type:"primary",onClick:e.handleCreate},{default:r(()=>[R(B(e.t("sys.user.addUser")),1)]),_:1},8,["onClick"])]),bodyCell:r(({column:_,record:f})=>[_.key==="action"?(y(),I(w,{key:0,actions:[{label:"编辑",onClick:e.handleEdit.bind(null,f)},{color:"error",label:e.t("sys.user.forceLoggingOut"),popConfirm:{title:e.t("sys.user.forceLoggingOut")+"?",placement:"left",confirm:e.handleLogout.bind(null,f)}},{label:"删除",color:"error",popConfirm:{title:e.t("common.deleteConfirm"),placement:"left",confirm:e.handleDelete.bind(null,f)}}]},null,8,["actions"])):U("",!0)]),_:1},8,["onRegister","searchInfo"])]),_:1})]),_:1}),i(D,{onRegister:e.registerDrawer,onSuccess:e.handleSuccess},null,8,["onRegister","onSuccess"])]),_:1})}const Ne=H(te,[["render",ne]]);export{Ne as default};