From d48b78a4620b60bcc04f4170da550e5375998a48 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 5 Aug 2025 22:23:29 +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 --- apps/web-ele/src/api/system/mail/log/index.ts | 4 ++- .../src/api/system/mail/template/index.ts | 4 ++- .../web-ele/src/views/system/mail/log/data.ts | 25 +++++++++++++++-- .../src/views/system/mail/log/index.vue | 9 ++++++ .../views/system/mail/log/modules/detail.vue | 28 ++++++++++++++----- .../src/views/system/mail/template/data.ts | 26 ++++++++++++++--- .../mail/template/modules/send-form.vue | 11 +++++++- 7 files changed, 90 insertions(+), 17 deletions(-) diff --git a/apps/web-ele/src/api/system/mail/log/index.ts b/apps/web-ele/src/api/system/mail/log/index.ts index 52c9947c5..1ae06e353 100644 --- a/apps/web-ele/src/api/system/mail/log/index.ts +++ b/apps/web-ele/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; diff --git a/apps/web-ele/src/api/system/mail/template/index.ts b/apps/web-ele/src/api/system/mail/template/index.ts index 1750cfd2a..9e2a5a78d 100644 --- a/apps/web-ele/src/api/system/mail/template/index.ts +++ b/apps/web-ele/src/api/system/mail/template/index.ts @@ -20,7 +20,9 @@ export namespace SystemMailTemplateApi { /** 邮件发送信息 */ export interface MailSendReqVO { - mail: string; + toMails: string[]; + ccMails?: string[]; + bccMails?: string[]; templateCode: string; templateParams: Record; } diff --git a/apps/web-ele/src/views/system/mail/log/data.ts b/apps/web-ele/src/views/system/mail/log/data.ts index 04f8d32e7..b2b11e001 100644 --- a/apps/web-ele/src/views/system/mail/log/data.ts +++ b/apps/web-ele/src/views/system/mail/log/data.ts @@ -91,9 +91,28 @@ export function useGridColumns( formatter: 'formatDateTime', }, { - field: 'toMail', - title: '收件邮箱', - minWidth: 160, + field: 'userType', + title: '接收用户', + minWidth: 150, + slots: { default: 'userInfo' }, + }, + { + field: 'toMails', + title: '接收信息', + minWidth: 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', diff --git a/apps/web-ele/src/views/system/mail/log/index.vue b/apps/web-ele/src/views/system/mail/log/index.vue index bf1eecada..7aaeef2f2 100644 --- a/apps/web-ele/src/views/system/mail/log/index.vue +++ b/apps/web-ele/src/views/system/mail/log/index.vue @@ -9,6 +9,8 @@ import { DocAlert, Page, useVbenModal } from '@vben/common-ui'; import { 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'; @@ -78,6 +80,13 @@ const [Grid, gridApi] = useVbenVxeGrid({ + diff --git a/apps/web-ele/src/views/system/mail/log/modules/detail.vue b/apps/web-ele/src/views/system/mail/log/modules/detail.vue index be61a42b5..ab7828ac9 100644 --- a/apps/web-ele/src/views/system/mail/log/modules/detail.vue +++ b/apps/web-ele/src/views/system/mail/log/modules/detail.vue @@ -47,17 +47,31 @@ const [Modal, modalApi] = useVbenModal({ {{ formatDateTime(formData?.createTime || '') }} - - {{ formData?.toMail }} - {{ formData?.fromMail }} - - {{ formData?.userId }} + +
+ + ({{ formData.userId }}) +
+
- - {{ formData?.userType }} + +
+
+ 收件:{{ formData.toMails.join('、') }} +
+
+ 抄送:{{ formData.ccMails.join('、') }} +
+
+ 密送:{{ formData.bccMails.join('、') }} +
+
{{ formData?.templateId }} diff --git a/apps/web-ele/src/views/system/mail/template/data.ts b/apps/web-ele/src/views/system/mail/template/data.ts index 134652990..262953951 100644 --- a/apps/web-ele/src/views/system/mail/template/data.ts +++ b/apps/web-ele/src/views/system/mail/template/data.ts @@ -126,13 +126,31 @@ export function useSendMailFormSchema(): VbenFormSchema[] { }, }, { - fieldName: 'mail', + fieldName: 'toMails', label: '收件邮箱', - component: 'Input', + component: 'Textarea', componentProps: { - placeholder: '请输入收件邮箱', + placeholder: '请输入收件邮箱,每行一个邮箱地址', + rows: 3, + }, + }, + { + fieldName: 'ccMails', + label: '抄送邮箱', + component: 'Textarea', + componentProps: { + placeholder: '请输入抄送邮箱,每行一个邮箱地址', + rows: 2, + }, + }, + { + fieldName: 'bccMails', + label: '密送邮箱', + component: 'Textarea', + componentProps: { + placeholder: '请输入密送邮箱,每行一个邮箱地址', + rows: 2, }, - rules: z.string().email('请输入正确的邮箱'), }, ]; } diff --git a/apps/web-ele/src/views/system/mail/template/modules/send-form.vue b/apps/web-ele/src/views/system/mail/template/modules/send-form.vue index a6fc843fd..b40359dd6 100644 --- a/apps/web-ele/src/views/system/mail/template/modules/send-form.vue +++ b/apps/web-ele/src/views/system/mail/template/modules/send-form.vue @@ -42,8 +42,17 @@ const [Modal, modalApi] = useVbenModal({ paramsObj[param] = values[`param_${param}`]; }); } + const parseEmails = (text: string): string[] => { + if (!text) return []; + return text + .split('\n') + .map((email) => email.trim()) + .filter((email) => email.length > 0); + }; const data: SystemMailTemplateApi.MailSendReqVO = { - mail: values.mail, + toMails: parseEmails(values.toMails || ''), + ccMails: parseEmails(values.ccMails || ''), + bccMails: parseEmails(values.bccMails || ''), templateCode: formData.value?.code || '', templateParams: paramsObj, };