From 55061b73def494a50d7c34a4e7ecbf00b36e2ceb Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 5 Aug 2025 21:45:23 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E3=80=90system=20=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E5=8A=9F=E8=83=BD=E3=80=91=E9=82=AE=E7=AE=B1=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=8A=84=E9=80=81=E3=80=81=E5=AF=86=E9=80=81=EF=BC=8C?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=A4=9A=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web-antd/src/api/system/mail/log/index.ts | 16 +---- .../src/api/system/mail/template/index.ts | 4 +- .../src/views/system/mail/log/data.ts | 65 ++++++++++++++++--- .../src/views/system/mail/log/index.vue | 9 +++ .../src/views/system/mail/template/data.ts | 26 ++++++-- .../mail/template/modules/send-form.vue | 11 +++- 6 files changed, 103 insertions(+), 28 deletions(-) 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({ +