From 6e8048102e087b12fe3f8d0073095bd3e7d9cd76 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:33:20 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=20Tabs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/log/LoginLog.vue | 18 ++++++++++++++--- src/views/system/log/index.vue | 33 ++++++++++++++++++++++++------- 2 files changed, 41 insertions(+), 10 deletions(-) diff --git a/src/views/system/log/LoginLog.vue b/src/views/system/log/LoginLog.vue index 175dbea..44dc1b8 100644 --- a/src/views/system/log/LoginLog.vue +++ b/src/views/system/log/LoginLog.vue @@ -6,6 +6,7 @@ :loading="loading" :scroll="{ x: '100%', y: '100%', minWidth: 1000 }" :pagination="pagination" + @filterChange="filterChange" :disabledTools="['setting']" @refresh="search" > @@ -51,6 +52,17 @@ import { useTable } from '@/hooks' defineOptions({ name: 'LoginLog' }) +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() + } + console.log(values,record) +} const columns: TableInstance['columns'] = [ { title: '序号', @@ -69,14 +81,14 @@ const columns: TableInstance['columns'] = [ filters: [ { text: '成功', - value: 1 + value: '1' }, { text: '失败', - value: 2 + value: '2' } ], - filter: (value, record) => record.status == value, + filter: () =>{return true}, alignLeft: true } }, diff --git a/src/views/system/log/index.vue b/src/views/system/log/index.vue index 2bcc576..af3caf8 100644 --- a/src/views/system/log/index.vue +++ b/src/views/system/log/index.vue @@ -1,14 +1,13 @@ @@ -16,6 +15,26 @@