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-B8miXP3d.js";import{B as L,u as M}from"./useTable-Ol_P-TxG.js";import{T as W}from"./index-BEZBHtc2.js";import O from"./DeptTree-NqfkAqyu.js";import{u as P}from"./index-CwBw3p8r.js";import{U as $,c as E,s as N}from"./UserDrawer-CI6ckLFw.js";import{ao as V,v as j,bi as z,bj as T,ap as G,_ as H}from"./entry/index-BOVpYCVt-1731915664217.js";import{W as q,d as J,f as k,r as K,k as i,a9 as a,_ as y,a6 as I,a7 as r,G as R,a2 as B,a0 as U}from"./vue-B5pbXMv7.js";import{g as Q}from"./role-Dn1KF7ny.js";import{l as X}from"./token-BsvxpKEc.js";import{bl as Y,bm as Z,M as x}from"./antd-DXvsKA0x.js";import{P as ee}from"./index-VCsIDtFK.js";import"./ExclamationCircleOutlined-BaVgfZo1.js";import"./useForm-B-PbqzOc.js";import"./index-x2bUusKH.js";import"./tree-Nv0Zt4Ov.js";import"./copyTextToClipboard-7uPthhEV.js";import"./index-DKfaJplO.js";import"./index-EdNvCi60.js";import"./index-DTfAZuwl.js";import"./index-BcSUkfeU.js";import"./index-DaqRmjER.js";import"./useWindowSizeFn-CzjmevD7.js";import"./plugin-CRRssOeV.js";import"./uuid-BUBnBT7J.js";import"./onMountedOrActivated-C3HH8-CK.js";import"./sortable.esm-BEDva30o.js";import"./useSortable-CRwDSVfI.js";import"./department-CEtItz5_.js";import"./index-CZk9a_J9.js";import"./position-CvNNehu7.js";import"./cloudFile-DTnyMuwp.js";import"./useContentViewHeight-0Tf8Jxwa.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};
|