From a5b1a54113f8af2cc45307dcf477bd70da312ea9 Mon Sep 17 00:00:00 2001 From: zjl Date: Wed, 11 Dec 2024 16:07:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=99=BB=E5=BD=95=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E3=80=81=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/system/logger/loginLog.vue | 36 ++++++++++++++++--- src/views/system/logger/loginLog/columns.ts | 4 +++ src/views/system/logger/operLog.vue | 40 ++++++++++++++++----- src/views/system/logger/operLog/columns.ts | 4 +++ src/views/system/logger/operLog/edit.vue | 5 ++- 5 files changed, 75 insertions(+), 14 deletions(-) diff --git a/src/views/system/logger/loginLog.vue b/src/views/system/logger/loginLog.vue index ab5932c..3c8441f 100644 --- a/src/views/system/logger/loginLog.vue +++ b/src/views/system/logger/loginLog.vue @@ -65,14 +65,20 @@ const editVisible = ref(false); const loginlogId = ref(0); const rowKeys = ref([]); - const showModal = ref(false); + + /** + * 定义查询参数 + */ const formParams = reactive({ username: '', type: '', status: '', }); + /** + * 定义操作栏 + */ const actionColumn = reactive({ width: 200, title: '操作', @@ -102,24 +108,36 @@ }, }); - function addTable() { - showModal.value = true; - } - + /** + * 加载数据列表 + * @param res 参数 + */ const loadDataTable = async (res) => { rowKeys.value = []; const result = await getLoginLogList({ ...formParams, ...res }); return result; }; + /** + * 数据行选中事件 + * @param keys 参数 + */ function onCheckedRow(keys) { rowKeys.value = keys; } + /** + * 刷新数据列表 + * @param noRefresh 参数 + */ function reloadTable(noRefresh = '') { basicTableRef.value.reload(noRefresh ? {} : { pageNo: 1 }); } + /** + * 执行提交表单 + * @param values 参数 + */ function handleSubmit(values: Recordable) { for (const key in formParams) { formParams[key] = ''; @@ -130,6 +148,10 @@ reloadTable(); } + /** + * 执行重置 + * @param values 参数 + */ function handleReset(values: Recordable) { for (const key in formParams) { formParams[key] = ''; @@ -140,6 +162,9 @@ reloadTable(); } + /** + * 执行注册 + */ const [register, {}] = useForm({ gridProps: { cols: '1 s:1 m:2 l:3 xl:4 2xl:4' }, labelWidth: 80, @@ -155,6 +180,7 @@ await nextTick(); createModalRef.value.openModal(); } + /** * 执行删除 * @param id 参数 diff --git a/src/views/system/logger/loginLog/columns.ts b/src/views/system/logger/loginLog/columns.ts index e2ecd44..1fef96e 100644 --- a/src/views/system/logger/loginLog/columns.ts +++ b/src/views/system/logger/loginLog/columns.ts @@ -16,6 +16,7 @@ export const columns = [ { title: '访客', align: 'left', + width: 200, render(record) { return h('div', [ h( @@ -47,6 +48,7 @@ export const columns = [ { title: '请求接口', align: 'left', + width: 200, render(record) { return h('div', [ h( @@ -72,6 +74,7 @@ export const columns = [ { title: '接口响应', align: 'left', + width: 250, render(record) { return h('div', [ h('span', '状态:'), @@ -99,6 +102,7 @@ export const columns = [ { title: '操作来源', align: 'left', + width: 200, render(record) { return h('div', [ h('div', '系统:' + record.os), diff --git a/src/views/system/logger/operLog.vue b/src/views/system/logger/operLog.vue index 914ce02..ac2b467 100644 --- a/src/views/system/logger/operLog.vue +++ b/src/views/system/logger/operLog.vue @@ -54,7 +54,6 @@ import { columns } from './operLog/columns'; import { DeleteOutlined, EyeOutlined } from '@vicons/antd'; import editDialog from './operLog/edit.vue'; - import { basicModal, useModal } from '@/components/Modal'; import { schemas } from './operLog/querySchemas'; import { renderIcon } from '@/utils'; @@ -65,14 +64,19 @@ const editVisible = ref(false); const operlogId = ref(0); const rowKeys = ref([]); - const showModal = ref(false); + + /** + * 定义查询参数 + */ const formParams = reactive({ - username: '', - type: '', + title: '', status: '', }); + /** + * 定义操作栏 + */ const actionColumn = reactive({ width: 200, title: '操作', @@ -102,24 +106,36 @@ }, }); - function addTable() { - showModal.value = true; - } - + /** + * 加载数据列表 + * @param res 参数 + */ const loadDataTable = async (res) => { rowKeys.value = []; const result = await getOperLogList({ ...formParams, ...res }); return result; }; + /** + * 数据行选中事件 + * @param keys 参数 + */ function onCheckedRow(keys) { rowKeys.value = keys; } + /** + * 刷新数据列表 + * @param noRefresh 参数 + */ function reloadTable(noRefresh = '') { basicTableRef.value.reload(noRefresh ? {} : { pageNo: 1 }); } + /** + * 执行提交表单 + * @param values 参数 + */ function handleSubmit(values: Recordable) { for (const key in formParams) { formParams[key] = ''; @@ -130,6 +146,10 @@ reloadTable(); } + /** + * 执行重置 + * @param values 参数 + */ function handleReset(values: Recordable) { for (const key in formParams) { formParams[key] = ''; @@ -140,6 +160,9 @@ reloadTable(); } + /** + * 执行注册 + */ const [register, {}] = useForm({ gridProps: { cols: '1 s:1 m:2 l:3 xl:4 2xl:4' }, labelWidth: 80, @@ -155,6 +178,7 @@ await nextTick(); createModalRef.value.openModal(); } + /** * 执行删除 * @param id 参数 diff --git a/src/views/system/logger/operLog/columns.ts b/src/views/system/logger/operLog/columns.ts index 5cf0db8..73b8174 100644 --- a/src/views/system/logger/operLog/columns.ts +++ b/src/views/system/logger/operLog/columns.ts @@ -16,6 +16,7 @@ export const columns = [ { title: '访客', align: 'left', + width: 200, render(record) { return h('div', [ h( @@ -47,6 +48,7 @@ export const columns = [ { title: '请求接口', align: 'left', + width: 200, render(record) { return h('div', [ h( @@ -72,6 +74,7 @@ export const columns = [ { title: '接口响应', align: 'left', + width: 250, render(record) { return h('div', [ h('span', '状态:'), @@ -99,6 +102,7 @@ export const columns = [ { title: '操作来源', align: 'left', + width: 200, render(record) { return h('div', [ h('div', '系统:' + record.os), diff --git a/src/views/system/logger/operLog/edit.vue b/src/views/system/logger/operLog/edit.vue index bdf737e..b41593f 100644 --- a/src/views/system/logger/operLog/edit.vue +++ b/src/views/system/logger/operLog/edit.vue @@ -103,7 +103,10 @@ setFormData(); } }); - //导出方法 + + /** + * 定义函数 + */ defineExpose({ openModal, });