From 67651d7a3f8efcbc4de9a249175a0bfeb16269e1 Mon Sep 17 00:00:00 2001 From: chansee97 Date: Thu, 15 Jan 2026 23:04:53 +0800 Subject: [PATCH] refactor: remove oper-log module --- package.json | 32 ++-- src/api/monitor/oper-log.ts | 31 ---- src/typings/entities/oper-log.d.ts | 75 -------- src/views/monitor/oper-log/columns.tsx | 168 ----------------- .../oper-log/components/DetailModal.vue | 119 ------------ src/views/monitor/oper-log/index.vue | 170 ------------------ 6 files changed, 16 insertions(+), 579 deletions(-) delete mode 100644 src/api/monitor/oper-log.ts delete mode 100644 src/typings/entities/oper-log.d.ts delete mode 100644 src/views/monitor/oper-log/columns.tsx delete mode 100644 src/views/monitor/oper-log/components/DetailModal.vue delete mode 100644 src/views/monitor/oper-log/index.vue diff --git a/package.json b/package.json index 734c8cb..ba1202b 100644 --- a/package.json +++ b/package.json @@ -47,27 +47,27 @@ "sizecheck": "npx vite-bundle-visualizer" }, "dependencies": { - "@vueuse/core": "^13.7.0", + "@vueuse/core": "^14.1.0", "alova": "^3.3.4", "array-to-tree": "^3.3.2", "colord": "^2.9.3", "echarts": "^6.0.0", "md-editor-v3": "^5.6.1", - "pinia": "^3.0.3", - "pinia-plugin-persistedstate": "^4.5.0", - "pro-naive-ui": "^3.1.1", + "pinia": "^3.0.4", + "pinia-plugin-persistedstate": "^4.7.1", + "pro-naive-ui": "^3.2.0", "quill": "^2.0.3", "radash": "^12.1.1", - "vue": "^3.5.20", - "vue-draggable-plus": "^0.6.0", - "vue-i18n": "^11.1.11", - "vue-router": "^4.5.1" + "vue": "^3.5.26", + "vue-draggable-plus": "^0.6.1", + "vue-i18n": "^11.2.8", + "vue-router": "^4.6.4" }, "devDependencies": { "@antfu/eslint-config": "^5.0.0", "@iconify-json/icon-park-outline": "^1.2.2", "@iconify/vue": "^5.0.0", - "@types/node": "^24.1.0", + "@types/node": "^25.0.8", "@vitejs/plugin-vue": "^6.0.1", "@vitejs/plugin-vue-jsx": "^5.0.1", "eslint": "^9.29.0", @@ -78,15 +78,15 @@ "simple-git-hooks": "^2.13.1", "typescript": "^5.8.3", "unocss": "^66.3.3", - "unplugin-auto-import": "^19.3.0", - "unplugin-icons": "^22.2.0", - "unplugin-vue-components": "^28.8.0", - "vite": "^7.0.6", + "unplugin-auto-import": "^21.0.0", + "unplugin-icons": "^23.0.1", + "unplugin-vue-components": "^31.0.0", + "vite": "^7.3.1", "vite-bundle-visualizer": "^1.2.1", - "vite-plugin-auto-proxy": "^1.0.1", + "vite-plugin-auto-proxy": "^1.0.2", "vite-plugin-compression": "^0.5.1", - "vite-plugin-vue-devtools": "8.0.0", - "vue-tsc": "^3.0.5" + "vite-plugin-vue-devtools": "8.0.5", + "vue-tsc": "^3.2.2" }, "simple-git-hooks": { "pre-commit": "pnpm lint-staged" diff --git a/src/api/monitor/oper-log.ts b/src/api/monitor/oper-log.ts deleted file mode 100644 index 7dc22d7..0000000 --- a/src/api/monitor/oper-log.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { request } from '@/utils/alova' - -export interface OperLogQueryParams extends Api.PageParams { -} -/** - * 分页查询操作日志列表 - */ -export function getOperLogPage(params: OperLogQueryParams) { - return request.Get>('/oper-log', { params }) -} - -/** - * 获取操作日志详情 - */ -export function getOperLogDetail(id: number) { - return request.Get(`/oper-log/${id}`) -} - -/** - * 删除操作日志 - */ -export function deleteOperLog(ids: string) { - return request.Delete(`/oper-log/${ids}`) -} - -/** - * 清空操作日志 - */ -export function clearOperLog() { - return request.Delete('/oper-log/clean') -} diff --git a/src/typings/entities/oper-log.d.ts b/src/typings/entities/oper-log.d.ts deleted file mode 100644 index 248687a..0000000 --- a/src/typings/entities/oper-log.d.ts +++ /dev/null @@ -1,75 +0,0 @@ -declare namespace Entity { - /** - * 操作日志 - */ - interface OperLog { - /** - * 日志编号 - */ - id: number - /** - * 模块标题 - */ - title: string - /** - * 方法名称 - */ - method: string - /** - * 请求方式 - */ - requestMethod: string - /** - * 操作人员 - */ - operName: string - /** - * 部门名称 - */ - deptName: string - /** - * 请求URL - */ - operUrl: string - /** - * 主机地址 - */ - operIp: string - /** - * 操作地点 - */ - operLocation: string - /** - * 浏览器类型 - */ - browser: string - /** - * 操作系统 - */ - os: string - /** - * 请求参数 - */ - operParam: string - /** - * 返回参数 - */ - jsonResult: string - /** - * 操作状态(0正常 1异常) - */ - status: number - /** - * 错误消息 - */ - errorMsg: string - /** - * 消耗时间 - */ - costTime: string - /** - * 操作时间 - */ - operTime: Date - } -} diff --git a/src/views/monitor/oper-log/columns.tsx b/src/views/monitor/oper-log/columns.tsx deleted file mode 100644 index 5b9dddd..0000000 --- a/src/views/monitor/oper-log/columns.tsx +++ /dev/null @@ -1,168 +0,0 @@ -import type { DataTableColumns } from 'naive-ui' -import { NButton, NSpace, NTag } from 'naive-ui' -import type { ProSearchFormColumns } from 'pro-naive-ui' -import { renderProCopyableText } from 'pro-naive-ui' - -// 操作日志搜索表单数据类型 -export interface OperationLogSearchFormData { - operUrl?: string - title?: string - operName?: string - businessType?: number - status?: 0 | 1 - operTime?: [string, string] -} - -// 操作日志搜索表单列配置 -export const searchColumns: ProSearchFormColumns = [ - { - title: '操作地址', - path: 'operUrl', - field: 'input', - fieldProps: { - clearable: true, - }, - }, - { - title: '系统模块', - path: 'title', - field: 'input', - fieldProps: { - clearable: true, - }, - }, - { - title: '操作人员', - path: 'operName', - field: 'input', - fieldProps: { - clearable: true, - }, - }, - { - title: '状态', - path: 'status', - field: 'select', - fieldProps: { - clearable: true, - options: [ - { label: '正常', value: 0 }, - { label: '异常', value: 1 }, - ], - }, - }, - { - title: '操作时间', - path: 'operTime', - field: 'date-time-range', - fieldProps: { - clearable: true, - format: 'yyyy-MM-dd', - valueFormat: 'yyyy-MM-dd HH:mm:ss', - defaultTime: ['00:00:00', '23:59:59'], - }, - }, -] - -// 表格列配置 -export function createTableColumns(options: { - onView: (row: Entity.OperLog) => void - onDelete: (operId: number) => void -}): DataTableColumns { - const { onView, onDelete } = options - - return [ - { - type: 'selection', - width: 55, - align: 'center', - }, - { - title: '系统模块', - key: 'title', - width: 150, - align: 'center', - ellipsis: { - tooltip: true, - }, - }, - { - title: '操作人员', - key: 'operName', - width: 120, - align: 'center', - ellipsis: { - tooltip: true, - }, - }, - { - title: '主机地址', - key: 'operIp', - width: 130, - align: 'center', - render: row => renderProCopyableText(row.operIp), - }, - { - title: '操作地点', - key: 'operLocation', - width: 150, - align: 'center', - ellipsis: { - tooltip: true, - }, - }, - { - title: '操作状态', - key: 'status', - width: 100, - align: 'center', - render: (row) => { - return ( - - {row.status === 0 ? '正常' : '异常'} - - ) - }, - }, - { - title: '操作日期', - key: 'operTime', - width: 180, - align: 'center', - }, - { - title: '消耗时间', - key: 'costTime', - width: 100, - align: 'center', - render: row => `${row.costTime}`, - }, - { - title: '操作', - key: 'actions', - width: 150, - align: 'center', - fixed: 'right', - render: (row) => { - return ( - - onView(row)} - > - 详细 - - onDelete(row.id)} - > - 删除 - - - ) - }, - }, - ] -} diff --git a/src/views/monitor/oper-log/components/DetailModal.vue b/src/views/monitor/oper-log/components/DetailModal.vue deleted file mode 100644 index ca543f8..0000000 --- a/src/views/monitor/oper-log/components/DetailModal.vue +++ /dev/null @@ -1,119 +0,0 @@ - - - diff --git a/src/views/monitor/oper-log/index.vue b/src/views/monitor/oper-log/index.vue deleted file mode 100644 index 68e5bb7..0000000 --- a/src/views/monitor/oper-log/index.vue +++ /dev/null @@ -1,170 +0,0 @@ - - -