diff --git a/yudao-ui-admin-vue3/src/api/system/mail/template/index.ts b/yudao-ui-admin-vue3/src/api/system/mail/template/index.ts index a0a0faf2f8..c044ddd4e4 100644 --- a/yudao-ui-admin-vue3/src/api/system/mail/template/index.ts +++ b/yudao-ui-admin-vue3/src/api/system/mail/template/index.ts @@ -21,7 +21,7 @@ export interface MailTemplatePageReqVO extends PageParam { createTime?: Date[] } -export interface MailSmsReqVO { +export interface MailSendReqVO { mail: string templateCode: string templateParams: Map @@ -53,6 +53,6 @@ export const deleteMailTemplateApi = async (id: number) => { } // 发送邮件 -export const sendMailApi = (data: MailSmsReqVO) => { +export const sendMailApi = (data: MailSendReqVO) => { return request.post({ url: '/system/mail-template/send-mail', data }) } diff --git a/yudao-ui-admin-vue3/src/api/system/notify/template/index.ts b/yudao-ui-admin-vue3/src/api/system/notify/template/index.ts new file mode 100644 index 0000000000..66530a904a --- /dev/null +++ b/yudao-ui-admin-vue3/src/api/system/notify/template/index.ts @@ -0,0 +1,55 @@ +import request from '@/config/axios' + +export interface NotifyTemplateVO { + id: number + name: string + code: string + content: string + type: number + params: string + status: number + remark: string +} + +export interface NotifyTemplatePageReqVO extends PageParam { + name?: string + code?: string + status?: number + createTime?: Date[] +} + +export interface NotifySendReqVO { + userId: number + templateCode: string + templateParams: Map +} + +// 查询站内信模板列表 +export const getNotifyTemplatePageApi = async (params: NotifyTemplatePageReqVO) => { + return await request.get({ url: '/system/notify-template/page', params }) +} + +// 查询站内信模板详情 +export const getNotifyTemplateApi = async (id: number) => { + return await request.get({ url: '/system/notify-template/get?id=' + id }) +} + +// 新增站内信模板 +export const createNotifyTemplateApi = async (data: NotifyTemplateVO) => { + return await request.post({ url: '/system/notify-template/create', data }) +} + +// 修改站内信模板 +export const updateNotifyTemplateApi = async (data: NotifyTemplateVO) => { + return await request.put({ url: '/system/notify-template/update', data }) +} + +// 删除站内信模板 +export const deleteNotifyTemplateApi = async (id: number) => { + return await request.delete({ url: '/system/notify-template/delete?id=' + id }) +} + +// 发送站内信 +export const sendNotifyApi = (data: NotifySendReqVO) => { + return request.post({ url: '/system/notify-template/send-notify', data }) +} diff --git a/yudao-ui-admin-vue3/src/utils/dict.ts b/yudao-ui-admin-vue3/src/utils/dict.ts index 176ddf92d4..b9dfa1601d 100644 --- a/yudao-ui-admin-vue3/src/utils/dict.ts +++ b/yudao-ui-admin-vue3/src/utils/dict.ts @@ -91,6 +91,7 @@ export enum DICT_TYPE { SYSTEM_ERROR_CODE_TYPE = 'system_error_code_type', SYSTEM_OAUTH2_GRANT_TYPE = 'system_oauth2_grant_type', SYSTEM_MAIL_SEND_STATUS = 'system_mail_send_status', + SYSTEM_NOTIFY_TEMPLATE_TYPE = 'system_notify_template_type', // ========== INFRA 模块 ========== INFRA_BOOLEAN_STRING = 'infra_boolean_string', diff --git a/yudao-ui-admin-vue3/src/views/system/mail/template/index.vue b/yudao-ui-admin-vue3/src/views/system/mail/template/index.vue index e7ddd23962..4532d6cc4e 100644 --- a/yudao-ui-admin-vue3/src/views/system/mail/template/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/mail/template/index.vue @@ -252,7 +252,7 @@ const handleSendMail = (row: any) => { } const sendTest = async () => { - const data: MailTemplateApi.MailSmsReqVO = { + const data: MailTemplateApi.MailSendReqVO = { mail: sendForm.value.mail, templateCode: sendForm.value.templateCode, templateParams: sendForm.value.templateParams as unknown as Map diff --git a/yudao-ui-admin-vue3/src/views/system/notify/template/index.vue b/yudao-ui-admin-vue3/src/views/system/notify/template/index.vue new file mode 100644 index 0000000000..d243518e0d --- /dev/null +++ b/yudao-ui-admin-vue3/src/views/system/notify/template/index.vue @@ -0,0 +1,251 @@ + + diff --git a/yudao-ui-admin-vue3/src/views/system/notify/template/template.data.ts b/yudao-ui-admin-vue3/src/views/system/notify/template/template.data.ts new file mode 100644 index 0000000000..ae8c7b072b --- /dev/null +++ b/yudao-ui-admin-vue3/src/views/system/notify/template/template.data.ts @@ -0,0 +1,85 @@ +import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' + +// 表单校验 +export const rules = reactive({ + name: [required], + code: [required], + content: [required], + type: [required], + status: [required] +}) + +// CrudSchema +const crudSchemas = reactive({ + primaryKey: 'id', + primaryTitle: '编号', + primaryType: null, + action: true, + actionWidth: '260', // 3个按钮默认200,如有删减对应增减即可 + columns: [ + { + title: '模版编码', + field: 'code', + isSearch: true + }, + { + title: '模板名称', + field: 'name', + isSearch: true + }, + { + title: '发件人名称', + field: 'nickname' + }, + { + title: '类型', + field: 'type', + dictType: DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE, + dictClass: 'number' + }, + { + title: '模版内容', + field: 'content', + table: { + width: 300 + }, + form: { + component: 'Input', + componentProps: { + type: 'textarea', + rows: 4 + }, + colProps: { + span: 24 + } + } + }, + { + title: '状态', + field: 'status', + dictType: DICT_TYPE.COMMON_STATUS, + dictClass: 'number', + isSearch: true + }, + { + title: '备注', + field: 'remark' + }, + { + title: '创建时间', + field: 'createTime', + isForm: false, + formatter: 'formatDate', + search: { + show: true, + itemRender: { + name: 'XDataTimePicker' + } + }, + table: { + width: 180 + } + } + ] +}) +export const { allSchemas } = useVxeCrudSchemas(crudSchemas)