From 5c8b41b18b154df0052aadb7d7862817f98af7c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E7=BA=A2=E4=B8=BD?= <1181930680@qq.com> Date: Thu, 21 Nov 2024 15:27:36 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=97=A5=E5=BF=97=E3=80=81?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97=E5=88=97=E8=A1=A8=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/logger/loginLog/columns.ts | 131 ++++++++++--------- src/views/system/logger/operLog/columns.ts | 137 ++++++++++---------- 2 files changed, 139 insertions(+), 129 deletions(-) diff --git a/src/views/system/logger/loginLog/columns.ts b/src/views/system/logger/loginLog/columns.ts index 404077b..53e3696 100644 --- a/src/views/system/logger/loginLog/columns.ts +++ b/src/views/system/logger/loginLog/columns.ts @@ -11,73 +11,80 @@ export const columns = [ title: 'ID', key: 'id', fixed: 'left', - width: 50, - }, - { - title: '操作用户', - key: 'username', width: 100, }, { - title: '请求ip', - key: 'ip', - width: 100, - }, - { - title: '浏览器', - key: 'browser', - width: 100, - }, - { - title: '操作系统', - key: 'os', - width: 100, - }, - { - title: '操作类型', - key: 'typeText', - width: 100, - }, - { - title: '操作来源', - key: 'sourceText', - width: 100, - }, - { - title: '请求方式', - key: 'requestMethod', - width: 100, - }, - { - title: '请求URL', - key: 'url', - width: 100, - }, - { - title: '请求地区', - key: 'location', - width: 100, - }, - { - title: '请求耗时', - key: 'consumeTime', - width: 100, - }, - { - title: '状态', - key: 'status', + title: '访客', + align: 'left', render(record) { - return h( - NTag, - { - type: record.status == 0 ? 'success' : 'error', - }, - { - default: () => (record.status == 0 ? '正常' : '异常'), - }, - ); + return h('div', [ + h( + 'div', + { + style: { marginBottom: '5px' }, + }, + record.username, + ), + h( + 'div', + { + style: { marginBottom: '5px' }, + }, + record.ip, + ), + h('div', record.location), + ]); + }, + }, + { + title: '请求接口', + align: 'left', + render(record) { + return h('div', [ + h( + NTag, + { + type: 'info', + style: { marginBottom: '5px' }, + }, + { + default: () => record.requestMethod, + }, + ), + h('div', '接口:' + record.url), + ]); + }, + }, + { + title: '接口响应', + align: 'left', + render(record) { + return h('div', [ + h('span', '状态:'), + h( + NTag, + { + type: record.status == 0 ? 'success' : 'error', + style: { marginBottom: '5px' }, + }, + { + default: () => (record.status == 0 ? '正常' : '异常'), + }, + ), + h('div', '请求耗时:' + record.consumeTime + 'ms'), + ]); + }, + }, + { + label: '操作来源', + align: 'left', + render(record) { + return h('div', [ + h('div', '系统:' + record.os), + h('div', '类型:' + record.typeText), + h('div', '来源:' + record.sourceText), + ]); }, - width: 100, }, { title: '创建时间', diff --git a/src/views/system/logger/operLog/columns.ts b/src/views/system/logger/operLog/columns.ts index 5756630..9c3f033 100644 --- a/src/views/system/logger/operLog/columns.ts +++ b/src/views/system/logger/operLog/columns.ts @@ -14,75 +14,78 @@ export const columns = [ width: 100, }, { - title: '日志标题', - key: 'title', - width: 100, - }, - { - title: '操作用户', - key: 'createUser', - width: 100, - }, - { - title: '请求ip', - key: 'ip', - width: 140, - }, - { - title: '浏览器', - key: 'browser', - width: 100, - }, - { - title: '操作系统', - key: 'os', - width: 100, - }, - { - title: '操作类型', - key: 'typeText', - width: 100, - }, - { - title: '操作来源', - key: 'sourceText', - width: 100, - }, - { - title: '请求方式', - key: 'requestMethod', - width: 100, - }, - { - title: '请求URL', - key: 'url', - width: 150, - }, - { - title: '请求地区', - key: 'location', - width: 100, - }, - { - title: '请求耗时', - key: 'consumeTime', - width: 100, - }, - { - title: '状态', - key: 'status', + title: '访客', + align: 'left', render(record) { - return h( - NTag, - { - type: record.status == 0 ? 'success' : 'error', - }, - { - default: () => (record.status == 0 ? '正常' : '异常'), - }, - ); + return h('div', [ + h( + 'div', + { + style: { marginBottom: '5px' }, + }, + record.createUser, + ), + h( + 'div', + { + style: { marginBottom: '5px' }, + }, + record.ip, + ), + h('div', record.location), + ]); + }, + }, + { + title: '请求接口', + align: 'left', + render(record) { + return h('div', [ + h( + NTag, + { + type: 'info', + style: { marginBottom: '5px' }, + }, + { + default: () => record.requestMethod, + }, + ), + h('div', '接口:' + record.url), + h('div', '名称:' + record.title), + ]); + }, + }, + { + title: '接口响应', + align: 'left', + render(record) { + return h('div', [ + h('span', '状态:'), + h( + NTag, + { + type: record.status == 0 ? 'success' : 'error', + style: { marginBottom: '5px' }, + }, + { + default: () => (record.status == 0 ? '正常' : '异常'), + }, + ), + h('div', '请求耗时:' + record.consumeTime + 'ms'), + ]); + }, + }, + { + label: '操作来源', + align: 'left', + render(record) { + return h('div', [ + h('div', '系统:' + record.os), + h('div', '类型:' + record.typeText), + h('div', '来源:' + record.sourceText), + ]); }, - width: 100, }, { title: '创建时间',