From 1807cb9214b4ed74cead7639ac9c9a7cad0c6ada Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Wed, 27 Sep 2023 19:58:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/logManage/operation.ts | 3 ++ src/views/logManage/operation/index.vue | 40 ++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/src/api/logManage/operation.ts b/src/api/logManage/operation.ts index ab59d48e..363e5b38 100644 --- a/src/api/logManage/operation.ts +++ b/src/api/logManage/operation.ts @@ -16,6 +16,9 @@ export async function listOperationLog(query: Record) { if (query.accountName) { querySQL += ` and account_name like '%${query.accountName}%' `; } + if (query.opType) { + querySQL += ` and op_type = '${query.opType}' `; + } if (query.beginTime) { querySQL += ` and begin_time >= '${query.beginTime}' `; } diff --git a/src/views/logManage/operation/index.vue b/src/views/logManage/operation/index.vue index d27b22bd..5de9db57 100644 --- a/src/views/logManage/operation/index.vue +++ b/src/views/logManage/operation/index.vue @@ -8,17 +8,29 @@ import { ColumnsType } from 'ant-design-vue/lib/table'; import { parseDateToStr } from '@/utils/date-utils'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { listOperationLog } from '@/api/logManage/operation'; +import useDictStore from '@/store/modules/dict'; import useI18n from '@/hooks/useI18n'; +const { getDict } = useDictStore(); const { t } = useI18n(); const route = useRoute(); /**路由标题 */ let title = ref((route.meta.title as string) ?? '标题'); +/**字典数据 */ +let dict: { + /**操作日志操作类型 */ + operationLogType: DictType[]; +} = reactive({ + operationLogType: [], +}); + /**查询参数 */ let queryParams = reactive({ /**登录账号 */ accountName: '', + /**操作类型 */ + opType: undefined, /**记录时间 */ beginTime: '', endTime: '', @@ -32,8 +44,9 @@ let queryParams = reactive({ function fnQueryReset() { queryParams = Object.assign(queryParams, { accountName: '', + opType: undefined, beginTime: '', - endTime: undefined, + endTime: '', pageNum: 1, pageSize: 20, }); @@ -92,6 +105,7 @@ let tableColumns: ColumnsType = [ { title: '操作类型', dataIndex: 'opType', + key: 'opType', align: 'center', }, { @@ -181,6 +195,12 @@ function fnGetList() { } onMounted(() => { + // 初始字典数据 + Promise.allSettled([getDict('operation_log_type')]).then(resArr => { + if (resArr[0].status === 'fulfilled') { + dict.operationLogType = resArr[0].value; + } + }); // 获取列表数据 fnGetList(); }); @@ -205,6 +225,17 @@ onMounted(() => { > + + + + + + { value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss" placeholder="查询结束时间" + style="width: 100%" /> @@ -224,6 +256,7 @@ onMounted(() => { value-format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss" placeholder="查询结束时间" + style="width: 100%" /> @@ -306,6 +339,11 @@ onMounted(() => { :pagination="tablePagination" :scroll="{ x: true }" > +