diff --git a/apps/web-antd/src/api/system/mail/log/index.ts b/apps/web-antd/src/api/system/mail/log/index.ts index 52c9947c5..c32b790e1 100644 --- a/apps/web-antd/src/api/system/mail/log/index.ts +++ b/apps/web-antd/src/api/system/mail/log/index.ts @@ -8,7 +8,9 @@ export namespace SystemMailLogApi { id: number; userId: number; userType: number; - toMail: string; + toMails: string[]; + ccMails?: string[]; + bccMails?: string[]; accountId: number; fromMail: string; templateId: number; @@ -32,15 +34,3 @@ export function getMailLogPage(params: PageParam) { { params }, ); } - -/** 查询邮件日志详情 */ -export function getMailLog(id: number) { - return requestClient.get( - `/system/mail-log/get?id=${id}`, - ); -} - -/** 重新发送邮件 */ -export function resendMail(id: number) { - return requestClient.put(`/system/mail-log/resend?id=${id}`); -} diff --git a/apps/web-antd/src/api/system/mail/template/index.ts b/apps/web-antd/src/api/system/mail/template/index.ts index d1bd075f1..5f7e7525a 100644 --- a/apps/web-antd/src/api/system/mail/template/index.ts +++ b/apps/web-antd/src/api/system/mail/template/index.ts @@ -20,7 +20,9 @@ export namespace SystemMailTemplateApi { /** 邮件发送信息 */ export interface MailSendReq { - mail: string; + toMails: string[]; + ccMails?: string[]; + bccMails?: string[]; templateCode: string; templateParams: Record; } 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 977e0174c..9248fdb17 100644 --- a/apps/web-antd/src/views/system/mail/log/data.ts +++ b/apps/web-antd/src/views/system/mail/log/data.ts @@ -88,8 +88,28 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { formatter: 'formatDateTime', }, { - field: 'toMail', - title: '收件邮箱', + field: 'userType', + title: '接收用户', + width: 150, + slots: { default: 'userInfo' }, + }, + { + field: 'toMails', + title: '接收信息', + width: 300, + formatter: ({ row }) => { + const lines: string[] = []; + if (row.toMails && row.toMails.length > 0) { + lines.push(`收件:${row.toMails.join('、')}`); + } + if (row.ccMails && row.ccMails.length > 0) { + lines.push(`抄送:${row.ccMails.join('、')}`); + } + if (row.bccMails && row.bccMails.length > 0) { + lines.push(`密送:${row.bccMails.join('、')}`); + } + return lines.join('\n'); + }, }, { field: 'templateTitle', @@ -136,21 +156,48 @@ export function useDetailSchema(): DescriptionItemSchema[] { label: '创建时间', content: (data) => formatDateTime(data?.createTime || '') as string, }, - { - field: 'toMail', - label: '收件邮箱', - }, { field: 'fromMail', label: '发送邮箱', }, { field: 'userId', - label: '用户编号', + label: '接收用户', + content: (data) => { + if (data?.userType && data?.userId) { + return h('div', [ + h(DictTag, { + type: DICT_TYPE.USER_TYPE, + value: data.userType, + }), + ` (${data.userId})`, + ]); + } + return '无'; + }, }, { - field: 'userType', - label: '用户类型', + field: 'toMails', + label: '接收信息', + content: (data) => { + const lines: string[] = []; + if (data?.toMails && data.toMails.length > 0) { + lines.push(`收件:${data.toMails.join('、')}`); + } + if (data?.ccMails && data.ccMails.length > 0) { + lines.push(`抄送:${data.ccMails.join('、')}`); + } + if (data?.bccMails && data.bccMails.length > 0) { + lines.push(`密送:${data.bccMails.join('、')}`); + } + return h( + 'div', + { + style: { whiteSpace: 'pre-line' }, + }, + lines.join('\n'), + ); + }, }, { field: 'templateId', diff --git a/apps/web-antd/src/views/system/mail/log/index.vue b/apps/web-antd/src/views/system/mail/log/index.vue index e2335fda4..c0cd79f41 100644 --- a/apps/web-antd/src/views/system/mail/log/index.vue +++ b/apps/web-antd/src/views/system/mail/log/index.vue @@ -6,6 +6,8 @@ import { DocAlert, Page, useVbenModal } from '@vben/common-ui'; import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; import { getMailLogPage } from '#/api/system/mail/log'; +import { DictTag } from '#/components/dict-tag'; +import { DICT_TYPE } from '#/utils'; import { useGridColumns, useGridFormSchema } from './data'; import Detail from './modules/detail.vue'; @@ -62,6 +64,13 @@ const [Grid, gridApi] = useVbenVxeGrid({ +