From 73856ad1cb0865f0649aaa2dbe6ceda1a8b41da3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9A=93=E6=9C=88=E5=BD=92=E5=B0=98?= Date: Sat, 22 Feb 2025 23:27:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8C=89=E9=92=AE=E7=BA=A7=E6=9D=83=E9=99=90?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/monitor.ts | 45 ++++- src/views/monitor/login/utils/hook.tsx | 2 +- src/views/monitor/operation/index.vue | 121 ++++++++++--- .../monitor/operation/{ => utils}/hook.tsx | 171 +++++++++++++----- 4 files changed, 262 insertions(+), 77 deletions(-) rename src/views/monitor/operation/{ => utils}/hook.tsx (59%) diff --git a/src/api/monitor.ts b/src/api/monitor.ts index 2ff06e2..48af326 100644 --- a/src/api/monitor.ts +++ b/src/api/monitor.ts @@ -69,22 +69,57 @@ export const deleteUserLoginLogListAPI = (data: { ids: string[] }) => { // ------------------------操作日志相关---------------------------------------- +/**获取操作日志参数 */ +type GetUserOperationParams = { + /**页码 */ + page: number; + /**每页数量 */ + pageSize: number; + /**用户账号 */ + username?: string; + /**用户昵称 */ + nickname?: string; + /**部门ID */ + department_id?: string; + /**操作名称 */ + name?: string; + /**操作状态 */ + status?: number | string; + /**操作类型 */ + type?: number | string; + /**开始时间 */ + startTime?: string | number; + /**结束时间 */ + endTime?: string | number; +}; + /** * 获取用户操作日志 */ -export const getUserOperationsAPI = (params: { - page: number; - pageSize: number; -}) => { +export const getUserOperationsAPI = (params: GetUserOperationParams) => { return http.request>( "GET", "/api/log/operation", { - params + params: filterEmptyObject(params) } ); }; +/** + * 删除操作日志 + * @returns + */ +export const deleteUserOperationsAPI = (id: string) => { + return http.request("delete", `/api/log/delete/operation/${id}`); +}; +/**批量删除操作日志 */ +export const deleteUserOperationsListAPI = (data: { ids: string[] }) => { + return http.request("delete", `/api/log/deleteList/operation`, { + data + }); +}; + // ------------------------服务相关---------------------------------------- /** diff --git a/src/views/monitor/login/utils/hook.tsx b/src/views/monitor/login/utils/hook.tsx index 3b2cb68..294aa3a 100644 --- a/src/views/monitor/login/utils/hook.tsx +++ b/src/views/monitor/login/utils/hook.tsx @@ -108,7 +108,7 @@ export const useLogin = (tableRef: Ref) => { prop: "online", minWidth: 100, cellRenderer: ({ row, props }) => ( - + {row.online ? "在线" : "离线"} ) diff --git a/src/views/monitor/operation/index.vue b/src/views/monitor/operation/index.vue index 4673718..32ccef6 100644 --- a/src/views/monitor/operation/index.vue +++ b/src/views/monitor/operation/index.vue @@ -1,7 +1,7 @@