邮箱模块:vue3 邮件模版的管理
parent
4cbf7398e8
commit
4996d05d1e
@ -0,0 +1,58 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
export interface MailTemplateVO {
|
||||||
|
id: number
|
||||||
|
name: string
|
||||||
|
code: string
|
||||||
|
accountId: number
|
||||||
|
nickname: string
|
||||||
|
title: string
|
||||||
|
content: string
|
||||||
|
params: string
|
||||||
|
status: number
|
||||||
|
remark: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MailTemplatePageReqVO extends PageParam {
|
||||||
|
name?: string
|
||||||
|
code?: string
|
||||||
|
accountId?: number
|
||||||
|
status?: number
|
||||||
|
createTime?: Date[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MailSmsReqVO {
|
||||||
|
mail: string
|
||||||
|
templateCode: string
|
||||||
|
templateParams: Map<String, Object>
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询邮件模版列表
|
||||||
|
export const getMailTemplatePageApi = async (params: MailTemplatePageReqVO) => {
|
||||||
|
return await request.get({ url: '/system/mail-template/page', params })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询邮件模版详情
|
||||||
|
export const getMailTemplateApi = async (id: number) => {
|
||||||
|
return await request.get({ url: '/system/mail-template/get?id=' + id })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增邮件模版
|
||||||
|
export const createMailTemplateApi = async (data: MailTemplateVO) => {
|
||||||
|
return await request.post({ url: '/system/mail-template/create', data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改邮件模版
|
||||||
|
export const updateMailTemplateApi = async (data: MailTemplateVO) => {
|
||||||
|
return await request.put({ url: '/system/mail-template/update', data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除邮件模版
|
||||||
|
export const deleteMailTemplateApi = async (id: number) => {
|
||||||
|
return await request.delete({ url: '/system/mail-template/delete?id=' + id })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 发送邮件
|
||||||
|
export const sendMailApi = (data: MailSmsReqVO) => {
|
||||||
|
return request.post({ url: '/system/mail-template/send-mail', data })
|
||||||
|
}
|
||||||
@ -0,0 +1,93 @@
|
|||||||
|
import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
|
||||||
|
|
||||||
|
// 表单校验
|
||||||
|
export const rules = reactive({
|
||||||
|
name: [required],
|
||||||
|
code: [required],
|
||||||
|
accountId: [required],
|
||||||
|
title: [required],
|
||||||
|
content: [required],
|
||||||
|
params: [required],
|
||||||
|
status: [required]
|
||||||
|
})
|
||||||
|
|
||||||
|
// CrudSchema
|
||||||
|
const crudSchemas = reactive<VxeCrudSchema>({
|
||||||
|
primaryKey: 'id', // 默认的主键ID
|
||||||
|
primaryTitle: '编号', // 默认显示的值
|
||||||
|
primaryType: null,
|
||||||
|
action: true,
|
||||||
|
actionWidth: '260',
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
title: '模板编码',
|
||||||
|
field: 'code',
|
||||||
|
isSearch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '模板名称',
|
||||||
|
field: 'name',
|
||||||
|
isSearch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '模板标题',
|
||||||
|
field: 'title'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '模板内容',
|
||||||
|
field: 'content',
|
||||||
|
form: {
|
||||||
|
component: 'Editor',
|
||||||
|
colProps: {
|
||||||
|
span: 24
|
||||||
|
},
|
||||||
|
componentProps: {
|
||||||
|
valueHtml: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '邮箱账号',
|
||||||
|
field: 'accountId',
|
||||||
|
isSearch: true,
|
||||||
|
table: {
|
||||||
|
width: 200,
|
||||||
|
slots: {
|
||||||
|
default: 'accountId_default'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '发送人名称',
|
||||||
|
field: 'nickname'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '开启状态',
|
||||||
|
field: 'status',
|
||||||
|
isSearch: true,
|
||||||
|
dictType: DICT_TYPE.COMMON_STATUS,
|
||||||
|
dictClass: 'number'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '备注',
|
||||||
|
field: 'remark',
|
||||||
|
isTable: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
field: 'createTime',
|
||||||
|
isForm: false,
|
||||||
|
formatter: 'formatDate',
|
||||||
|
table: {
|
||||||
|
width: 180
|
||||||
|
},
|
||||||
|
search: {
|
||||||
|
show: true,
|
||||||
|
itemRender: {
|
||||||
|
name: 'XDataTimePicker'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export const { allSchemas } = useVxeCrudSchemas(crudSchemas)
|
||||||
Loading…
Reference in New Issue