feat:【system 系统功能】邮箱增加抄送、密送,支持多个
parent
0926c69781
commit
ff7beb6db2
|
|
@ -4,7 +4,9 @@ export interface MailLogVO {
|
||||||
id: number
|
id: number
|
||||||
userId: number
|
userId: number
|
||||||
userType: number
|
userType: number
|
||||||
toMail: string
|
toMails: string[]
|
||||||
|
ccMails?: string[]
|
||||||
|
bccMails?: string[]
|
||||||
accountId: number
|
accountId: number
|
||||||
fromMail: string
|
fromMail: string
|
||||||
templateId: number
|
templateId: number
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,9 @@ export interface MailTemplateVO {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MailSendReqVO {
|
export interface MailSendReqVO {
|
||||||
mail: string
|
toMails: string[]
|
||||||
|
ccMails?: string[]
|
||||||
|
bccMails?: string[]
|
||||||
templateCode: string
|
templateCode: string
|
||||||
templateParams: Map<String, Object>
|
templateParams: Map<String, Object>
|
||||||
}
|
}
|
||||||
|
|
@ -46,7 +48,10 @@ export const deleteMailTemplate = async (id: number) => {
|
||||||
|
|
||||||
// 批量删除邮件模版
|
// 批量删除邮件模版
|
||||||
export const deleteMailTemplateList = async (ids: number[]) => {
|
export const deleteMailTemplateList = async (ids: number[]) => {
|
||||||
return await request.delete({ url: '/system/mail-template/delete-list', params: { ids: ids.join(',') } })
|
return await request.delete({
|
||||||
|
url: '/system/mail-template/delete-list',
|
||||||
|
params: { ids: ids.join(',') }
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 发送邮件
|
// 发送邮件
|
||||||
|
|
|
||||||
|
|
@ -13,12 +13,34 @@
|
||||||
<el-descriptions-item label="模版发送人名称">
|
<el-descriptions-item label="模版发送人名称">
|
||||||
{{ detailData.templateNickname }}
|
{{ detailData.templateNickname }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="用户信息">
|
<el-descriptions-item label="接收用户">
|
||||||
{{ detailData.toMail }}
|
|
||||||
<span v-if="detailData.userType && detailData.userId">
|
<span v-if="detailData.userType && detailData.userId">
|
||||||
<dict-tag :type="DICT_TYPE.USER_TYPE" :value="detailData.userType" />
|
<dict-tag :type="DICT_TYPE.USER_TYPE" :value="detailData.userType" />
|
||||||
({{ detailData.userId }})
|
({{ detailData.userId }})
|
||||||
</span>
|
</span>
|
||||||
|
<span v-else>无</span>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="接收信息">
|
||||||
|
<div>
|
||||||
|
<div v-if="detailData.toMails && detailData.toMails.length > 0">
|
||||||
|
收件:
|
||||||
|
<span v-for="(mail, index) in detailData.toMails" :key="mail">
|
||||||
|
{{ mail }}<span v-if="index < detailData.toMails.length - 1">、</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div v-if="detailData.ccMails && detailData.ccMails.length > 0">
|
||||||
|
抄送:
|
||||||
|
<span v-for="(mail, index) in detailData.ccMails" :key="mail">
|
||||||
|
{{ mail }}<span v-if="index < detailData.ccMails.length - 1">、</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div v-if="detailData.bccMails && detailData.bccMails.length > 0">
|
||||||
|
密送:
|
||||||
|
<span v-for="(mail, index) in detailData.bccMails" :key="mail">
|
||||||
|
{{ mail }}<span v-if="index < detailData.bccMails.length - 1">、</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="邮件标题">
|
<el-descriptions-item label="邮件标题">
|
||||||
{{ detailData.templateTitle }}
|
{{ detailData.templateTitle }}
|
||||||
|
|
@ -58,7 +80,7 @@ defineOptions({ name: 'SystemMailLogDetail' })
|
||||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
const detailLoading = ref(false) // 表单的加载中
|
const detailLoading = ref(false) // 表单的加载中
|
||||||
const detailData = ref() // 详情数据
|
const detailData = ref() // 详情数据
|
||||||
const accountList = ref([]) // 邮箱账号列表
|
const accountList = ref<MailAccountApi.MailAccountVO[]>([]) // 邮箱账号列表
|
||||||
|
|
||||||
/** 打开弹窗 */
|
/** 打开弹窗 */
|
||||||
const open = async (data: MailLogApi.MailLogVO) => {
|
const open = async (data: MailLogApi.MailLogVO) => {
|
||||||
|
|
|
||||||
|
|
@ -119,12 +119,36 @@
|
||||||
width="180"
|
width="180"
|
||||||
:formatter="dateFormatter"
|
:formatter="dateFormatter"
|
||||||
/>
|
/>
|
||||||
<el-table-column label="接收邮箱" align="center" prop="toMail" width="200">
|
<el-table-column label="接收用户" align="center" width="150">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<div>{{ scope.row.toMail }}</div>
|
|
||||||
<div v-if="scope.row.userType && scope.row.userId">
|
<div v-if="scope.row.userType && scope.row.userId">
|
||||||
<dict-tag :type="DICT_TYPE.USER_TYPE" :value="scope.row.userType" />
|
<dict-tag :type="DICT_TYPE.USER_TYPE" :value="scope.row.userType" />
|
||||||
{{ '(' + scope.row.userId + ')' }}
|
<div>{{ '(' + scope.row.userId + ')' }}</div>
|
||||||
|
</div>
|
||||||
|
<div v-else>-</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="接收信息" align="center" width="300">
|
||||||
|
<template #default="scope">
|
||||||
|
<div class="text-left">
|
||||||
|
<div v-if="scope.row.toMails && scope.row.toMails.length > 0">
|
||||||
|
收件:
|
||||||
|
<span v-for="(mail, index) in scope.row.toMails" :key="mail">
|
||||||
|
{{ mail }}<span v-if="index < scope.row.toMails.length - 1">、</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div v-if="scope.row.ccMails && scope.row.ccMails.length > 0">
|
||||||
|
抄送:
|
||||||
|
<span v-for="(mail, index) in scope.row.ccMails" :key="mail">
|
||||||
|
{{ mail }}<span v-if="index < scope.row.ccMails.length - 1">、</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div v-if="scope.row.bccMails && scope.row.bccMails.length > 0">
|
||||||
|
密送:
|
||||||
|
<span v-for="(mail, index) in scope.row.bccMails" :key="mail">
|
||||||
|
{{ mail }}<span v-if="index < scope.row.bccMails.length - 1">、</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
@ -185,15 +209,15 @@ const queryParams = reactive({
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
toMail: '',
|
toMail: '',
|
||||||
accountId: null,
|
accountId: undefined,
|
||||||
templateId: null,
|
templateId: undefined,
|
||||||
sendStatus: null,
|
sendStatus: undefined,
|
||||||
userId: null,
|
userId: undefined,
|
||||||
userType: null,
|
userType: undefined,
|
||||||
sendTime: []
|
sendTime: []
|
||||||
})
|
})
|
||||||
const exportLoading = ref(false) // 导出的加载中
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
const accountList = ref([]) // 邮箱账号列表
|
const accountList = ref<MailAccountApi.MailAccountVO[]>([]) // 邮箱账号列表
|
||||||
|
|
||||||
/** 查询列表 */
|
/** 查询列表 */
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,26 @@
|
||||||
<el-form-item label="模板内容" prop="content">
|
<el-form-item label="模板内容" prop="content">
|
||||||
<Editor :model-value="formData.content" height="150px" readonly />
|
<Editor :model-value="formData.content" height="150px" readonly />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="收件邮箱" prop="mail">
|
<el-form-item label="收件邮箱" prop="toMails">
|
||||||
<el-input v-model="formData.mail" placeholder="请输入收件邮箱" />
|
<el-input-tag
|
||||||
|
v-model="formData.toMails"
|
||||||
|
placeholder="请输入收件邮箱,多个邮箱用回车分隔"
|
||||||
|
class="!w-full"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="抄送邮箱" prop="ccMails">
|
||||||
|
<el-input-tag
|
||||||
|
v-model="formData.ccMails"
|
||||||
|
placeholder="请输入抄送邮箱,多个邮箱用回车分隔"
|
||||||
|
class="!w-full"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="密送邮箱" prop="bccMails">
|
||||||
|
<el-input-tag
|
||||||
|
v-model="formData.bccMails"
|
||||||
|
placeholder="请输入密送邮箱,多个邮箱用回车分隔"
|
||||||
|
class="!w-full"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-for="param in formData.params"
|
v-for="param in formData.params"
|
||||||
|
|
@ -43,12 +61,13 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
content: '',
|
content: '',
|
||||||
params: {},
|
params: {},
|
||||||
mail: '',
|
toMails: [],
|
||||||
|
ccMails: [],
|
||||||
|
bccMails: [],
|
||||||
templateCode: '',
|
templateCode: '',
|
||||||
templateParams: new Map()
|
templateParams: new Map()
|
||||||
})
|
})
|
||||||
const formRules = reactive({
|
const formRules = reactive({
|
||||||
mail: [{ required: true, message: '邮箱不能为空', trigger: 'blur' }],
|
|
||||||
templateCode: [{ required: true, message: '模版编号不能为空', trigger: 'blur' }],
|
templateCode: [{ required: true, message: '模版编号不能为空', trigger: 'blur' }],
|
||||||
templateParams: {}
|
templateParams: {}
|
||||||
})
|
})
|
||||||
|
|
@ -105,7 +124,9 @@ const resetForm = () => {
|
||||||
formData.value = {
|
formData.value = {
|
||||||
content: '',
|
content: '',
|
||||||
params: {},
|
params: {},
|
||||||
mail: '',
|
toMails: [],
|
||||||
|
ccMails: [],
|
||||||
|
bccMails: [],
|
||||||
templateCode: '',
|
templateCode: '',
|
||||||
templateParams: new Map()
|
templateParams: new Map()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue