From 63da55ab0375360979a79fc3effef061690989c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E5=B8=86?= <201379873@qq.com> Date: Wed, 10 Apr 2024 20:49:18 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E7=AD=9B=E9=80=89=E4=B8=8E=E6=96=87=E6=9C=AC=E5=A4=8D?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TextCopy/index.vue | 28 +++++++++++++++++++ src/views/system/log/LoginLog.vue | 1 - src/views/system/log/OperationLog.vue | 18 +++++++++--- .../system/log/OperationLogDetailDrawer.vue | 5 ++-- 4 files changed, 44 insertions(+), 8 deletions(-) create mode 100644 src/components/TextCopy/index.vue diff --git a/src/components/TextCopy/index.vue b/src/components/TextCopy/index.vue new file mode 100644 index 0000000..c61d9a1 --- /dev/null +++ b/src/components/TextCopy/index.vue @@ -0,0 +1,28 @@ + + + \ No newline at end of file diff --git a/src/views/system/log/LoginLog.vue b/src/views/system/log/LoginLog.vue index 44dc1b8..b78bbfa 100644 --- a/src/views/system/log/LoginLog.vue +++ b/src/views/system/log/LoginLog.vue @@ -61,7 +61,6 @@ const filterChange = (values,record)=>{ } catch (error) { search() } - console.log(values,record) } const columns: TableInstance['columns'] = [ { diff --git a/src/views/system/log/OperationLog.vue b/src/views/system/log/OperationLog.vue index 9d15370..5b8d941 100644 --- a/src/views/system/log/OperationLog.vue +++ b/src/views/system/log/OperationLog.vue @@ -7,6 +7,7 @@ :scroll="{ x: '100%', y: '100%', minWidth: 1000 }" :pagination="pagination" column-resizable + @filterChange="filterChange" :disabledTools="['setting']" @refresh="search" > @@ -62,7 +63,16 @@ import OperationLogDetailDrawer from './OperationLogDetailDrawer.vue' import { useTable } from '@/hooks' defineOptions({ name: 'OperationLog' }) - +const filterChange = (values,record)=>{ + try { + const slotName = columns[values.split('_').pop()].slotName as string + const value = record.join(',') + queryForm[slotName] = value + search() + } catch (error) { + search() + } +} const columns: TableInstance['columns'] = [ { title: '序号', @@ -82,14 +92,14 @@ const columns: TableInstance['columns'] = [ filters: [ { text: '成功', - value: 1 + value: '1' }, { text: '失败', - value: 2 + value: '2' } ], - filter: (value, record) => record.status == value, + filter: () => true, alignLeft: true } }, diff --git a/src/views/system/log/OperationLogDetailDrawer.vue b/src/views/system/log/OperationLogDetailDrawer.vue index e3e9fb0..01f71d3 100644 --- a/src/views/system/log/OperationLogDetailDrawer.vue +++ b/src/views/system/log/OperationLogDetailDrawer.vue @@ -2,7 +2,7 @@ {{ operationLog?.id }} - {{ operationLog?.traceId }} + {{ operationLog?.traceId }} {{ operationLog?.createUserString }} {{ operationLog?.createTime }} {{ operationLog?.description }} @@ -25,7 +25,7 @@ {{ operationLog?.timeTaken }} ms - {{ operationLog?.requestUrl }} + {{ operationLog?.requestUrl }} () // 查询详情