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, };