feat(oa): 添加知识管理和邮件功能模块

- 新增知识分类和知识文章的完整CRUD接口- 实现知识文章预览组件,支持富文本和附件展示
- 添加动态邮件配置功能,支持多种邮箱类型自动识别
- 实现邮件模板管理功能,提供多种商务邮件模板- 添加邮件发送功能,支持批量发送和附件上传
- 完善邮件工具类,支持富文本、附件和内嵌图片发送- 新增发件人邮箱账号管理功能
- 添加家具信息管理相关接口- 配置默认邮件服务参数
This commit is contained in:
JR
2025-10-22 22:36:10 +08:00
parent 429081460a
commit a8b0206cce
61 changed files with 7055 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,32 @@
/**
* 商务邮件模板
* 适用于商务合作、客户沟通等场景
*/
export const businessTemplate = {
name: "商务模板",
description: "专业的商务合作邮件模板,适合客户沟通和商务洽谈",
category: "business",
html: `
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 30px; text-align: center;">
<h1 style="color: white; margin: 0; font-size: 28px; font-weight: 300; font-family: Arial, sans-serif;">商务合作</h1>
<p style="color: rgba(255,255,255,0.8); margin: 10px 0 0 0; font-size: 16px; font-family: Arial, sans-serif;">Professional Business Communication</p>
</td>
</tr>
<tr>
<td style="padding: 40px 30px; background-color: #ffffff;">
<div style="margin-bottom: 30px;">
<h2 style="color: #333; font-size: 24px; margin-bottom: 20px; border-bottom: 2px solid #667eea; padding-bottom: 10px; font-family: Arial, sans-serif;">
尊敬的客户
</h2>
<div style="line-height: 1.8; color: #555; font-size: 16px; font-family: Arial, sans-serif;">
</div>
</div>
</td>
</tr>
</table>
`
};
export default businessTemplate;

View File

@@ -0,0 +1,32 @@
/**
* 邮件模板索引文件
* 统一管理所有邮件模板
*/
import { businessTemplate } from './business.js';
import { marketingTemplate } from './marketing.js';
import { notificationTemplate } from './notification.js';
import { productTemplate } from './product.js';
// 所有模板集合
export const emailTemplates = {
business: businessTemplate,
product: productTemplate,
marketing: marketingTemplate,
notification: notificationTemplate
};
// 根据模板键获取模板
export function getTemplate(templateKey) {
return emailTemplates[templateKey] || null;
}
// 获取所有模板
export function getAllTemplates() {
return emailTemplates;
}
export default {
emailTemplates,
getTemplate,
getAllTemplates
};

View File

@@ -0,0 +1,103 @@
/**
* 营销邮件模板
* 适用于产品推广、活动宣传等营销场景
*/
export const marketingTemplate = {
name: "营销推广模板",
description: "专业的营销推广邮件模板,适合产品推广和活动宣传",
category: "marketing",
html: `
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
<!-- 头部横幅 -->
<tr>
<td style="background: linear-gradient(45deg, #ff6b6b, #ffa726); padding: 40px 30px; text-align: center;">
<h1 style="color: white; margin: 0; font-size: 32px; font-weight: 600; font-family: Arial, sans-serif;">限时优惠</h1>
<p style="color: rgba(255,255,255,0.9); margin: 15px 0 0 0; font-size: 18px; font-family: Arial, sans-serif;">Special Offer</p>
</td>
</tr>
<!-- 主要内容 -->
<tr>
<td style="padding: 40px 30px; background-color: #ffffff;">
<!-- 优惠信息 -->
<div style="margin-bottom: 30px;">
<h2 style="color: #2c3e50; font-size: 26px; margin-bottom: 20px; text-align: center; font-family: Arial, sans-serif;">
🎉 特别优惠活动
</h2>
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="background: linear-gradient(135deg, #ff6b6b 0%, #ffa726 100%); border-radius: 12px; margin-bottom: 30px;">
<tr>
<td style="padding: 25px; color: white; text-align: center;">
<h3 style="margin: 0 0 15px 0; font-size: 24px; font-family: Arial, sans-serif;">限时折扣</h3>
<p style="margin: 0; font-size: 18px; font-family: Arial, sans-serif;">全场商品 <strong>8折优惠</strong></p>
<p style="margin: 10px 0 0 0; font-size: 14px; font-family: Arial, sans-serif;">活动时间2024年1月1日 - 2024年1月31日</p>
</td>
</tr>
</table>
</div>
<!-- 产品推荐 -->
<div style="margin-bottom: 30px;">
<h3 style="color: #2c3e50; margin: 0 0 20px 0; font-size: 20px; text-align: center; font-family: Arial, sans-serif;">🔥 热门推荐</h3>
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td style="width: 50%; padding-right: 10px;">
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="background: #f8f9fa; border-radius: 8px;">
<tr>
<td style="padding: 20px; text-align: center;">
<div style="width: 80px; height: 80px; background: linear-gradient(45deg, #ff6b6b, #ffa726); border-radius: 50%; margin: 0 auto 15px; display: inline-block; line-height: 80px; font-size: 32px; color: white;">🏠</div>
<h4 style="margin: 0 0 10px 0; color: #2c3e50; font-family: Arial, sans-serif;">精品家具</h4>
<p style="margin: 0 0 15px 0; color: #7f8c8d; font-size: 14px; font-family: Arial, sans-serif;">现代简约风格,品质保证</p>
<div style="background: #ff6b6b; color: white; padding: 8px 16px; border-radius: 20px; font-weight: bold; font-family: Arial, sans-serif;">
原价 ¥2999 现价 ¥2399
</div>
</td>
</tr>
</table>
</td>
<td style="width: 50%; padding-left: 10px;">
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="background: #f8f9fa; border-radius: 8px;">
<tr>
<td style="padding: 20px; text-align: center;">
<div style="width: 80px; height: 80px; background: linear-gradient(45deg, #4ecdc4, #44a08d); border-radius: 50%; margin: 0 auto 15px; display: inline-block; line-height: 80px; font-size: 32px; color: white;">🛋️</div>
<h4 style="margin: 0 0 10px 0; color: #2c3e50; font-family: Arial, sans-serif;">办公用品</h4>
<p style="margin: 0 0 15px 0; color: #7f8c8d; font-size: 14px; font-family: Arial, sans-serif;">专业办公环境解决方案</p>
<div style="background: #4ecdc4; color: white; padding: 8px 16px; border-radius: 20px; font-weight: bold; font-family: Arial, sans-serif;">
原价 ¥1999 现价 ¥1599
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<!-- 行动号召 -->
<div style="text-align: center; margin-bottom: 30px;">
<table role="presentation" cellspacing="0" cellpadding="0" border="0" style="margin: 0 auto;">
<tr>
<td style="background: linear-gradient(45deg, #ff6b6b, #ffa726); border-radius: 25px; padding: 15px 30px;">
<a href="#" style="color: white; text-decoration: none; font-size: 18px; font-weight: bold; font-family: Arial, sans-serif;">
🛒 立即购买
</a>
</td>
</tr>
</table>
</div>
<!-- 邮件正文内容 -->
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="background-color: #f8f9fa; border-radius: 8px; border-left: 4px solid #ff6b6b;">
<tr>
<td style="padding: 25px;">
<h3 style="color: #2c3e50; margin: 0 0 15px 0; font-size: 18px; font-family: Arial, sans-serif;">📧 详细信息</h3>
<div style="line-height: 1.8; color: #555; font-size: 16px; font-family: Arial, sans-serif;">
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
`
};

View File

@@ -0,0 +1,82 @@
/**
* 通知邮件模板
* 适用于系统通知、状态更新等场景
*/
export const notificationTemplate = {
name: "系统通知模板",
description: "简洁专业的系统通知邮件模板,适合状态更新和重要通知",
category: "notification",
html: `
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
<!-- 头部 -->
<tr>
<td style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 30px; text-align: center;">
<h1 style="color: white; margin: 0; font-size: 28px; font-weight: 300; font-family: Arial, sans-serif;">系统通知</h1>
<p style="color: rgba(255,255,255,0.8); margin: 10px 0 0 0; font-size: 16px; font-family: Arial, sans-serif;">System Notification</p>
</td>
</tr>
<!-- 主要内容 -->
<tr>
<td style="padding: 40px 30px; background-color: #ffffff;">
<!-- 通知图标 -->
<div style="text-align: center; margin-bottom: 30px;">
<div style="width: 80px; height: 80px; background: linear-gradient(45deg, #667eea, #764ba2); border-radius: 50%; margin: 0 auto; display: inline-block; line-height: 80px; font-size: 36px; color: white;">📢</div>
</div>
<!-- 通知标题 -->
<div style="text-align: center; margin-bottom: 30px;">
<h2 style="color: #2c3e50; font-size: 24px; margin-bottom: 15px; font-family: Arial, sans-serif;">
重要通知
</h2>
<p style="color: #7f8c8d; font-size: 16px; margin: 0; font-family: Arial, sans-serif;">
请仔细阅读以下内容
</p>
</div>
<!-- 通知内容卡片 -->
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="background: #f8f9fa; border-radius: 12px; margin-bottom: 30px;">
<tr>
<td style="padding: 30px;">
<div style="background: white; border-radius: 8px; padding: 25px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);">
<h3 style="color: #2c3e50; margin: 0 0 20px 0; font-size: 20px; font-family: Arial, sans-serif;">
📋 通知详情
</h3>
<div style="line-height: 1.8; color: #555; font-size: 16px; font-family: Arial, sans-serif;">
</div>
</div>
</td>
</tr>
</table>
<!-- 重要信息提示 -->
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 8px; margin-bottom: 30px;">
<tr>
<td style="padding: 20px; color: white;">
<h4 style="margin: 0 0 10px 0; font-size: 18px; font-family: Arial, sans-serif;">⚠️ 重要提醒</h4>
<ul style="margin: 0; padding-left: 20px; line-height: 1.6; font-family: Arial, sans-serif;">
<li>请及时处理相关事项</li>
<li>如有疑问请联系客服</li>
<li>感谢您的配合与支持</li>
</ul>
</td>
</tr>
</table>
<!-- 联系信息 -->
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="background: #ecf0f1; border-radius: 8px;">
<tr>
<td style="padding: 20px; text-align: center;">
<h4 style="margin: 0 0 15px 0; color: #2c3e50; font-family: Arial, sans-serif;">📞 联系我们</h4>
<p style="margin: 0; color: #7f8c8d; font-family: Arial, sans-serif;">
客服电话400-123-4567 | 邮箱support@company.com
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
`
};

View File

@@ -0,0 +1,94 @@
/**
* 产品介绍邮件模板
* 适用于产品展示、新品发布等场景
*/
export const productTemplate = {
name: "产品介绍模板",
description: "现代化的产品展示邮件模板,适合产品介绍和新品发布",
category: "product",
html: `
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
<!-- 头部横幅 -->
<tr>
<td style="background: linear-gradient(45deg, #ff6b6b, #4ecdc4); padding: 40px 30px; text-align: center;">
<h1 style="color: white; margin: 0; font-size: 32px; font-weight: 600; font-family: Arial, sans-serif;">产品展示</h1>
<p style="color: rgba(255,255,255,0.9); margin: 15px 0 0 0; font-size: 18px; font-family: Arial, sans-serif;">Product Showcase</p>
</td>
</tr>
<!-- 主要内容 -->
<tr>
<td style="padding: 40px 30px; background-color: #ffffff;">
<!-- 产品介绍 -->
<div style="margin-bottom: 40px;">
<h2 style="color: #2c3e50; font-size: 26px; margin-bottom: 25px; text-align: center; font-family: Arial, sans-serif;">
🚀 产品特色
</h2>
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 12px; margin-bottom: 30px;">
<tr>
<td style="padding: 25px; color: white;">
<h3 style="margin: 0 0 15px 0; font-size: 20px; font-family: Arial, sans-serif;">✨ 核心优势</h3>
<ul style="margin: 0; padding-left: 20px; line-height: 1.8; font-family: Arial, sans-serif;">
<li>高质量材料,确保产品耐用性</li>
<li>创新设计,满足现代审美需求</li>
<li>环保认证,符合国际标准</li>
<li>专业服务,全程技术支持</li>
</ul>
</td>
</tr>
</table>
<!-- 邮件正文内容 -->
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="background-color: #f8f9fa; border-radius: 8px; border-left: 4px solid #4ecdc4;">
<tr>
<td style="padding: 25px;">
<h3 style="color: #2c3e50; margin: 0 0 15px 0; font-size: 18px; font-family: Arial, sans-serif;">📧 详细信息</h3>
<div style="line-height: 1.8; color: #555; font-size: 16px; font-family: Arial, sans-serif;">
</div>
</td>
</tr>
</table>
</div>
<!-- 产品图片展示区域 -->
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="background-color: #ecf0f1; border-radius: 8px; margin-bottom: 30px;">
<tr>
<td style="padding: 25px;">
<h3 style="color: #2c3e50; margin: 0 0 20px 0; font-size: 20px; text-align: center; font-family: Arial, sans-serif;">📸 产品展示</h3>
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td style="width: 50%; padding-right: 7px;">
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="background: white; border-radius: 6px;">
<tr>
<td style="padding: 15px; text-align: center;">
<div style="width: 60px; height: 60px; background: linear-gradient(45deg, #ff6b6b, #4ecdc4); border-radius: 50%; margin: 0 auto 10px; display: inline-block; line-height: 60px; font-size: 24px; color: white;">🏠</div>
<h4 style="margin: 0 0 5px 0; color: #2c3e50; font-family: Arial, sans-serif;">家居系列</h4>
<p style="margin: 0; color: #7f8c8d; font-size: 14px; font-family: Arial, sans-serif;">现代简约风格</p>
</td>
</tr>
</table>
</td>
<td style="width: 50%; padding-left: 7px;">
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="100%" style="background: white; border-radius: 6px;">
<tr>
<td style="padding: 15px; text-align: center;">
<div style="width: 60px; height: 60px; background: linear-gradient(45deg, #667eea, #764ba2); border-radius: 50%; margin: 0 auto 10px; display: inline-block; line-height: 60px; font-size: 24px; color: white;">🛋️</div>
<h4 style="margin: 0 0 5px 0; color: #2c3e50; font-family: Arial, sans-serif;">办公系列</h4>
<p style="margin: 0; color: #7f8c8d; font-size: 14px; font-family: Arial, sans-serif;">专业办公环境</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
`
};
export default productTemplate;