From a9a6fd9b884da140e75110983bc47e8d15e10b4b Mon Sep 17 00:00:00 2001 From: lai <10633968+laiyujun1@user.noreply.gitee.com> Date: Thu, 16 Jan 2025 14:23:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=97=A5=E5=BF=97=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/typings/components.d.ts | 1 + src/views/manage/log/index.vue | 80 ++++++++++++++------- src/views/manage/log/modules/log-search.vue | 6 +- 3 files changed, 57 insertions(+), 30 deletions(-) diff --git a/src/typings/components.d.ts b/src/typings/components.d.ts index 1f73c16..46215fd 100644 --- a/src/typings/components.d.ts +++ b/src/typings/components.d.ts @@ -45,6 +45,7 @@ declare module 'vue' { ASelectOption: typeof import('ant-design-vue/es')['SelectOption'] ASpace: typeof import('ant-design-vue/es')['Space'] ASpin: typeof import('ant-design-vue/es')['Spin'] + AStatistic: typeof import('ant-design-vue/es')['Statistic'] AStep: typeof import('ant-design-vue/es')['Step'] ASteps: typeof import('ant-design-vue/es')['Steps'] ASwitch: typeof import('ant-design-vue/es')['Switch'] diff --git a/src/views/manage/log/index.vue b/src/views/manage/log/index.vue index a5bbd2f..cc8eb0f 100644 --- a/src/views/manage/log/index.vue +++ b/src/views/manage/log/index.vue @@ -7,11 +7,22 @@ import logSearch from './modules/log-search.vue'; import { useI18n } from "vue-i18n"; import { saveAs } from 'file-saver'; const { t } = useI18n(); +import useDictStore from '@/store/modules/dict'; const wrapperEl = shallowRef(null); const { height: wrapperElHeight } = useElementSize(wrapperEl); + +const { parseDataDict, getDict } = useDictStore(); +/**字典数据 */ +let dict: { + /**数据状态 */ + sysBusinessType: any[]; +} = reactive({ + sysBusinessType: [], +}); + const scrollConfig = computed(() => { return { y: wrapperElHeight.value - 72, @@ -41,26 +52,10 @@ const { columns, columnChecks, data, loading, getData, mobilePagination, searchP align: 'center' }, { - key: 'operatorType', - dataIndex: 'operatorType', + key: 'businessType', + dataIndex: 'businessType', title: t('page.manage.log.operType'), align: 'center', - customRender: ({ record }: any) => { - if (record.operatorType === null) { - return null; - } - const tagMap: any = { - 0: t('page.manage.log.other'), - 1: t('page.manage.log.backUser'), - 2: t('page.manage.log.phoneUser'), - }; - const tagColor: any = { - '0': 'pink', - '1': 'warning', - '2': 'blue', - }; - return {tagMap[record.operatorType]} ; - } }, { key: 'operName', @@ -68,12 +63,33 @@ const { columns, columnChecks, data, loading, getData, mobilePagination, searchP title: t('page.manage.log.operName'), align: 'center' }, + { + key: 'operUrl', + dataIndex: 'operUrl', + title: t('page.manage.log.operUrl'), + align: 'center', + ellipsis: true, + }, { key: 'operIp', dataIndex: 'operIp', title: t('page.manage.log.operIp'), align: 'center', }, + { + key: 'operParam', + dataIndex: 'operParam', + title: t('page.manage.log.operParam'), + align: 'center', + ellipsis: true, + }, + { + key: 'jsonResult', + dataIndex: 'jsonResult', + title: t('page.manage.log.jsonResult'), + align: 'center', + ellipsis: true, + }, { key: 'status', dataIndex: 'status', @@ -126,7 +142,15 @@ const { const deptTreeData = ref([]); onMounted(() => { - getUserDeptTree(); + // 初始字典数据 + Promise.allSettled([ + getDict('sys_oper_type'), + ]).then((resArr: any) => { + if (resArr[0].status === 'fulfilled') { + dict.sysBusinessType = resArr[0].value; + } + }); + }); async function handleBatchDelete() { @@ -147,12 +171,7 @@ function handleUserSelectChange(selectedRowKeys: Key[], selectedRows: any[]) { -async function getUserDeptTree() { - const { error, data: tree } = await doGetUserDeptTree(); - if (!error) { - deptTreeData.value = tree; - } -} + function handleExport() { Modal.confirm({ @@ -182,7 +201,7 @@ function handleExport() {
-