From a7503322107ad890908c9986e23949af9c7acdd7 Mon Sep 17 00:00:00 2001 From: lour6498 Date: Tue, 21 Mar 2023 10:01:06 +0800 Subject: [PATCH] =?UTF-8?q?Vue3=20=E9=87=8D=E6=9E=84=EF=BC=9A=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/loginLog/index.ts | 4 +- src/styles/index.scss | 6 + src/views/system/loginlog/detail.vue | 49 +++++ src/views/system/loginlog/index.vue | 213 ++++++++++++++++----- src/views/system/loginlog/loginLog.data.ts | 53 ----- 5 files changed, 225 insertions(+), 100 deletions(-) create mode 100644 src/views/system/loginlog/detail.vue delete mode 100644 src/views/system/loginlog/loginLog.data.ts diff --git a/src/api/system/loginLog/index.ts b/src/api/system/loginLog/index.ts index cadaeaf3..5b06e753 100644 --- a/src/api/system/loginLog/index.ts +++ b/src/api/system/loginLog/index.ts @@ -21,10 +21,10 @@ export interface LoginLogReqVO extends PageParam { } // 查询登录日志列表 -export const getLoginLogPageApi = (params: LoginLogReqVO) => { +export const getLoginLogPage = (params: LoginLogReqVO) => { return request.get({ url: '/system/login-log/page', params }) } // 导出登录日志 -export const exportLoginLogApi = (params: LoginLogReqVO) => { +export const exportLoginLog = (params: LoginLogReqVO) => { return request.download({ url: '/system/login-log/export', params }) } diff --git a/src/styles/index.scss b/src/styles/index.scss index 39c4c4da..02c187a5 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -26,3 +26,9 @@ border-left-color: var(--el-color-primary); } } + +// 添加表头样式 +.el-table.yudao-table { + --el-table-header-bg-color: #f8f8f9; + --el-table-header-text-color: #606266; +} diff --git a/src/views/system/loginlog/detail.vue b/src/views/system/loginlog/detail.vue new file mode 100644 index 00000000..8372d2e6 --- /dev/null +++ b/src/views/system/loginlog/detail.vue @@ -0,0 +1,49 @@ + + diff --git a/src/views/system/loginlog/index.vue b/src/views/system/loginlog/index.vue index f2bb8c67..f5a695fc 100644 --- a/src/views/system/loginlog/index.vue +++ b/src/views/system/loginlog/index.vue @@ -1,53 +1,176 @@ - diff --git a/src/views/system/loginlog/loginLog.data.ts b/src/views/system/loginlog/loginLog.data.ts deleted file mode 100644 index c0a51fbe..00000000 --- a/src/views/system/loginlog/loginLog.data.ts +++ /dev/null @@ -1,53 +0,0 @@ -import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' - -// CrudSchema -const crudSchemas = reactive({ - primaryKey: 'id', - primaryType: 'id', - primaryTitle: '日志编号', - action: true, - actionWidth: '100px', - columns: [ - { - title: '日志类型', - field: 'logType', - dictType: DICT_TYPE.SYSTEM_LOGIN_TYPE, - dictClass: 'number' - }, - { - title: '用户名称', - field: 'username', - isSearch: true - }, - { - title: '登录地址', - field: 'userIp', - isSearch: true - }, - { - title: '浏览器', - field: 'userAgent' - }, - { - title: '登陆结果', - field: 'result', - dictType: DICT_TYPE.SYSTEM_LOGIN_RESULT, - dictClass: 'number' - }, - { - title: '登录日期', - field: 'createTime', - formatter: 'formatDate', - table: { - width: 150 - }, - search: { - show: true, - itemRender: { - name: 'XDataTimePicker' - } - } - } - ] -}) -export const { allSchemas } = useVxeCrudSchemas(crudSchemas)