From 4cbf7398e850deb88e8aa40cf90c8e5c3906ad9f Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 27 Jan 2023 15:11:11 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=AE=E7=AE=B1=E6=A8=A1=E5=9D=97=EF=BC=9Avu?= =?UTF-8?q?e3=20=E9=82=AE=E7=AE=B1=E8=B4=A6=E5=8F=B7=E7=9A=84=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + .../src/api/system/mail/account/index.ts | 41 +++++ .../mail/account/account.template.data.ts | 65 ++++++++ .../src/views/system/mail/account/index.vue | 151 ++++++++++++++++++ .../src/views/system/mail/account/index.vue | 2 +- 5 files changed, 259 insertions(+), 1 deletion(-) create mode 100644 yudao-ui-admin-vue3/src/api/system/mail/account/index.ts create mode 100644 yudao-ui-admin-vue3/src/views/system/mail/account/account.template.data.ts create mode 100644 yudao-ui-admin-vue3/src/views/system/mail/account/index.vue diff --git a/README.md b/README.md index c2b9997df..1e30309e8 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,7 @@ | 🚀 | 租户套餐 | 配置租户套餐,自定每个租户的菜单、操作、按钮的权限 | | | 字典管理 | 对系统中经常使用的一些较为固定的数据进行维护 | | 🚀 | 短信管理 | 短信渠道、短息模板、短信日志,对接阿里云、腾讯云等主流短信平台 | +| 🚀 | 邮件管理 | 邮箱账号、邮件模版、邮件发送日志,支持所有邮件平台 | | 🚀 | 操作日志 | 系统正常操作日志记录和查询,集成 Swagger 生成日志内容 | | ⭐️ | 登录日志 | 系统登录日志记录查询,包含登录异常 | | 🚀 | 错误码管理 | 系统所有错误码的管理,可在线修改错误提示,无需重启服务 | diff --git a/yudao-ui-admin-vue3/src/api/system/mail/account/index.ts b/yudao-ui-admin-vue3/src/api/system/mail/account/index.ts new file mode 100644 index 000000000..37bdc8147 --- /dev/null +++ b/yudao-ui-admin-vue3/src/api/system/mail/account/index.ts @@ -0,0 +1,41 @@ +import request from '@/config/axios' + +export interface MailAccountVO { + id: number + mail: string + username: string + password: string + host: string + port: number + sslEnable: boolean +} + +export interface MailAccountPageReqVO extends PageParam { + mail?: string + username?: string +} + +// 查询邮箱账号列表 +export const getMailAccountPageApi = async (params: MailAccountPageReqVO) => { + return await request.get({ url: '/system/mail-account/page', params }) +} + +// 查询邮箱账号详情 +export const getMailAccountApi = async (id: number) => { + return await request.get({ url: '/system/mail-account/get?id=' + id }) +} + +// 新增邮箱账号 +export const createMailAccountApi = async (data: MailAccountVO) => { + return await request.post({ url: '/system/mail-account/create', data }) +} + +// 修改邮箱账号 +export const updateMailAccountApi = async (data: MailAccountVO) => { + return await request.put({ url: '/system/mail-account/update', data }) +} + +// 删除邮箱账号 +export const deleteMailAccountApi = async (id: number) => { + return await request.delete({ url: '/system/mail-account/delete?id=' + id }) +} diff --git a/yudao-ui-admin-vue3/src/views/system/mail/account/account.template.data.ts b/yudao-ui-admin-vue3/src/views/system/mail/account/account.template.data.ts new file mode 100644 index 000000000..a2e29f852 --- /dev/null +++ b/yudao-ui-admin-vue3/src/views/system/mail/account/account.template.data.ts @@ -0,0 +1,65 @@ +import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' + +// 表单校验 +export const rules = reactive({ + mail: [required], + username: [required], + password: [required], + host: [required], + port: [required], + sslEnable: [required] +}) + +// CrudSchema +const crudSchemas = reactive({ + primaryKey: 'id', // 默认的主键 ID + primaryTitle: '编号', + primaryType: 'id', + action: true, + actionWidth: '200', // 3 个按钮默认 200,如有删减对应增减即可 + columns: [ + { + title: '邮箱', + field: 'mail', + isSearch: true + }, + { + title: '用户名', + field: 'username', + isSearch: true + }, + { + title: '密码', + field: 'password', + isTable: false + }, + { + title: 'SMTP 服务器域名', + field: 'host' + }, + { + title: 'SMTP 服务器端口', + field: 'port', + form: { + component: 'InputNumber', + value: 465 + } + }, + { + title: '是否开启 SSL', + field: 'sslEnable', + dictType: DICT_TYPE.INFRA_BOOLEAN_STRING, + dictClass: 'boolean' + }, + { + title: '创建时间', + field: 'createTime', + isForm: false, + formatter: 'formatDate', + table: { + width: 180 + } + } + ] +}) +export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/yudao-ui-admin-vue3/src/views/system/mail/account/index.vue b/yudao-ui-admin-vue3/src/views/system/mail/account/index.vue new file mode 100644 index 000000000..b8fdf0931 --- /dev/null +++ b/yudao-ui-admin-vue3/src/views/system/mail/account/index.vue @@ -0,0 +1,151 @@ + + diff --git a/yudao-ui-admin/src/views/system/mail/account/index.vue b/yudao-ui-admin/src/views/system/mail/account/index.vue index 27f8d0fc1..56b6f3b84 100755 --- a/yudao-ui-admin/src/views/system/mail/account/index.vue +++ b/yudao-ui-admin/src/views/system/mail/account/index.vue @@ -27,7 +27,7 @@ - +