From 5630cc65c9dc2397bc6eb354976cd382b19afcb1 Mon Sep 17 00:00:00 2001 From: jmal Date: Thu, 26 Dec 2024 11:35:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/setting/sys/logList.vue | 36 ++++++++++++++++++++++---- src/views/setting/sys/logOperation.vue | 22 +++++++--------- 2 files changed, 41 insertions(+), 17 deletions(-) diff --git a/src/views/setting/sys/logList.vue b/src/views/setting/sys/logList.vue index 1e96248..7e5f02e 100644 --- a/src/views/setting/sys/logList.vue +++ b/src/views/setting/sys/logList.vue @@ -111,7 +111,10 @@ export default { label: '登录' }, { value: 'OPERATION', - label: '操作' + label: '系统操作' + }, { + value: 'OPERATION_FILE', + label: '文件操作' }, { value: 'ARTICLE', label: '文章' @@ -180,17 +183,37 @@ export default { this.queryCondition.type = this.typeValue if (this.typeValue === 'ARTICLE') { this.tableHeader[0].disabled = true - this.tableHeader[1].disabled = true - this.tableHeader[3].disabled = true - this.tableHeader[5].minWidth = 200 + this.tableHeader[1].disabled = false + this.tableHeader[2].disabled = true + this.tableHeader[3].disabled = false + this.tableHeader[4].disabled = false + this.tableHeader[5].disabled = false + this.tableHeader[6].disabled = false + this.tableHeader[7].disabled = false + } else if (this.typeValue === 'OPERATION_FILE') { + this.operationFileType() } else { this.tableHeader[0].disabled = false this.tableHeader[1].disabled = false + this.tableHeader[2].disabled = true this.tableHeader[3].disabled = false - this.tableHeader[5].minWidth = 105 + this.tableHeader[4].disabled = false + this.tableHeader[5].disabled = false + this.tableHeader[6].disabled = false + this.tableHeader[7].disabled = false } this.queryLogList() }, + operationFileType() { + this.tableHeader[0].disabled = false + this.tableHeader[1].disabled = false + this.tableHeader[2].disabled = false + this.tableHeader[3].disabled = false + this.tableHeader[4].disabled = true + this.tableHeader[5].disabled = true + this.tableHeader[6].disabled = true + this.tableHeader[7].disabled = false + }, queryLogList(val) { this.$refs.tableList.initPageIndex() this.getLogList() @@ -200,6 +223,9 @@ export default { this.queryCondition.startTime = this.pickerValue[0].getTime() this.queryCondition.endTime = this.pickerValue[1].getTime() } + if (this.typeValue === 'OPERATION_FILE') { + this.operationFileType() + } this.loading = true logApi.logList({ page: this.pagination.pageIndex, diff --git a/src/views/setting/sys/logOperation.vue b/src/views/setting/sys/logOperation.vue index 2150b63..dc229ec 100644 --- a/src/views/setting/sys/logOperation.vue +++ b/src/views/setting/sys/logOperation.vue @@ -63,7 +63,7 @@ 关闭 - + @@ -77,15 +77,13 @@ export default { data() { return { tableHeader: [ - {prop: 'username', label: '账号', minWidth: 105, sortable: 'custom'}, - {prop: 'showName', label: '用户名', minWidth: 105, sortable: 'custom'}, - {prop: 'ip', label: 'IP地址', minWidth: 105, sortable: 'custom'}, - {prop: 'operationModule', label: '操作模块', minWidth: 105, sortable: 'custom'}, - {prop: 'operationFun', label: '操作功能', minWidth: 105, sortable: 'custom'}, - {prop: 'url', label: '请求地址', minWidth: 105, sortable: 'custom'}, - {prop: 'method', label: '方式', minWidth: 75, sortable: 'custom'}, + {prop: 'username', label: '账号', width: 105, sortable: 'custom'}, + {prop: 'ip', label: 'IP地址', width: 130, sortable: 'custom'}, + {prop: 'filepath', label: '文件', sortable: 'custom'}, + {prop: 'operationFun', label: '操作功能', sortable: 'custom'}, + {prop: 'url', label: '请求地址', sortable: 'custom'}, { - prop: 'status', minWidth: 75, label: '状态', tag: true, sortable: 'custom', + prop: 'status', width: 75, label: '状态', tag: true, sortable: 'custom', formatData: (status) => { if (status === 0) { return [{name: '正常', type: 'success'}] @@ -95,14 +93,14 @@ export default { } }, { - prop: 'time', label: '耗时', minWidth: 75, sortable: 'custom', + prop: 'time', label: '耗时', width: 100, sortable: 'custom', formatData: (time) => { return time + 'ms' } }, - {prop: 'createTime', label: '创建时间', minWidth: 150, sortable: 'custom'}, + {prop: 'createTime', label: '时间', width: 170, sortable: 'custom'}, { - label: '操作', minWidth: 75, active: [ + label: '操作', width: 80, active: [ {name: '详情', icon: 'el-icon-view', handle: (row) => this.details(row)}, ], },