diff --git a/locales/en.yaml b/locales/en.yaml index bc0d1ea..9abe424 100644 --- a/locales/en.yaml +++ b/locales/en.yaml @@ -42,6 +42,7 @@ buttons:More: More buttons:Deselect: Deselect buttons:DeleteInBatches: Delete In Batches buttons:ExportInBatches: Export In Batches +buttons:ExitInBatches: Exit In Batches buttons:ExportAll: Export All buttons:UploadAvatar: Upload Avatar buttons:ResetPassword: Reset Password diff --git a/locales/zh-CN.yaml b/locales/zh-CN.yaml index e10edf5..bf0d8ff 100644 --- a/locales/zh-CN.yaml +++ b/locales/zh-CN.yaml @@ -48,6 +48,7 @@ buttons:ResetPassword: 重置密码 buttons:RoleAllocation: 角色分配 buttons:PermissionDetails: 权限详情 buttons:ForceToExit: 强制退出 +buttons:ExitInBatches: 批量强退 search:Total: 共 search:History: 搜索历史 search:Collect: 收藏 diff --git a/src/api/monitor.ts b/src/api/monitor.ts index 9f5a372..2ff06e2 100644 --- a/src/api/monitor.ts +++ b/src/api/monitor.ts @@ -14,10 +14,27 @@ import { filterEmptyObject } from "./utils"; * 用户获取登录日志 */ -export const getUserLoginLogAPI = (params: { +/**获取用户登录日志参数 */ +type GetUserLoginLogParams = { + /**页码 */ page: number; + /**每页数量 */ pageSize: number; -}) => { + /**用户账号 */ + username?: string; + /**用户昵称 */ + nickname?: string; + /**部门ID */ + department_id?: string; + /**登录状态 */ + status?: number | string; + /**开始时间 */ + startTime?: string | number; + /**结束时间 */ + endTime?: string | number; +}; + +export const getUserLoginLogAPI = (params: GetUserLoginLogParams) => { return http.request>( "get", "/api/log/login", @@ -36,6 +53,20 @@ export const deleteUserOnlineAPI = (id: string) => { return http.request("delete", `/api/log/logout/${id}`); }; +/**用户批量强退*/ +export const deleteUserOnlineListAPI = (data: { ids: string[] }) => { + return http.request("delete", `/api/log/logoutList`, { data }); +}; + +/**删除登录日志 */ +export const deleteUserLoginLogAPI = (id: string) => { + return http.request("delete", `/api/log/delete/login/${id}`); +}; +/**批量删除登录日志 */ +export const deleteUserLoginLogListAPI = (data: { ids: string[] }) => { + return http.request("delete", `/api/log/deleteList/login`, { data }); +}; + // ------------------------操作日志相关---------------------------------------- /** diff --git a/src/views/monitor/login/index.vue b/src/views/monitor/login/index.vue index f9b7a53..0af53cc 100644 --- a/src/views/monitor/login/index.vue +++ b/src/views/monitor/login/index.vue @@ -5,9 +5,10 @@ import { getPickerShortcuts } from "../utils"; import { PureTableBar } from "@/components/RePureTableBar"; import { useRenderIcon } from "@/components/ReIcon/src/hooks"; import { useI18n } from "vue-i18n"; +import Delete from "@iconify-icons/ep/delete"; import Plane from "@iconify-icons/ri/plane-line"; import Refresh from "@iconify-icons/ep/refresh"; - +import { hasAuth } from "@/utils/auth"; defineOptions({ name: "MonitorLogin" }); @@ -23,13 +24,16 @@ const { dataList, pagination, selectedNum, + departments, onSearch, - deleteUserHandle, - resetForm, onbatchDel, + onbatchForce, + resetForm, + deleteUserHandle, onSelectionCancel, handleCurrentChange, handleSizeChange, + handleDelete, handleSelectionChange } = useLogin(tableRef); @@ -42,12 +46,20 @@ const { :model="form" class="search-form bg-bg_color w-[99/100] pl-8 pt-[12px] overflow-auto" > - + + + + @@ -55,12 +67,33 @@ const { v-model="form.status" placeholder="请选择" clearable - class="!w-[150px]" + class="!w-[200px]" > - - + + + + + + + @@ -86,16 +121,7 @@ const { - - +