diff --git a/apps/web-antd/src/api/system/mail/account/index.ts b/apps/web-antd/src/api/system/mail/account/index.ts index 3c6c6dc26..505670294 100644 --- a/apps/web-antd/src/api/system/mail/account/index.ts +++ b/apps/web-antd/src/api/system/mail/account/index.ts @@ -1,10 +1,10 @@ -import type { PageResult } from '@vben/request'; +import type { PageParam, PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; -// TODO @puhui999:代码风格的统一 export namespace SystemMailAccountApi { - export interface MailAccountVO { + /** 邮箱信息 */ + export interface MailAccount { id: number; mail: string; username: string; @@ -19,16 +19,17 @@ export namespace SystemMailAccountApi { } } -// 查询邮箱账号列表 -export const getMailAccountPage = async (params: any) => { - return await requestClient.get< - PageResult - >('/system/mail-account/page', { params }); +/** 查询邮箱账号列表 */ +export const getMailAccountPage = async (params: PageParam) => { + return await requestClient.get>( + '/system/mail-account/page', + { params }, + ); }; -// 查询邮箱账号详情 +/** 查询邮箱账号详情 */ export const getMailAccount = async (id: number) => { - return await requestClient.get( + return await requestClient.get( '/system/mail-account/get', { params: { id }, @@ -36,41 +37,41 @@ export const getMailAccount = async (id: number) => { ); }; -// 新增邮箱账号 +/** 新增邮箱账号 */ export const createMailAccount = async ( - data: SystemMailAccountApi.MailAccountVO, + data: SystemMailAccountApi.MailAccount, ) => { - return await requestClient.post( + return await requestClient.post( '/system/mail-account/create', data, ); }; -// 修改邮箱账号 +/** 修改邮箱账号 */ export const updateMailAccount = async ( - data: SystemMailAccountApi.MailAccountVO, + data: SystemMailAccountApi.MailAccount, ) => { - return await requestClient.put( + return await requestClient.put( '/system/mail-account/update', data, ); }; -// 删除邮箱账号 +/** 删除邮箱账号 */ export const deleteMailAccount = async (id: number) => { return await requestClient.delete('/system/mail-account/delete', { params: { id }, }); }; -// 获得邮箱账号精简列表 +/** 获得邮箱账号精简列表 */ export const getSimpleMailAccountList = async () => { - return await requestClient.get( + return await requestClient.get( '/system/mail-account/simple-list', ); }; -// 测试邮箱连接 +/** 测试邮箱连接 */ export const testMailAccount = async (id: number) => { return await requestClient.post('/system/mail-account/test', null, { params: { id }, diff --git a/apps/web-antd/src/api/system/mail/log/index.ts b/apps/web-antd/src/api/system/mail/log/index.ts index 97ef3154e..3e71d4edd 100644 --- a/apps/web-antd/src/api/system/mail/log/index.ts +++ b/apps/web-antd/src/api/system/mail/log/index.ts @@ -1,10 +1,10 @@ -import type { PageResult } from '@vben/request'; +import type { PageParam, PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; -// TODO @puhui999:代码风格的统一 export namespace SystemMailLogApi { - export interface MailLogVO { + /** 邮件日志 */ + export interface MailLog { id: number; userId: number; userType: number; @@ -18,24 +18,24 @@ export namespace SystemMailLogApi { templateContent: string; templateParams: string; sendStatus: number; - sendTime: Date; + sendTime: string; sendMessageId: string; sendException: string; - createTime: Date; + createTime: string; } } -// 查询邮件日志列表 -export const getMailLogPage = async (params: any) => { - return await requestClient.get>( +/** 查询邮件日志列表 */ +export const getMailLogPage = async (params: PageParam) => { + return await requestClient.get>( '/system/mail-log/page', { params }, ); }; -// 查询邮件日志详情 +/** 查询邮件日志详情 */ export const getMailLog = async (id: number) => { - return await requestClient.get( + return await requestClient.get( '/system/mail-log/get', { params: { id }, @@ -43,14 +43,14 @@ export const getMailLog = async (id: number) => { ); }; -// 重新发送邮件 +/** 重新发送邮件 */ export const resendMail = async (id: number) => { return await requestClient.put('/system/mail-log/resend', null, { params: { id }, }); }; -// 批量删除邮件日志 +/** 批量删除邮件日志 */ export const deleteMailLogs = async (ids: number[]) => { return await requestClient.delete('/system/mail-log/delete', { data: { ids }, diff --git a/apps/web-antd/src/api/system/mail/template/index.ts b/apps/web-antd/src/api/system/mail/template/index.ts index 2cfd697b7..e87f5c38f 100644 --- a/apps/web-antd/src/api/system/mail/template/index.ts +++ b/apps/web-antd/src/api/system/mail/template/index.ts @@ -1,10 +1,10 @@ -import type { PageResult } from '@vben/request'; +import type { PageParam, PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; -// TODO @puhui999:代码风格的统一 export namespace SystemMailTemplateApi { - export interface MailTemplateVO { + /** 邮件模版信息 */ + export interface MailTemplate { id: number; name: string; code: string; @@ -12,29 +12,30 @@ export namespace SystemMailTemplateApi { nickname: string; title: string; content: string; - params: string; + params: string[]; status: number; remark: string; createTime: Date; } - export interface MailSendReqVO { + /** 邮件发送信息 */ + export interface MailSendReq { mail: string; templateCode: string; templateParams: Record; } } -// 查询邮件模版列表 -export const getMailTemplatePage = async (params: any) => { +/** 查询邮件模版列表 */ +export const getMailTemplatePage = async (params: PageParam) => { return await requestClient.get< - PageResult + PageResult >('/system/mail-template/page', { params }); }; -// 查询邮件模版详情 +/** 查询邮件模版详情 */ export const getMailTemplate = async (id: number) => { - return await requestClient.get( + return await requestClient.get( '/system/mail-template/get', { params: { id }, @@ -42,35 +43,35 @@ export const getMailTemplate = async (id: number) => { ); }; -// 新增邮件模版 +/** 新增邮件模版 */ export const createMailTemplate = async ( - data: SystemMailTemplateApi.MailTemplateVO, + data: SystemMailTemplateApi.MailTemplate, ) => { - return await requestClient.post( + return await requestClient.post( '/system/mail-template/create', data, ); }; -// 修改邮件模版 +/** 修改邮件模版 */ export const updateMailTemplate = async ( - data: SystemMailTemplateApi.MailTemplateVO, + data: SystemMailTemplateApi.MailTemplate, ) => { - return await requestClient.put( + return await requestClient.put( '/system/mail-template/update', data, ); }; -// 删除邮件模版 +/** 删除邮件模版 */ export const deleteMailTemplate = async (id: number) => { return await requestClient.delete('/system/mail-template/delete', { params: { id }, }); }; -// 发送邮件 -export const sendMail = async (data: SystemMailTemplateApi.MailSendReqVO) => { +/** 发送邮件 */ +export const sendMail = async (data: SystemMailTemplateApi.MailSendReq) => { return await requestClient.post( '/system/mail-template/send-mail', data, diff --git a/apps/web-antd/src/api/system/notify/message/index.ts b/apps/web-antd/src/api/system/notify/message/index.ts new file mode 100644 index 000000000..cdacbffd0 --- /dev/null +++ b/apps/web-antd/src/api/system/notify/message/index.ts @@ -0,0 +1,59 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace SystemNotifyMessageApi { + /** 站内信消息信息 */ + export interface NotifyMessage { + id: number; + userId: number; + userType: number; + templateId: number; + templateCode: string; + templateNickname: string; + templateContent: string; + templateType: number; + templateParams: string; + readStatus: boolean; + readTime: string; + createTime: string; + } +} + +/** 查询站内信消息列表 */ +export function getNotifyMessagePage(params: PageParam) { + return requestClient.get>( + '/system/notify-message/page', + { params }, + ); +} + +/** 获得我的站内信分页 */ +export function getMyNotifyMessagePage(params: PageParam) { + return requestClient.get>( + '/system/notify-message/my-page', + { params }, + ); +} + +/** 批量标记已读 */ +export function updateNotifyMessageRead(ids: number[]) { + return requestClient.put('/system/notify-message/update-read', { ids }); +} + +/** 标记所有站内信为已读 */ +export function updateAllNotifyMessageRead() { + return requestClient.put('/system/notify-message/update-all-read'); +} + +/** 获取当前用户的最新站内信列表 */ +export function getUnreadNotifyMessageList() { + return requestClient.get( + '/system/notify-message/get-unread-list', + ); +} + +/** 获得当前用户的未读站内信数量 */ +export function getUnreadNotifyMessageCount() { + return requestClient.get('/system/notify-message/get-unread-count'); +} diff --git a/apps/web-antd/src/api/system/notify/template/index.ts b/apps/web-antd/src/api/system/notify/template/index.ts new file mode 100644 index 000000000..464dec1e3 --- /dev/null +++ b/apps/web-antd/src/api/system/notify/template/index.ts @@ -0,0 +1,71 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace SystemNotifyTemplateApi { + /** 站内信模板信息 */ + export interface NotifyTemplate { + id?: number; + name: string; + nickname: string; + code: string; + content: string; + type?: number; + params: string[]; + status: number; + remark: string; + } + + /** 发送站内信请求 */ + export interface NotifySendReq { + userId: number; + templateCode: string; + templateParams: Record; + } +} + +/** 查询站内信模板列表 */ +export function getNotifyTemplatePage(params: PageParam) { + return requestClient.get>( + '/system/notify-template/page', + { params }, + ); +} + +/** 查询站内信模板详情 */ +export function getNotifyTemplate(id: number) { + return requestClient.get( + `/system/notify-template/get?id=${id}`, + ); +} + +/** 新增站内信模板 */ +export function createNotifyTemplate( + data: SystemNotifyTemplateApi.NotifyTemplate, +) { + return requestClient.post('/system/notify-template/create', data); +} + +/** 修改站内信模板 */ +export function updateNotifyTemplate( + data: SystemNotifyTemplateApi.NotifyTemplate, +) { + return requestClient.put('/system/notify-template/update', data); +} + +/** 删除站内信模板 */ +export function deleteNotifyTemplate(id: number) { + return requestClient.delete(`/system/notify-template/delete?id=${id}`); +} + +/** 导出站内信模板 */ +export function exportNotifyTemplate(params: any) { + return requestClient.download('/system/notify-template/export-excel', { + params, + }); +} + +/** 发送站内信 */ +export function sendNotify(data: SystemNotifyTemplateApi.NotifySendReq) { + return requestClient.post('/system/notify-template/send-notify', data); +} diff --git a/apps/web-antd/src/api/system/sms/channel/index.ts b/apps/web-antd/src/api/system/sms/channel/index.ts index e4ee25749..56890bea5 100644 --- a/apps/web-antd/src/api/system/sms/channel/index.ts +++ b/apps/web-antd/src/api/system/sms/channel/index.ts @@ -27,12 +27,16 @@ export function getSmsChannelPage(params: PageParam) { /** 获得短信渠道精简列表 */ export function getSimpleSmsChannelList() { - return requestClient.get('/system/sms-channel/simple-list'); + return requestClient.get( + '/system/sms-channel/simple-list', + ); } /** 查询短信渠道详情 */ export function getSmsChannel(id: number) { - return requestClient.get(`/system/sms-channel/get?id=${id}`); + return requestClient.get( + `/system/sms-channel/get?id=${id}`, + ); } /** 新增短信渠道 */ diff --git a/apps/web-antd/src/api/system/sms/log/index.ts b/apps/web-antd/src/api/system/sms/log/index.ts index cf0845800..8344f9932 100644 --- a/apps/web-antd/src/api/system/sms/log/index.ts +++ b/apps/web-antd/src/api/system/sms/log/index.ts @@ -4,7 +4,7 @@ import { requestClient } from '#/api/request'; export namespace SystemSmsLogApi { /** 短信日志信息 */ - export interface SmsLogVO { + export interface SmsLog { id?: number; channelId?: number; channelCode: string; @@ -18,22 +18,25 @@ export namespace SystemSmsLogApi { userId?: number; userType?: number; sendStatus?: number; - sendTime?: Date; + sendTime?: string; apiSendCode: string; apiSendMsg: string; apiRequestId: string; apiSerialNo: string; receiveStatus?: number; - receiveTime?: Date; + receiveTime?: string; apiReceiveCode: string; apiReceiveMsg: string; - createTime?: Date; + createTime: string; } } /** 查询短信日志列表 */ export function getSmsLogPage(params: PageParam) { - return requestClient.get>('/system/sms-log/page', { params }); + return requestClient.get>( + '/system/sms-log/page', + { params }, + ); } /** 导出短信日志 */ diff --git a/apps/web-antd/src/api/system/sms/template/index.ts b/apps/web-antd/src/api/system/sms/template/index.ts index 808d98e32..0ea7425a1 100644 --- a/apps/web-antd/src/api/system/sms/template/index.ts +++ b/apps/web-antd/src/api/system/sms/template/index.ts @@ -1,4 +1,4 @@ -import type { PageResult } from '@vben/request'; +import type { PageParam, PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; @@ -20,7 +20,7 @@ export namespace SystemSmsTemplateApi { } /** 发送短信请求 */ - export interface SmsSendReqVO { + export interface SmsSendReq { mobile: string; templateCode: string; templateParams: Record; @@ -28,7 +28,7 @@ export namespace SystemSmsTemplateApi { } /** 查询短信模板列表 */ -export function getSmsTemplatePage(params: any) { +export function getSmsTemplatePage(params: PageParam) { return requestClient.get>( '/system/sms-template/page', { params }, @@ -37,7 +37,9 @@ export function getSmsTemplatePage(params: any) { /** 查询短信模板详情 */ export function getSmsTemplate(id: number) { - return requestClient.get(`/system/sms-template/get?id=${id}`); + return requestClient.get( + `/system/sms-template/get?id=${id}`, + ); } /** 新增短信模板 */ @@ -57,10 +59,12 @@ export function deleteSmsTemplate(id: number) { /** 导出短信模板 */ export function exportSmsTemplate(params: any) { - return requestClient.download('/system/sms-template/export-excel', { params }); + return requestClient.download('/system/sms-template/export-excel', { + params, + }); } /** 发送短信 */ -export function sendSms(data: SystemSmsTemplateApi.SmsSendReqVO) { +export function sendSms(data: SystemSmsTemplateApi.SmsSendReq) { return requestClient.post('/system/sms-template/send-sms', data); } diff --git a/apps/web-antd/src/views/system/mail/account/data.ts b/apps/web-antd/src/views/system/mail/account/data.ts new file mode 100644 index 000000000..46d28ed7a --- /dev/null +++ b/apps/web-antd/src/views/system/mail/account/data.ts @@ -0,0 +1,191 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { OnActionClickFn, VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { SystemMailAccountApi } from '#/api/system/mail/account'; + +import { z } from '#/adapter/form'; +import { DICT_TYPE, getDictOptions } from '#/utils/dict'; + +/** 新增/修改的表单 */ +export function useFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'id', + label: 'id', + component: 'Input', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + fieldName: 'mail', + label: '邮箱', + component: 'Input', + rules: 'required', + }, + { + fieldName: 'username', + label: '用户名', + component: 'Input', + rules: 'required', + }, + { + fieldName: 'password', + label: '密码', + component: 'InputPassword', + rules: 'required', + }, + { + fieldName: 'host', + label: 'SMTP 服务器域名', + component: 'Input', + rules: 'required', + }, + { + fieldName: 'port', + label: 'SMTP 服务器端口', + component: 'InputNumber', + componentProps: { + min: 0, + max: 65_535, + }, + rules: 'required', + }, + { + fieldName: 'sslEnable', + label: '是否开启 SSL', + component: 'RadioGroup', + componentProps: { + options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING, 'boolean'), + buttonStyle: 'solid', + optionType: 'button', + }, + rules: z.boolean().default(true), + }, + { + fieldName: 'starttlsEnable', + label: '是否开启 STARTTLS', + component: 'RadioGroup', + componentProps: { + options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING, 'boolean'), + buttonStyle: 'solid', + optionType: 'button', + }, + rules: z.boolean().default(false), + }, + { + fieldName: 'remark', + label: '备注', + component: 'Textarea', + }, + ]; +} + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'mail', + label: '邮箱', + component: 'Input', + }, + { + fieldName: 'username', + label: '用户名', + component: 'Input', + }, + { + fieldName: 'createTime', + label: '创建时间', + component: 'RangePicker', + componentProps: { + allowClear: true, + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns( + onActionClick: OnActionClickFn, +): VxeTableGridOptions['columns'] { + return [ + { + field: 'id', + title: '编号', + minWidth: 100, + }, + { + field: 'mail', + title: '邮箱', + minWidth: 120, + }, + { + field: 'username', + title: '用户名', + minWidth: 120, + }, + { + field: 'host', + title: 'SMTP 服务器域名', + minWidth: 150, + }, + { + field: 'port', + title: 'SMTP 服务器端口', + minWidth: 120, + }, + { + field: 'sslEnable', + title: '是否开启 SSL', + minWidth: 120, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.INFRA_BOOLEAN_STRING }, + }, + }, + { + field: 'starttlsEnable', + title: '是否开启 STARTTLS', + minWidth: 120, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.INFRA_BOOLEAN_STRING }, + }, + }, + { + field: 'remark', + title: '备注', + minWidth: 120, + }, + { + field: 'createTime', + title: '创建时间', + minWidth: 180, + formatter: 'formatDateTime', + }, + { + field: 'operation', + title: '操作', + minWidth: 220, + align: 'center', + fixed: 'right', + cellRender: { + attrs: { + nameField: 'mail', + nameTitle: '邮箱账号', + onClick: onActionClick, + }, + name: 'CellOperation', + options: [ + 'edit', // 默认的编辑按钮 + 'delete', // 默认的删除按钮 + { + code: 'test', + text: '测试连接', + }, + ], + }, + }, + ]; +} diff --git a/apps/web-antd/src/views/system/mail/account/index.vue b/apps/web-antd/src/views/system/mail/account/index.vue new file mode 100644 index 000000000..d44b313bd --- /dev/null +++ b/apps/web-antd/src/views/system/mail/account/index.vue @@ -0,0 +1,143 @@ + + diff --git a/apps/web-antd/src/views/system/mail/account/modules/form.vue b/apps/web-antd/src/views/system/mail/account/modules/form.vue new file mode 100644 index 000000000..03cf86df8 --- /dev/null +++ b/apps/web-antd/src/views/system/mail/account/modules/form.vue @@ -0,0 +1,84 @@ + + + diff --git a/apps/web-antd/src/views/system/mail/log/data.ts b/apps/web-antd/src/views/system/mail/log/data.ts new file mode 100644 index 000000000..8dc1a781d --- /dev/null +++ b/apps/web-antd/src/views/system/mail/log/data.ts @@ -0,0 +1,167 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { OnActionClickFn, VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { SystemMailLogApi } from '#/api/system/mail/log'; + +import { getSimpleMailAccountList } from '#/api/system/mail/account'; +import { DICT_TYPE, getDictOptions } from '#/utils/dict'; + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'toMail', + label: '收件邮箱', + component: 'Input', + }, + { + fieldName: 'accountId', + label: '邮箱账号', + component: 'ApiSelect', + componentProps: { + api: async () => await getSimpleMailAccountList(), + labelField: 'mail', + valueField: 'id', + allowClear: true, + }, + }, + { + fieldName: 'templateId', + label: '模板编号', + component: 'Input', + }, + { + fieldName: 'sendStatus', + label: '发送状态', + component: 'Select', + componentProps: { + allowClear: true, + options: getDictOptions(DICT_TYPE.SYSTEM_MAIL_SEND_STATUS, 'number'), + }, + }, + { + fieldName: 'sendTime', + label: '发送时间', + component: 'RangePicker', + componentProps: { + allowClear: true, + }, + }, + { + fieldName: 'userId', + label: '用户编号', + component: 'Input', + }, + { + fieldName: 'userType', + label: '用户类型', + component: 'Select', + componentProps: { + allowClear: true, + options: getDictOptions(DICT_TYPE.USER_TYPE, 'number'), + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns( + onActionClick: OnActionClickFn, +): VxeTableGridOptions['columns'] { + return [ + { + field: 'id', + title: '编号', + minWidth: 100, + }, + { + field: 'createTime', + title: '创建时间', + minWidth: 180, + formatter: 'formatDateTime', + }, + { + field: 'toMail', + title: '收件邮箱', + minWidth: 120, + }, + { + field: 'fromMail', + title: '发送邮箱', + minWidth: 120, + }, + { + field: 'templateTitle', + title: '邮件标题', + minWidth: 120, + }, + { + field: 'templateContent', + title: '邮件内容', + minWidth: 300, + }, + { + field: 'sendStatus', + title: '发送状态', + minWidth: 120, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.SYSTEM_MAIL_SEND_STATUS }, + }, + }, + { + field: 'sendTime', + title: '发送时间', + minWidth: 180, + formatter: 'formatDateTime', + }, + { + field: 'templateId', + title: '模板编号', + minWidth: 100, + }, + { + field: 'templateCode', + title: '模板编码', + minWidth: 120, + }, + { + field: 'userId', + title: '用户编号', + minWidth: 100, + }, + { + field: 'userType', + title: '用户类型', + minWidth: 100, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.USER_TYPE }, + }, + }, + { + field: 'operation', + title: '操作', + minWidth: 120, + align: 'center', + fixed: 'right', + cellRender: { + attrs: { + nameField: 'toMail', + nameTitle: '邮件日志', + onClick: onActionClick, + }, + name: 'CellOperation', + options: [ + { + code: 'view', + text: '查看', + }, + { + code: 'resend', + text: '重发', + }, + ], + }, + }, + ]; +} diff --git a/apps/web-antd/src/views/system/mail/log/index.vue b/apps/web-antd/src/views/system/mail/log/index.vue new file mode 100644 index 000000000..c26dc1d6e --- /dev/null +++ b/apps/web-antd/src/views/system/mail/log/index.vue @@ -0,0 +1,105 @@ + + diff --git a/apps/web-antd/src/views/system/mail/log/modules/form.vue b/apps/web-antd/src/views/system/mail/log/modules/form.vue new file mode 100644 index 000000000..d118ce24b --- /dev/null +++ b/apps/web-antd/src/views/system/mail/log/modules/form.vue @@ -0,0 +1,91 @@ + + + diff --git a/apps/web-antd/src/views/system/mail/template/data.ts b/apps/web-antd/src/views/system/mail/template/data.ts new file mode 100644 index 000000000..14dbbae38 --- /dev/null +++ b/apps/web-antd/src/views/system/mail/template/data.ts @@ -0,0 +1,237 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { OnActionClickFn, VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { SystemMailTemplateApi } from '#/api/system/mail/template'; + +import { z } from '#/adapter/form'; +import { getSimpleMailAccountList } from '#/api/system/mail/account'; +import { CommonStatusEnum } from '#/utils/constants'; +import { DICT_TYPE, getDictOptions } from '#/utils/dict'; + +/** 新增/修改的表单 */ +export function useFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'id', + label: 'id', + component: 'Input', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + fieldName: 'name', + label: '模板名称', + component: 'Input', + rules: 'required', + }, + { + fieldName: 'code', + label: '模板编码', + component: 'Input', + rules: 'required', + }, + { + fieldName: 'accountId', + label: '邮箱账号', + component: 'ApiSelect', + componentProps: { + api: async () => await getSimpleMailAccountList(), + class: 'w-full', + labelField: 'mail', + valueField: 'id', + }, + rules: 'required', + }, + { + fieldName: 'nickname', + label: '发送人名称', + component: 'Input', + }, + { + fieldName: 'title', + label: '模板标题', + component: 'Input', + rules: 'required', + }, + { + fieldName: 'content', + label: '模板内容', + component: 'Textarea', + componentProps: { + height: 300, + }, + rules: 'required', + }, + { + fieldName: 'status', + label: '开启状态', + component: 'RadioGroup', + componentProps: { + options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), + buttonStyle: 'solid', + optionType: 'button', + }, + rules: z.number().default(CommonStatusEnum.ENABLE), + }, + { + fieldName: 'remark', + label: '备注', + component: 'Textarea', + }, + ]; +} + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'status', + label: '开启状态', + component: 'Select', + componentProps: { + allowClear: true, + options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), + }, + }, + { + fieldName: 'code', + label: '模板编码', + component: 'Input', + }, + { + fieldName: 'name', + label: '模板名称', + component: 'Input', + }, + { + fieldName: 'accountId', + label: '邮箱账号', + component: 'ApiSelect', + componentProps: { + api: async () => await getSimpleMailAccountList(), + labelField: 'mail', + valueField: 'id', + allowClear: true, + }, + }, + { + fieldName: 'createTime', + label: '创建时间', + component: 'RangePicker', + componentProps: { + allowClear: true, + }, + }, + ]; +} + +/** 发送邮件表单 */ +export function useSendMailFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'content', + label: '模板内容', + component: 'Textarea', + componentProps: { + disabled: true, + }, + }, + { + fieldName: 'mail', + label: '收件邮箱', + component: 'Input', + rules: 'required', + }, + { + fieldName: 'templateParams', + label: '模板参数', + component: 'Input', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns( + onActionClick: OnActionClickFn, +): VxeTableGridOptions['columns'] { + return [ + { + field: 'id', + title: '编号', + minWidth: 100, + }, + { + field: 'name', + title: '模板名称', + minWidth: 120, + }, + { + field: 'code', + title: '模板编码', + minWidth: 120, + }, + { + field: 'title', + title: '模板标题', + minWidth: 120, + }, + { + field: 'accountId', + title: '邮箱账号', + minWidth: 120, + }, + { + field: 'nickname', + title: '发送人名称', + minWidth: 120, + }, + { + field: 'status', + title: '开启状态', + minWidth: 100, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.COMMON_STATUS }, + }, + }, + { + field: 'remark', + title: '备注', + minWidth: 120, + }, + { + field: 'createTime', + title: '创建时间', + minWidth: 180, + formatter: 'formatDateTime', + }, + { + field: 'operation', + title: '操作', + minWidth: 300, + align: 'center', + fixed: 'right', + cellRender: { + attrs: { + nameField: 'name', + nameTitle: '邮件模板', + onClick: onActionClick, + }, + name: 'CellOperation', + options: [ + 'edit', // 默认的编辑按钮 + 'delete', // 默认的删除按钮 + { + code: 'mail-send', + text: '发送邮件', + }, + ], + }, + }, + ]; +} diff --git a/apps/web-antd/src/views/system/mail/template/index.vue b/apps/web-antd/src/views/system/mail/template/index.vue new file mode 100644 index 000000000..6aee39503 --- /dev/null +++ b/apps/web-antd/src/views/system/mail/template/index.vue @@ -0,0 +1,136 @@ + + diff --git a/apps/web-antd/src/views/system/mail/template/modules/form.vue b/apps/web-antd/src/views/system/mail/template/modules/form.vue new file mode 100644 index 000000000..5c360bdee --- /dev/null +++ b/apps/web-antd/src/views/system/mail/template/modules/form.vue @@ -0,0 +1,82 @@ + + + diff --git a/apps/web-antd/src/views/system/mail/template/modules/send-form.vue b/apps/web-antd/src/views/system/mail/template/modules/send-form.vue new file mode 100644 index 000000000..c79520f7a --- /dev/null +++ b/apps/web-antd/src/views/system/mail/template/modules/send-form.vue @@ -0,0 +1,114 @@ + + + diff --git a/apps/web-antd/src/views/system/notify/message/data.ts b/apps/web-antd/src/views/system/notify/message/data.ts new file mode 100644 index 000000000..f299c870e --- /dev/null +++ b/apps/web-antd/src/views/system/notify/message/data.ts @@ -0,0 +1,158 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { OnActionClickFn, VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { SystemNotifyMessageApi } from '#/api/system/notify/message'; + +import { DICT_TYPE, getDictOptions } from '#/utils/dict'; + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'userId', + label: '用户编号', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入用户编号', + }, + }, + { + fieldName: 'userType', + label: '用户类型', + component: 'Select', + componentProps: { + allowClear: true, + options: getDictOptions(DICT_TYPE.USER_TYPE, 'number'), + placeholder: '请选择用户类型', + }, + }, + { + fieldName: 'templateCode', + label: '模板编码', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入模板编码', + }, + }, + { + fieldName: 'templateType', + label: '模版类型', + component: 'Select', + componentProps: { + allowClear: true, + options: getDictOptions( + DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE, + 'number', + ), + placeholder: '请选择模版类型', + }, + }, + { + fieldName: 'createTime', + label: '创建时间', + component: 'RangePicker', + componentProps: { + allowClear: true, + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns( + onActionClick: OnActionClickFn, +): VxeTableGridOptions['columns'] { + return [ + { + field: 'id', + title: '编号', + minWidth: 100, + }, + { + field: 'userType', + title: '用户类型', + minWidth: 120, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.USER_TYPE }, + }, + }, + { + field: 'userId', + title: '用户编号', + minWidth: 100, + }, + { + field: 'templateCode', + title: '模板编码', + minWidth: 120, + }, + { + field: 'templateNickname', + title: '发送人名称', + minWidth: 180, + }, + { + field: 'templateContent', + title: '模版内容', + minWidth: 200, + }, + { + field: 'templateParams', + title: '模版参数', + minWidth: 180, + }, + { + field: 'templateType', + title: '模版类型', + minWidth: 120, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE }, + }, + }, + { + field: 'readStatus', + title: '是否已读', + minWidth: 100, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.INFRA_BOOLEAN_STRING }, + }, + }, + { + field: 'readTime', + title: '阅读时间', + minWidth: 180, + formatter: 'formatDateTime', + }, + { + field: 'createTime', + title: '创建时间', + minWidth: 180, + formatter: 'formatDateTime', + }, + { + field: 'operation', + title: '操作', + minWidth: 180, + align: 'center', + fixed: 'right', + cellRender: { + attrs: { + nameField: 'id', + nameTitle: '站内信', + onClick: onActionClick, + }, + name: 'CellOperation', + options: [ + { + code: 'view', + text: '查看', + }, + ], + }, + }, + ]; +} diff --git a/apps/web-antd/src/views/system/notify/message/index.vue b/apps/web-antd/src/views/system/notify/message/index.vue new file mode 100644 index 000000000..325ebc109 --- /dev/null +++ b/apps/web-antd/src/views/system/notify/message/index.vue @@ -0,0 +1,78 @@ + + diff --git a/apps/web-antd/src/views/system/notify/message/modules/detail.vue b/apps/web-antd/src/views/system/notify/message/modules/detail.vue new file mode 100644 index 000000000..4dcccc2c4 --- /dev/null +++ b/apps/web-antd/src/views/system/notify/message/modules/detail.vue @@ -0,0 +1,91 @@ + + + diff --git a/apps/web-antd/src/views/system/notify/my/data.ts b/apps/web-antd/src/views/system/notify/my/data.ts new file mode 100644 index 000000000..8642b0020 --- /dev/null +++ b/apps/web-antd/src/views/system/notify/my/data.ts @@ -0,0 +1,98 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { OnActionClickFn, VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { SystemNotifyMessageApi } from '#/api/system/notify/message'; + +import { DICT_TYPE, getDictOptions } from '#/utils/dict'; + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'readStatus', + label: '是否已读', + component: 'Select', + componentProps: { + allowClear: true, + options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING, 'boolean'), + placeholder: '请选择是否已读', + }, + }, + { + fieldName: 'createTime', + label: '发送时间', + component: 'RangePicker', + componentProps: { + allowClear: true, + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns( + onActionClick: OnActionClickFn, +): VxeTableGridOptions['columns'] { + return [ + { + field: 'templateNickname', + title: '发送人', + minWidth: 180, + }, + { + field: 'createTime', + title: '发送时间', + minWidth: 180, + formatter: 'formatDateTime', + }, + { + field: 'templateType', + title: '类型', + minWidth: 120, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE }, + }, + }, + { + field: 'templateContent', + title: '消息内容', + minWidth: 300, + }, + { + field: 'readStatus', + title: '是否已读', + minWidth: 100, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.INFRA_BOOLEAN_STRING }, + }, + }, + { + field: 'readTime', + title: '阅读时间', + minWidth: 180, + formatter: 'formatDateTime', + }, + { + field: 'operation', + title: '操作', + minWidth: 180, + align: 'center', + fixed: 'right', + cellRender: { + attrs: { + nameField: 'id', + nameTitle: '站内信', + onClick: onActionClick, + }, + name: 'CellOperation', + options: [ + { + code: 'view', + text: '查看', + }, + ], + }, + }, + ]; +} diff --git a/apps/web-antd/src/views/system/notify/my/index.vue b/apps/web-antd/src/views/system/notify/my/index.vue new file mode 100644 index 000000000..23a46979d --- /dev/null +++ b/apps/web-antd/src/views/system/notify/my/index.vue @@ -0,0 +1,163 @@ + + diff --git a/apps/web-antd/src/views/system/notify/my/modules/detail.vue b/apps/web-antd/src/views/system/notify/my/modules/detail.vue new file mode 100644 index 000000000..3df62f63b --- /dev/null +++ b/apps/web-antd/src/views/system/notify/my/modules/detail.vue @@ -0,0 +1,91 @@ + + + diff --git a/apps/web-antd/src/views/system/notify/template/data.ts b/apps/web-antd/src/views/system/notify/template/data.ts new file mode 100644 index 000000000..f2567de33 --- /dev/null +++ b/apps/web-antd/src/views/system/notify/template/data.ts @@ -0,0 +1,268 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { OnActionClickFn, VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { SystemNotifyTemplateApi } from '#/api/system/notify/template'; + +import { z } from '#/adapter/form'; +import { CommonStatusEnum } from '#/utils/constants'; +import { DICT_TYPE, getDictOptions } from '#/utils/dict'; + +/** 新增/修改的表单 */ +export function useFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'id', + component: 'Input', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + fieldName: 'name', + label: '模板名称', + component: 'Input', + componentProps: { + placeholder: '请输入模板名称', + }, + rules: 'required', + }, + { + fieldName: 'code', + label: '模板编码', + component: 'Input', + componentProps: { + placeholder: '请输入模板编码', + }, + rules: 'required', + }, + { + fieldName: 'nickname', + label: '发送人名称', + component: 'Input', + componentProps: { + placeholder: '请输入发送人名称', + }, + rules: 'required', + }, + { + fieldName: 'content', + label: '模板内容', + component: 'Textarea', + componentProps: { + placeholder: '请输入模板内容', + }, + rules: 'required', + }, + { + fieldName: 'type', + label: '模板类型', + component: 'Select', + componentProps: { + options: getDictOptions( + DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE, + 'number', + ), + class: 'w-full', + placeholder: '请选择模板类型', + }, + rules: 'required', + }, + { + fieldName: 'status', + label: '状态', + component: 'RadioGroup', + componentProps: { + options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), + buttonStyle: 'solid', + optionType: 'button', + }, + rules: z.number().default(CommonStatusEnum.ENABLE), + }, + { + fieldName: 'remark', + label: '备注', + component: 'Textarea', + componentProps: { + placeholder: '请输入备注', + }, + }, + ]; +} + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'name', + label: '模板名称', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入模板名称', + }, + }, + { + fieldName: 'code', + label: '模板编码', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入模板编码', + }, + }, + { + fieldName: 'status', + label: '状态', + component: 'Select', + componentProps: { + options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), + allowClear: true, + placeholder: '请选择状态', + }, + }, + { + fieldName: 'type', + label: '模板类型', + component: 'Select', + componentProps: { + options: getDictOptions( + DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE, + 'number', + ), + allowClear: true, + placeholder: '请选择模板类型', + }, + }, + { + fieldName: 'createTime', + label: '创建时间', + component: 'RangePicker', + componentProps: { + allowClear: true, + }, + }, + ]; +} + +/** 发送站内信表单 */ +export function useSendNotifyFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'content', + label: '模板内容', + component: 'Textarea', + componentProps: { + disabled: true, + }, + }, + { + fieldName: 'userId', + label: '用户编号', + component: 'Input', + componentProps: { + placeholder: '请输入用户编号', + }, + rules: 'required', + }, + { + fieldName: 'templateCode', + label: '模板编码', + component: 'Input', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + fieldName: 'templateParams', + label: '模板参数', + component: 'Input', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns( + onActionClick: OnActionClickFn, +): VxeTableGridOptions['columns'] { + return [ + { + field: 'id', + title: '编号', + minWidth: 100, + }, + { + field: 'name', + title: '模板名称', + minWidth: 120, + }, + { + field: 'code', + title: '模板编码', + minWidth: 120, + }, + { + field: 'nickname', + title: '发送人名称', + minWidth: 120, + }, + { + field: 'content', + title: '模板内容', + minWidth: 200, + }, + { + field: 'type', + title: '模板类型', + minWidth: 120, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE }, + }, + }, + { + field: 'status', + title: '状态', + minWidth: 100, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.COMMON_STATUS }, + }, + }, + { + field: 'remark', + title: '备注', + minWidth: 120, + }, + { + field: 'createTime', + title: '创建时间', + minWidth: 180, + formatter: 'formatDateTime', + }, + { + field: 'operation', + title: '操作', + minWidth: 180, + align: 'center', + fixed: 'right', + cellRender: { + attrs: { + nameField: 'name', + nameTitle: '站内信模板', + onClick: onActionClick, + }, + name: 'CellOperation', + options: [ + { code: 'edit', text: '编辑' }, + { code: 'notify-send', text: '测试' }, + { code: 'delete', text: '删除' }, + ], + }, + }, + ]; +} diff --git a/apps/web-antd/src/views/system/notify/template/index.vue b/apps/web-antd/src/views/system/notify/template/index.vue new file mode 100644 index 000000000..d0a4930c5 --- /dev/null +++ b/apps/web-antd/src/views/system/notify/template/index.vue @@ -0,0 +1,147 @@ + + diff --git a/apps/web-antd/src/views/system/notify/template/modules/form.vue b/apps/web-antd/src/views/system/notify/template/modules/form.vue new file mode 100644 index 000000000..7d1ba79ab --- /dev/null +++ b/apps/web-antd/src/views/system/notify/template/modules/form.vue @@ -0,0 +1,85 @@ + + + diff --git a/apps/web-antd/src/views/system/notify/template/modules/send-form.vue b/apps/web-antd/src/views/system/notify/template/modules/send-form.vue new file mode 100644 index 000000000..e79da1bde --- /dev/null +++ b/apps/web-antd/src/views/system/notify/template/modules/send-form.vue @@ -0,0 +1,116 @@ + + + diff --git a/apps/web-antd/src/views/system/sms/log/data.ts b/apps/web-antd/src/views/system/sms/log/data.ts index 76a24000c..019b04dee 100644 --- a/apps/web-antd/src/views/system/sms/log/data.ts +++ b/apps/web-antd/src/views/system/sms/log/data.ts @@ -15,7 +15,7 @@ export function useGridFormSchema(): VbenFormSchema[] { componentProps: { allowClear: true, placeholder: '请输入手机号', - } + }, }, { fieldName: 'channelId', @@ -36,7 +36,7 @@ export function useGridFormSchema(): VbenFormSchema[] { componentProps: { allowClear: true, placeholder: '请输入模板编号', - } + }, }, { fieldName: 'sendStatus', @@ -80,7 +80,7 @@ export function useGridFormSchema(): VbenFormSchema[] { } /** 列表的字段 */ -export function useGridColumns( +export function useGridColumns( onActionClick: OnActionClickFn, ): VxeTableGridOptions['columns'] { return [ diff --git a/apps/web-antd/src/views/system/sms/log/index.vue b/apps/web-antd/src/views/system/sms/log/index.vue index 247539578..2a4f58c22 100644 --- a/apps/web-antd/src/views/system/sms/log/index.vue +++ b/apps/web-antd/src/views/system/sms/log/index.vue @@ -1,18 +1,22 @@ diff --git a/apps/web-antd/src/views/system/sms/log/modules/form.vue b/apps/web-antd/src/views/system/sms/log/modules/form.vue index 61ec2abd2..3fdae816d 100644 --- a/apps/web-antd/src/views/system/sms/log/modules/form.vue +++ b/apps/web-antd/src/views/system/sms/log/modules/form.vue @@ -1,11 +1,16 @@ - - - diff --git a/apps/web-antd/src/views/system/sms/template/data.ts b/apps/web-antd/src/views/system/sms/template/data.ts index 4725db770..4bf751a5f 100644 --- a/apps/web-antd/src/views/system/sms/template/data.ts +++ b/apps/web-antd/src/views/system/sms/template/data.ts @@ -95,7 +95,7 @@ export function useFormSchema(): VbenFormSchema[] { component: 'Textarea', componentProps: { placeholder: '请输入备注', - } + }, }, ]; } @@ -130,7 +130,7 @@ export function useGridFormSchema(): VbenFormSchema[] { componentProps: { allowClear: true, placeholder: '请输入模板编码', - } + }, }, { fieldName: 'name', @@ -139,7 +139,7 @@ export function useGridFormSchema(): VbenFormSchema[] { componentProps: { allowClear: true, placeholder: '请输入模板名称', - } + }, }, { fieldName: 'channelId', @@ -168,6 +168,14 @@ export function useGridFormSchema(): VbenFormSchema[] { /** 发送短信表单 */ export function useSendSmsFormSchema(): VbenFormSchema[] { return [ + { + fieldName: 'content', + label: '模板内容', + component: 'Textarea', + componentProps: { + disabled: true, + }, + }, { fieldName: 'mobile', label: '手机号码', diff --git a/apps/web-antd/src/views/system/sms/template/modules/send-form.vue b/apps/web-antd/src/views/system/sms/template/modules/send-form.vue index 0f67bb6a9..d31d1edee 100644 --- a/apps/web-antd/src/views/system/sms/template/modules/send-form.vue +++ b/apps/web-antd/src/views/system/sms/template/modules/send-form.vue @@ -1,10 +1,12 @@ diff --git a/packages/icons/src/iconify/index.ts b/packages/icons/src/iconify/index.ts index a0985ac15..ae9230f9e 100644 --- a/packages/icons/src/iconify/index.ts +++ b/packages/icons/src/iconify/index.ts @@ -11,3 +11,7 @@ export const MdiGithub = createIconifyIcon('mdi:github'); export const MdiGoogle = createIconifyIcon('mdi:google'); export const MdiQqchat = createIconifyIcon('mdi:qqchat'); + +export const MdiCheckboxMarkedCircleOutline = createIconifyIcon( + 'mdi:checkbox-marked-circle-outline', +);