From 69b662bb53777b98f6105f4486bd2527948cc4a6 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 10 Sep 2025 00:29:08 +0800 Subject: [PATCH] =?UTF-8?q?reactor=EF=BC=9A=E3=80=90system=20=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E7=AE=A1=E7=90=86=E3=80=91loginlog=E3=80=81maillog?= =?UTF-8?q?=E3=80=81smslog=20=E7=9A=84=E6=8F=8F=E8=BF=B0=E7=BB=9F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/system/loginlog/data.ts | 9 +- .../views/system/loginlog/modules/detail.vue | 4 +- .../src/views/system/mail/log/data.ts | 19 ++- .../views/system/mail/log/modules/detail.vue | 6 +- .../web-antd/src/views/system/sms/log/data.ts | 41 ++++-- .../src/views/system/sms/log/index.vue | 5 +- .../views/system/sms/log/modules/detail.vue | 6 +- .../web-ele/src/views/system/loginlog/data.ts | 55 ++++++++ .../views/system/loginlog/modules/detail.vue | 56 +++----- .../web-ele/src/views/system/mail/log/data.ts | 113 +++++++++++++++ .../views/system/mail/log/modules/detail.vue | 85 +++-------- apps/web-ele/src/views/system/sms/log/data.ts | 132 ++++++++++++++---- .../src/views/system/sms/log/index.vue | 68 +++++---- .../views/system/sms/log/modules/detail.vue | 88 +++--------- 14 files changed, 419 insertions(+), 268 deletions(-) diff --git a/apps/web-antd/src/views/system/loginlog/data.ts b/apps/web-antd/src/views/system/loginlog/data.ts index d6399908..911b021a 100644 --- a/apps/web-antd/src/views/system/loginlog/data.ts +++ b/apps/web-antd/src/views/system/loginlog/data.ts @@ -1,5 +1,6 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { SystemLoginLogApi } from '#/api/system/login-log'; import type { DescriptionItemSchema } from '#/components/description'; import { h } from 'vue'; @@ -109,7 +110,7 @@ export function useDetailSchema(): DescriptionItemSchema[] { { field: 'logType', label: '操作类型', - content: (data) => { + content: (data: SystemLoginLogApi.LoginLog) => { return h(DictTag, { type: DICT_TYPE.SYSTEM_LOGIN_TYPE, value: data?.logType, @@ -131,7 +132,7 @@ export function useDetailSchema(): DescriptionItemSchema[] { { field: 'result', label: '登录结果', - content: (data) => { + content: (data: SystemLoginLogApi.LoginLog) => { return h(DictTag, { type: DICT_TYPE.SYSTEM_LOGIN_RESULT, value: data?.result, @@ -141,7 +142,9 @@ export function useDetailSchema(): DescriptionItemSchema[] { { field: 'createTime', label: '登录日期', - content: (data) => formatDateTime(data?.createTime || '') as string, + content: (data: SystemLoginLogApi.LoginLog) => { + return formatDateTime(data?.createTime || '') as string; + }, }, ]; } diff --git a/apps/web-antd/src/views/system/loginlog/modules/detail.vue b/apps/web-antd/src/views/system/loginlog/modules/detail.vue index 61bcc89b..cac51184 100644 --- a/apps/web-antd/src/views/system/loginlog/modules/detail.vue +++ b/apps/web-antd/src/views/system/loginlog/modules/detail.vue @@ -11,7 +11,7 @@ import { useDetailSchema } from '../data'; const formData = ref(); -const [Descriptions] = useDescription({ +const [Description] = useDescription({ componentProps: { bordered: true, column: 1, @@ -48,6 +48,6 @@ const [Modal, modalApi] = useVbenModal({ :show-cancel-button="false" :show-confirm-button="false" > - + diff --git a/apps/web-antd/src/views/system/mail/log/data.ts b/apps/web-antd/src/views/system/mail/log/data.ts index 4e677b70..b6d60dad 100644 --- a/apps/web-antd/src/views/system/mail/log/data.ts +++ b/apps/web-antd/src/views/system/mail/log/data.ts @@ -1,5 +1,6 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { SystemMailLogApi } from '#/api/system/mail/log'; import type { DescriptionItemSchema } from '#/components/description'; import { h } from 'vue'; @@ -163,7 +164,9 @@ export function useDetailSchema(): DescriptionItemSchema[] { { field: 'createTime', label: '创建时间', - content: (data) => formatDateTime(data?.createTime || '') as string, + content: (data: SystemMailLogApi.MailLog) => { + return formatDateTime(data?.createTime || '') as string; + }, }, { field: 'fromMail', @@ -172,7 +175,7 @@ export function useDetailSchema(): DescriptionItemSchema[] { { field: 'userId', label: '接收用户', - content: (data) => { + content: (data: SystemMailLogApi.MailLog) => { if (data?.userType && data?.userId) { return h('div', [ h(DictTag, { @@ -188,7 +191,7 @@ export function useDetailSchema(): DescriptionItemSchema[] { { field: 'toMails', label: '接收信息', - content: (data) => { + content: (data: SystemMailLogApi.MailLog) => { const lines: string[] = []; if (data?.toMails && data.toMails.length > 0) { lines.push(`收件:${data.toMails.join('、')}`); @@ -223,8 +226,8 @@ export function useDetailSchema(): DescriptionItemSchema[] { { field: 'templateContent', label: '邮件内容', - content: (data) => { - // 渲染HTML内容 + span: 2, + content: (data: SystemMailLogApi.MailLog) => { return h('div', { innerHTML: data?.templateContent || '', }); @@ -233,7 +236,7 @@ export function useDetailSchema(): DescriptionItemSchema[] { { field: 'sendStatus', label: '发送状态', - content: (data) => { + content: (data: SystemMailLogApi.MailLog) => { return h(DictTag, { type: DICT_TYPE.SYSTEM_MAIL_SEND_STATUS, value: data?.sendStatus, @@ -243,7 +246,9 @@ export function useDetailSchema(): DescriptionItemSchema[] { { field: 'sendTime', label: '发送时间', - content: (data) => formatDateTime(data?.sendTime || '') as string, + content: (data: SystemMailLogApi.MailLog) => { + return formatDateTime(data?.sendTime || '') as string; + }, }, { field: 'sendMessageId', diff --git a/apps/web-antd/src/views/system/mail/log/modules/detail.vue b/apps/web-antd/src/views/system/mail/log/modules/detail.vue index f29a26d2..0229e933 100644 --- a/apps/web-antd/src/views/system/mail/log/modules/detail.vue +++ b/apps/web-antd/src/views/system/mail/log/modules/detail.vue @@ -11,7 +11,7 @@ import { useDetailSchema } from '../data'; const formData = ref(); -const [Descriptions] = useDescription({ +const [Description] = useDescription({ componentProps: { bordered: true, column: 2, @@ -44,10 +44,10 @@ const [Modal, modalApi] = useVbenModal({ diff --git a/apps/web-antd/src/views/system/sms/log/data.ts b/apps/web-antd/src/views/system/sms/log/data.ts index e256287a..ab30a080 100644 --- a/apps/web-antd/src/views/system/sms/log/data.ts +++ b/apps/web-antd/src/views/system/sms/log/data.ts @@ -1,16 +1,16 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { SystemSmsLogApi } from '#/api/system/sms/log'; import type { DescriptionItemSchema } from '#/components/description'; import { h } from 'vue'; +import { DICT_TYPE } from '@vben/constants'; +import { getDictOptions } from '@vben/hooks'; import { formatDateTime } from '@vben/utils'; import { getSimpleSmsChannelList } from '#/api/system/sms/channel'; import { DictTag } from '#/components/dict-tag'; -import { DICT_TYPE } from '@vben/constants'; -import { getDictOptions } from '@vben/hooks'; - import { getRangePickerDefaultProps } from '#/utils'; /** 列表的搜索表单 */ @@ -93,10 +93,18 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'id', title: '编号', + minWidth: 100, + }, + { + field: 'createTime', + title: '创建时间', + minWidth: 180, + formatter: 'formatDateTime', }, { field: 'mobile', title: '手机号', + minWidth: 120, }, { field: 'templateContent', @@ -106,6 +114,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'sendStatus', title: '发送状态', + minWidth: 120, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.SYSTEM_SMS_SEND_STATUS }, @@ -114,11 +123,13 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'sendTime', title: '发送时间', + minWidth: 180, formatter: 'formatDateTime', }, { field: 'receiveStatus', title: '接收状态', + minWidth: 120, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.SYSTEM_SMS_RECEIVE_STATUS }, @@ -127,11 +138,13 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'receiveTime', title: '接收时间', + minWidth: 180, formatter: 'formatDateTime', }, { field: 'channelCode', title: '短信渠道', + minWidth: 120, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE }, @@ -140,10 +153,12 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'templateId', title: '模板编号', + minWidth: 100, }, { field: 'templateType', title: '短信类型', + minWidth: 100, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE }, @@ -152,6 +167,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'createTime', title: '创建时间', + minWidth: 180, formatter: 'formatDateTime', }, { @@ -169,7 +185,9 @@ export function useDetailSchema(): DescriptionItemSchema[] { { field: 'createTime', label: '创建时间', - content: (data) => formatDateTime(data?.createTime || '') as string, + content: (data: SystemSmsLogApi.SmsLog) => { + return formatDateTime(data?.createTime || '') as string; + }, }, { field: 'mobile', @@ -186,7 +204,7 @@ export function useDetailSchema(): DescriptionItemSchema[] { { field: 'templateType', label: '模板类型', - content: (data) => { + content: (data: SystemSmsLogApi.SmsLog) => { return h(DictTag, { type: DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE, value: data?.templateType, @@ -200,7 +218,7 @@ export function useDetailSchema(): DescriptionItemSchema[] { { field: 'sendStatus', label: '发送状态', - content: (data) => { + content: (data: SystemSmsLogApi.SmsLog) => { return h(DictTag, { type: DICT_TYPE.SYSTEM_SMS_SEND_STATUS, value: data?.sendStatus, @@ -210,7 +228,9 @@ export function useDetailSchema(): DescriptionItemSchema[] { { field: 'sendTime', label: '发送时间', - content: (data) => formatDateTime(data?.sendTime || '') as string, + content: (data: SystemSmsLogApi.SmsLog) => { + return formatDateTime(data?.sendTime || '') as string; + }, }, { field: 'apiSendCode', @@ -223,7 +243,7 @@ export function useDetailSchema(): DescriptionItemSchema[] { { field: 'receiveStatus', label: '接收状态', - content: (data) => { + content: (data: SystemSmsLogApi.SmsLog) => { return h(DictTag, { type: DICT_TYPE.SYSTEM_SMS_RECEIVE_STATUS, value: data?.receiveStatus, @@ -233,7 +253,9 @@ export function useDetailSchema(): DescriptionItemSchema[] { { field: 'receiveTime', label: '接收时间', - content: (data) => formatDateTime(data?.receiveTime || '') as string, + content: (data: SystemSmsLogApi.SmsLog) => { + return formatDateTime(data?.receiveTime || '') as string; + }, }, { field: 'apiReceiveCode', @@ -242,6 +264,7 @@ export function useDetailSchema(): DescriptionItemSchema[] { { field: 'apiReceiveMsg', label: 'API 接收消息', + span: 2, }, { field: 'apiRequestId', diff --git a/apps/web-antd/src/views/system/sms/log/index.vue b/apps/web-antd/src/views/system/sms/log/index.vue index 137ed105..ad2de303 100644 --- a/apps/web-antd/src/views/system/sms/log/index.vue +++ b/apps/web-antd/src/views/system/sms/log/index.vue @@ -18,7 +18,7 @@ const [DetailModal, detailModalApi] = useVbenModal({ }); /** 刷新表格 */ -function onRefresh() { +function handleRefresh() { gridApi.query(); } @@ -54,6 +54,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ }, rowConfig: { keyField: 'id', + isHover: true, }, toolbarConfig: { refresh: true, @@ -69,7 +70,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ - +