mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
Compare commits
38 Commits
2504498eb5
...
v2.0
Author | SHA1 | Date | |
---|---|---|---|
3496852be1 | |||
4e27f3b5a5 | |||
e623b560e4 | |||
8aeb73627a | |||
3f148a4e62 | |||
34ab7d5da2 | |||
513dc31eaa | |||
dc2fbbd556 | |||
56fd5434ca | |||
ad207255bb | |||
3146c039f0 | |||
d5bbc37dec | |||
2f794c4b73 | |||
378aa869bf | |||
4a4244b5c4 | |||
ecad1c3e78 | |||
9ef0bd416e | |||
25ee32074a | |||
8412a8db16 | |||
9c51f75404 | |||
75cc0e4592 | |||
f9afd27f4b | |||
6dcc8c349a | |||
e230b0da81 | |||
12b25e0d58 | |||
e33f944a74 | |||
3d72f954ed | |||
1213531bef | |||
805c338141 | |||
3c0a52825d | |||
100e0ea55d | |||
257f1183fc | |||
7f2f3bd088 | |||
5ef1c5de98 | |||
90a14e338a | |||
4e625111ce | |||
8524ae7666 | |||
d6ae85d218 |
@ -16,7 +16,7 @@
|
|||||||
},
|
},
|
||||||
"playwright": {
|
"playwright": {
|
||||||
"command": "npx",
|
"command": "npx",
|
||||||
"args": ["@playwright/mcp@0.0.29"]
|
"args": ["@playwright/mcp@latest"]
|
||||||
},
|
},
|
||||||
"mcp-server-time": {
|
"mcp-server-time": {
|
||||||
"command": "uvx",
|
"command": "uvx",
|
||||||
@ -26,14 +26,21 @@
|
|||||||
"command": "npx",
|
"command": "npx",
|
||||||
"args": ["-y", "mcp-shrimp-task-manager"],
|
"args": ["-y", "mcp-shrimp-task-manager"],
|
||||||
"env": {
|
"env": {
|
||||||
"DATA_DIR": "D:/workspace/mcp-shrimp-task-manager/data",
|
"DATA_DIR": "D:/workspace/tools/mcp-shrimp-task-manager/data",
|
||||||
"TEMPLATES_USE": "en",
|
"TEMPLATES_USE": "en",
|
||||||
"ENABLE_GUI": "false"
|
"ENABLE_GUI": "true"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mcp-deepwiki": {
|
"mcp-deepwiki": {
|
||||||
"command": "npx",
|
"command": "npx",
|
||||||
"args": ["-y", "mcp-deepwiki@latest"]
|
"args": ["-y", "mcp-deepwiki@latest"]
|
||||||
|
},
|
||||||
|
"memory": {
|
||||||
|
"command": "npx",
|
||||||
|
"args": ["-y", "@modelcontextprotocol/server-memory"],
|
||||||
|
"env": {
|
||||||
|
"MEMORY_FILE_PATH": "D:/workspace/tools/server-memory/memory.json"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
---
|
---
|
||||||
description:
|
|
||||||
globs:
|
|
||||||
alwaysApply: false
|
alwaysApply: false
|
||||||
---
|
---
|
||||||
|
|
||||||
**# RIPER-5 + 多维度思维 + 代理执行协议 (v4.9.1 - MCP工具驱动版)**
|
**# RIPER-5 + 多维度思维 + 代理执行协议 (v4.9.1 - MCP工具驱动版)**
|
||||||
|
|
||||||
**元指令:** 此协议旨在最大化你的战略规划与执行效率。你的核心任务是**指挥和利用MCP工具集**来驱动项目进展。严格遵守核心原则,利用 `mcp-shrimp-task-manager` 进行项目规划与追踪,使用 `deepwiki-mcp` 进行深度研究。主动管理 `/project_document` 作为知识库。**每轮主要响应后,调用 `mcp.feedback_enhanced` 进行交互或通知。**
|
**元指令:** 此协议旨在最大化你的战略规划与执行效率。你的核心任务是**指挥和利用MCP工具集**来驱动项目进展。严格遵守核心原则,利用 `mcp-shrimp-task-manager` 进行项目规划与追踪,使用 `deepwiki-mcp` 进行深度研究。主动管理 `/project_document` 作为知识库。**每轮主要响应后,调用 `mcp.feedback_enhanced` 进行交互或通知。**
|
||||||
@ -167,5 +164,4 @@ alwaysApply: false
|
|||||||
|
|
||||||
* **极致效率:** AI应最大限度地减少手动干预,让MCP工具处理所有可以自动化的工作。
|
* **极致效率:** AI应最大限度地减少手动干预,让MCP工具处理所有可以自动化的工作。
|
||||||
* **战略聚焦:** 将AI的“思考”集中在无法被工具替代的领域:战略决策、创新构想、复杂问题诊断 (`mcp.sequential_thinking`) 和最终质量把关。
|
* **战略聚焦:** 将AI的“思考”集中在无法被工具替代的领域:战略决策、创新构想、复杂问题诊断 (`mcp.sequential_thinking`) 和最终质量把关。
|
||||||
|
|
||||||
* **无缝集成:** 期望AI能流畅地在不同MCP工具之间传递信息,形成一个高度整合的自动化工作流。
|
* **无缝集成:** 期望AI能流畅地在不同MCP工具之间传递信息,形成一个高度整合的自动化工作流。
|
||||||
|
2
.env.dev
2
.env.dev
@ -15,6 +15,8 @@ VITE_APP_CLIENT_ID=e5cd7e4891bf95d1d19206ce24a7b32e
|
|||||||
|
|
||||||
# 接口加密功能开关(如需关闭 后端也必须对应关闭)
|
# 接口加密功能开关(如需关闭 后端也必须对应关闭)
|
||||||
VITE_APP_ENCRYPT=Y
|
VITE_APP_ENCRYPT=Y
|
||||||
|
# AES 加密头标识
|
||||||
|
VITE_HEADER_FLAG=encrypt-key
|
||||||
# 接口加密传输 RSA 公钥与后端解密私钥对应 如更换需前后端一同更换
|
# 接口加密传输 RSA 公钥与后端解密私钥对应 如更换需前后端一同更换
|
||||||
VITE_APP_RSA_PUBLIC_KEY='MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdHnzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ=='
|
VITE_APP_RSA_PUBLIC_KEY='MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdHnzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ=='
|
||||||
# 接口响应解密 RSA 私钥与后端加密公钥对应 如更换需前后端一同更换
|
# 接口响应解密 RSA 私钥与后端加密公钥对应 如更换需前后端一同更换
|
||||||
|
@ -12,6 +12,8 @@ VITE_APP_CLIENT_ID=e5cd7e4891bf95d1d19206ce24a7b32e
|
|||||||
|
|
||||||
# 接口加密功能开关(如需关闭 后端也必须对应关闭)
|
# 接口加密功能开关(如需关闭 后端也必须对应关闭)
|
||||||
VITE_APP_ENCRYPT=Y
|
VITE_APP_ENCRYPT=Y
|
||||||
|
# AES 加密头标识
|
||||||
|
VITE_HEADER_FLAG=encrypt-key
|
||||||
# 接口加密传输 RSA 公钥与后端解密私钥对应 如更换需前后端一同更换
|
# 接口加密传输 RSA 公钥与后端解密私钥对应 如更换需前后端一同更换
|
||||||
VITE_APP_RSA_PUBLIC_KEY='MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdHnzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ=='
|
VITE_APP_RSA_PUBLIC_KEY='MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdHnzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ=='
|
||||||
# 接口响应解密 RSA 私钥与后端加密公钥对应 如更换需前后端一同更换
|
# 接口响应解密 RSA 私钥与后端加密公钥对应 如更换需前后端一同更换
|
||||||
|
@ -12,6 +12,8 @@ VITE_APP_CLIENT_ID=e5cd7e4891bf95d1d19206ce24a7b32e
|
|||||||
|
|
||||||
# 接口加密功能开关(如需关闭 后端也必须对应关闭)
|
# 接口加密功能开关(如需关闭 后端也必须对应关闭)
|
||||||
VITE_APP_ENCRYPT=Y
|
VITE_APP_ENCRYPT=Y
|
||||||
|
# AES 加密头标识
|
||||||
|
VITE_HEADER_FLAG=encrypt-key
|
||||||
# 接口加密传输 RSA 公钥与后端解密私钥对应 如更换需前后端一同更换
|
# 接口加密传输 RSA 公钥与后端解密私钥对应 如更换需前后端一同更换
|
||||||
VITE_APP_RSA_PUBLIC_KEY='MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdHnzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ=='
|
VITE_APP_RSA_PUBLIC_KEY='MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdHnzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ=='
|
||||||
# 接口响应解密 RSA 私钥与后端加密公钥对应 如更换需前后端一同更换
|
# 接口响应解密 RSA 私钥与后端加密公钥对应 如更换需前后端一同更换
|
||||||
|
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -31,7 +31,8 @@
|
|||||||
"vue.server.hybridMode": true,
|
"vue.server.hybridMode": true,
|
||||||
"files.exclude": { "/docs": true },
|
"files.exclude": { "/docs": true },
|
||||||
"search.exclude": {
|
"search.exclude": {
|
||||||
"/docs": true
|
"/docs": true,
|
||||||
|
"**/dist/**": true
|
||||||
},
|
},
|
||||||
"cSpell.words": ["Axios", "tinymce"]
|
"cSpell.words": ["Axios", "tinymce"]
|
||||||
}
|
}
|
||||||
|
39
CHANGELOG.md
39
CHANGELOG.md
@ -1,5 +1,44 @@
|
|||||||
# 更新日志
|
# 更新日志
|
||||||
|
|
||||||
|
## [v1.1.3](https://gitee.com/xlsea/ruoyi-plus-soybean/compare/v1.1.2...v1.1.3) (2025-08-16)
|
||||||
|
|
||||||
|
### 🐞 Bug 修复
|
||||||
|
|
||||||
|
- **hooks**:
|
||||||
|
- 非安全环境下不使用流式下载 - by @m-xlsea [<samp>(f8983)</samp>](https://gitee.com/xlsea/ruoyi-plus-soybean/commit/f8983557)
|
||||||
|
- 修复oss下载时未转码问题 - by **AN** [<samp>(2d31d)</samp>](https://gitee.com/xlsea/ruoyi-plus-soybean/commit/2d31d7dc)
|
||||||
|
- **project**:
|
||||||
|
- 关闭多租户功能后仍然遍历租户列表导致控制台报错的问题 - by **wang_rui** [<samp>(b96c4)</samp>](https://gitee.com/xlsea/ruoyi-plus-soybean/commit/b96c46ba)
|
||||||
|
- 关闭多租户功能后仍然遍历租户列表导致控制台报错的问题 Merge pull request !25 from littleghost2016/dev - by **不寻俗** [<samp>(90276)</samp>](https://gitee.com/xlsea/ruoyi-plus-soybean/commit/9027632b)
|
||||||
|
- **projects**:
|
||||||
|
- 修复一级菜单隐藏失效问题 - by **AN** [<samp>(8fcc7)</samp>](https://gitee.com/xlsea/ruoyi-plus-soybean/commit/8fcc70d7)
|
||||||
|
- 修复日期搜索条件清除问题 - by **AN** [<samp>(52318)</samp>](https://gitee.com/xlsea/ruoyi-plus-soybean/commit/52318c10)
|
||||||
|
- 修复登录过期事件监听未被重置 - by @m-xlsea [<samp>(71037)</samp>](https://gitee.com/xlsea/ruoyi-plus-soybean/commit/71037439)
|
||||||
|
- 修复用户新增时角色下拉包含超级管理员问题 - by **AN** [<samp>(a15b6)</samp>](https://gitee.com/xlsea/ruoyi-plus-soybean/commit/a15b683b)
|
||||||
|
- 修复用户导入功能无法更新问题 - by **AN** [<samp>(4e983)</samp>](https://gitee.com/xlsea/ruoyi-plus-soybean/commit/4e9839bd)
|
||||||
|
- Fix the icon size in the image preview toolbar - by @m-xlsea [<samp>(4539f)</samp>](https://gitee.com/xlsea/ruoyi-plus-soybean/commit/4539fe01)
|
||||||
|
- 修复新增用户未查询角色列表问题 - by **AN** [<samp>(d6ae8)</samp>](https://gitee.com/xlsea/ruoyi-plus-soybean/commit/d6ae85d2)
|
||||||
|
- **readme**:
|
||||||
|
- update GitHub stars and forks links for gitee - by @soybeanjs [<samp>(923eb)</samp>](https://gitee.com/xlsea/ruoyi-plus-soybean/commit/923eb98a)
|
||||||
|
|
||||||
|
### 💅 重构
|
||||||
|
|
||||||
|
- **menu**:
|
||||||
|
- 菜单管理中隐藏的菜单显示灰色 - by **NicholasLD** [<samp>(adca2)</samp>](https://gitee.com/xlsea/ruoyi-plus-soybean/commit/adca2e26)
|
||||||
|
- 菜单管理中隐藏的菜单显示灰色 Merge pull request !24 from NicholasLD/N/A - by **不寻俗** [<samp>(4eb77)</samp>](https://gitee.com/xlsea/ruoyi-plus-soybean/commit/4eb77eac)
|
||||||
|
- **projects**:
|
||||||
|
- 菜单列表新增禁用菜单样式 - by @m-xlsea [<samp>(e5383)</samp>](https://gitee.com/xlsea/ruoyi-plus-soybean/commit/e538355f)
|
||||||
|
|
||||||
|
### 🏡 杂项
|
||||||
|
|
||||||
|
- **other**: update the ESLint validation configuration to support more file types. - by **Azir-11** [<samp>(8d7f9)</samp>](https://gitee.com/xlsea/ruoyi-plus-soybean/commit/8d7f91dc)
|
||||||
|
- **readme**: remove DartNode sponsorship badge from README files - by @soybeanjs [<samp>(33ade)</samp>](https://gitee.com/xlsea/ruoyi-plus-soybean/commit/33ade539)
|
||||||
|
|
||||||
|
### ❤️ 贡献者
|
||||||
|
|
||||||
|
[](https://github.com/soybeanjs) [](https://github.com/m-xlsea) [](https://gitee.com/elio-an) [](https://github.com/Azir-11) [](https://github.com/NicholasLD)
|
||||||
|
[wang_rui](mailto:wrr1996@163.com)
|
||||||
|
|
||||||
## [v1.1.2](https://gitee.com/xlsea/ruoyi-plus-soybean/compare/v1.1.1...v1.1.2) (2025-07-24)
|
## [v1.1.2](https://gitee.com/xlsea/ruoyi-plus-soybean/compare/v1.1.1...v1.1.2) (2025-07-24)
|
||||||
|
|
||||||
### 🐞 Bug 修复
|
### 🐞 Bug 修复
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
# 📢 重要通知
|
# 📢 重要通知
|
||||||
|
|
||||||
1.1.2 版本已经正式发布,工作流版本迎来首个版本(请切换 [flow](https://gitee.com/xlsea/ruoyi-plus-soybean/tree/flow/) 分支查看),但仍然建议:
|
1.1.3 版本已经正式发布(工作流版本请切换 [flow](https://gitee.com/xlsea/ruoyi-plus-soybean/tree/flow/) 分支查看),但仍然建议:
|
||||||
- 在生产环境使用前进行充分测试
|
- 在生产环境使用前进行充分测试
|
||||||
- 关注项目更新,及时获取最新版本
|
- 关注项目更新,及时获取最新版本
|
||||||
- 积极反馈问题,帮助我们快速迭代
|
- 积极反馈问题,帮助我们快速迭代
|
||||||
@ -40,6 +40,11 @@
|
|||||||
|
|
||||||
<p style="font-weight: bold; font-size: 24px;">后端需要替换代码生成模板与菜单 SQL,详细请看 <a href="#代码生成与菜单更新">代码生成与菜单更新</a></p>
|
<p style="font-weight: bold; font-size: 24px;">后端需要替换代码生成模板与菜单 SQL,详细请看 <a href="#代码生成与菜单更新">代码生成与菜单更新</a></p>
|
||||||
|
|
||||||
|
# 💎 友情链接
|
||||||
|
|
||||||
|
- [Snail Job Pro](https://pro.snailjob.opensnail.com/home) - 灵活,可靠和快速的分布式任务重试和分布式任务调度平台
|
||||||
|
- [AiZuDa - 爱组搭(飞龙工作流企业版)](https://naiveui.aizuda.com) - 像搭积木一样进行低代码甚至零代码快速构建应用
|
||||||
|
|
||||||
## 📋 项目概述
|
## 📋 项目概述
|
||||||
|
|
||||||
RuoYi-Plus-Soybean 是一个现代化的企业级多租户管理系统,它结合了 RuoYi-Vue-Plus 的强大后端功能和 Soybean Admin 的现代化前端特性,为开发者提供了完整的企业管理解决方案。
|
RuoYi-Plus-Soybean 是一个现代化的企业级多租户管理系统,它结合了 RuoYi-Vue-Plus 的强大后端功能和 Soybean Admin 的现代化前端特性,为开发者提供了完整的企业管理解决方案。
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { HttpProxy, ProxyOptions } from 'vite';
|
import type { ProxyOptions } from 'vite';
|
||||||
import { bgRed, bgYellow, green, lightBlue } from 'kolorist';
|
import { bgRed, bgYellow, green, lightBlue } from 'kolorist';
|
||||||
import { consola } from 'consola';
|
import { consola } from 'consola';
|
||||||
import { createServiceConfig } from '../../src/utils/service';
|
import { createServiceConfig } from '../../src/utils/service';
|
||||||
@ -34,7 +34,7 @@ function createProxyItem(item: App.Service.ServiceConfigItem, enableLog: boolean
|
|||||||
target: item.baseURL,
|
target: item.baseURL,
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
ws: item.ws,
|
ws: item.ws,
|
||||||
configure: (_proxy: HttpProxy.Server, options: ProxyOptions) => {
|
configure: (_proxy, options) => {
|
||||||
_proxy.on('proxyReq', (_proxyReq, req, _res) => {
|
_proxy.on('proxyReq', (_proxyReq, req, _res) => {
|
||||||
if (!enableLog) return;
|
if (!enableLog) return;
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ import org.apache.velocity.VelocityContext;
|
|||||||
import org.dromara.common.core.utils.DateUtils;
|
import org.dromara.common.core.utils.DateUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.json.utils.JsonUtils;
|
import org.dromara.common.json.utils.JsonUtils;
|
||||||
|
import org.dromara.common.mybatis.enums.DataBaseType;
|
||||||
import org.dromara.common.mybatis.helper.DataBaseHelper;
|
import org.dromara.common.mybatis.helper.DataBaseHelper;
|
||||||
import org.dromara.generator.constant.GenConstants;
|
import org.dromara.generator.constant.GenConstants;
|
||||||
import org.dromara.generator.domain.GenTable;
|
import org.dromara.generator.domain.GenTable;
|
||||||
@ -58,7 +59,7 @@ public class VelocityUtils {
|
|||||||
velocityContext.put("functionName", StringUtils.isNotEmpty(functionName) ? functionName : "【请填写功能名称】");
|
velocityContext.put("functionName", StringUtils.isNotEmpty(functionName) ? functionName : "【请填写功能名称】");
|
||||||
velocityContext.put("ClassName", genTable.getClassName());
|
velocityContext.put("ClassName", genTable.getClassName());
|
||||||
velocityContext.put("className", StringUtils.uncapitalize(genTable.getClassName()));
|
velocityContext.put("className", StringUtils.uncapitalize(genTable.getClassName()));
|
||||||
velocityContext.put("moduleName", genTable.getModuleName());
|
velocityContext.put("moduleName", StrUtil.toSymbolCase(genTable.getModuleName(), '-'));
|
||||||
velocityContext.put("BusinessName", StringUtils.capitalize(genTable.getBusinessName()));
|
velocityContext.put("BusinessName", StringUtils.capitalize(genTable.getBusinessName()));
|
||||||
velocityContext.put("businessName", genTable.getBusinessName());
|
velocityContext.put("businessName", genTable.getBusinessName());
|
||||||
velocityContext.put("business_name", StrUtil.toUnderlineCase(genTable.getBusinessName()));
|
velocityContext.put("business_name", StrUtil.toUnderlineCase(genTable.getBusinessName()));
|
||||||
@ -124,11 +125,12 @@ public class VelocityUtils {
|
|||||||
templates.add("vm/java/serviceImpl.java.vm");
|
templates.add("vm/java/serviceImpl.java.vm");
|
||||||
templates.add("vm/java/controller.java.vm");
|
templates.add("vm/java/controller.java.vm");
|
||||||
templates.add("vm/xml/mapper.xml.vm");
|
templates.add("vm/xml/mapper.xml.vm");
|
||||||
if (DataBaseHelper.isOracle()) {
|
DataBaseType dataBaseType = DataBaseHelper.getDataBaseType();
|
||||||
|
if (dataBaseType.isOracle()) {
|
||||||
templates.add("vm/sql/oracle/sql.vm");
|
templates.add("vm/sql/oracle/sql.vm");
|
||||||
} else if (DataBaseHelper.isPostgerSql()) {
|
} else if (dataBaseType.isPostgreSql()) {
|
||||||
templates.add("vm/sql/postgres/sql.vm");
|
templates.add("vm/sql/postgres/sql.vm");
|
||||||
} else if (DataBaseHelper.isSqlServer()) {
|
} else if (dataBaseType.isSqlServer()) {
|
||||||
templates.add("vm/sql/sqlserver/sql.vm");
|
templates.add("vm/sql/sqlserver/sql.vm");
|
||||||
} else {
|
} else {
|
||||||
templates.add("vm/sql/sql.vm");
|
templates.add("vm/sql/sql.vm");
|
||||||
@ -163,7 +165,7 @@ public class VelocityUtils {
|
|||||||
String javaPath = PROJECT_PATH + "/" + StringUtils.replace(packageName, ".", "/");
|
String javaPath = PROJECT_PATH + "/" + StringUtils.replace(packageName, ".", "/");
|
||||||
String mybatisPath = MYBATIS_PATH + "/" + moduleName;
|
String mybatisPath = MYBATIS_PATH + "/" + moduleName;
|
||||||
String soybeanPath = "soy";
|
String soybeanPath = "soy";
|
||||||
|
String soybeanModuleName = StrUtil.toSymbolCase(moduleName, '-');
|
||||||
if (template.contains("domain.java.vm")) {
|
if (template.contains("domain.java.vm")) {
|
||||||
fileName = StringUtils.format("{}/domain/{}.java", javaPath, className);
|
fileName = StringUtils.format("{}/domain/{}.java", javaPath, className);
|
||||||
}
|
}
|
||||||
@ -186,17 +188,17 @@ public class VelocityUtils {
|
|||||||
} else if (template.contains("sql.vm")) {
|
} else if (template.contains("sql.vm")) {
|
||||||
fileName = businessName + "Menu.sql";
|
fileName = businessName + "Menu.sql";
|
||||||
} else if (template.contains("index.vue.vm")) {
|
} else if (template.contains("index.vue.vm")) {
|
||||||
fileName = StringUtils.format("{}/views/{}/{}/index.vue", soybeanPath, moduleName, StrUtil.toSymbolCase(businessName, '-'));
|
fileName = StringUtils.format("{}/views/{}/{}/index.vue", soybeanPath, soybeanModuleName, StrUtil.toSymbolCase(businessName, '-'));
|
||||||
} else if (template.contains("index-tree.vue.vm")) {
|
} else if (template.contains("index-tree.vue.vm")) {
|
||||||
fileName = StringUtils.format("{}/views/{}/{}/index.vue", soybeanPath, moduleName, StrUtil.toSymbolCase(businessName, '-'));
|
fileName = StringUtils.format("{}/views/{}/{}/index.vue", soybeanPath, soybeanModuleName, StrUtil.toSymbolCase(businessName, '-'));
|
||||||
} else if (template.contains("api.d.ts.vm")) {
|
} else if (template.contains("api.d.ts.vm")) {
|
||||||
fileName = StringUtils.format("{}/typings/api/{}.{}.api.d.ts", soybeanPath, moduleName, StrUtil.toSymbolCase(businessName, '-'));
|
fileName = StringUtils.format("{}/typings/api/{}.{}.api.d.ts", soybeanPath, soybeanModuleName, StrUtil.toSymbolCase(businessName, '-'));
|
||||||
} else if (template.contains("api.ts.vm")) {
|
} else if (template.contains("api.ts.vm")) {
|
||||||
fileName = StringUtils.format("{}/service/api/{}/{}.ts", soybeanPath, moduleName, StrUtil.toSymbolCase(businessName, '-'));
|
fileName = StringUtils.format("{}/service/api/{}/{}.ts", soybeanPath, soybeanModuleName, StrUtil.toSymbolCase(businessName, '-'));
|
||||||
} else if (template.contains("search.vue.vm")) {
|
} else if (template.contains("search.vue.vm")) {
|
||||||
fileName = StringUtils.format("{}/views/{}/{}/modules/{}-search.vue", soybeanPath, moduleName, StrUtil.toSymbolCase(businessName, '-'), StrUtil.toSymbolCase(businessName, '-'));
|
fileName = StringUtils.format("{}/views/{}/{}/modules/{}-search.vue", soybeanPath, soybeanModuleName, StrUtil.toSymbolCase(businessName, '-'), StrUtil.toSymbolCase(businessName, '-'));
|
||||||
} else if (template.contains("operate-drawer.vue.vm")) {
|
} else if (template.contains("operate-drawer.vue.vm")) {
|
||||||
fileName = StringUtils.format("{}/views/{}/{}/modules/{}-operate-drawer.vue", soybeanPath, moduleName, StrUtil.toSymbolCase(businessName, '-'), StrUtil.toSymbolCase(businessName, '-'));
|
fileName = StringUtils.format("{}/views/{}/{}/modules/{}-operate-drawer.vue", soybeanPath, soybeanModuleName, StrUtil.toSymbolCase(businessName, '-'), StrUtil.toSymbolCase(businessName, '-'));
|
||||||
}
|
}
|
||||||
return fileName;
|
return fileName;
|
||||||
}
|
}
|
||||||
|
57
package.json
57
package.json
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "ruoyi-vue-plus",
|
"name": "ruoyi-vue-plus",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "1.1.2",
|
"version": "1.1.3",
|
||||||
"description": "结合了 RuoYi-Vue-Plus 的强大后端功能和 Soybean Admin 的现代化前端特性,为开发者提供了完整的企业管理解决方案。",
|
"description": "结合了 RuoYi-Vue-Plus 的强大后端功能和 Soybean Admin 的现代化前端特性,为开发者提供了完整的企业管理解决方案。",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "xlsea",
|
"name": "xlsea",
|
||||||
@ -66,11 +66,11 @@
|
|||||||
"@sa/tinymce": "workspace:*",
|
"@sa/tinymce": "workspace:*",
|
||||||
"@sa/utils": "workspace:*",
|
"@sa/utils": "workspace:*",
|
||||||
"@types/streamsaver": "^2.0.5",
|
"@types/streamsaver": "^2.0.5",
|
||||||
"@vueuse/core": "13.5.0",
|
"@vueuse/core": "13.8.0",
|
||||||
"clipboard": "2.0.11",
|
"clipboard": "2.0.11",
|
||||||
"dayjs": "1.11.13",
|
"dayjs": "1.11.14",
|
||||||
"defu": "6.1.4",
|
"defu": "6.1.4",
|
||||||
"echarts": "5.6.0",
|
"echarts": "6.0.0",
|
||||||
"highlight.js": "^11.11.1",
|
"highlight.js": "^11.11.1",
|
||||||
"jsencrypt": "^3.3.2",
|
"jsencrypt": "^3.3.2",
|
||||||
"json5": "2.2.3",
|
"json5": "2.2.3",
|
||||||
@ -80,46 +80,47 @@
|
|||||||
"pinia": "3.0.3",
|
"pinia": "3.0.3",
|
||||||
"streamsaver": "^2.0.6",
|
"streamsaver": "^2.0.6",
|
||||||
"tailwind-merge": "3.3.1",
|
"tailwind-merge": "3.3.1",
|
||||||
"vue": "3.5.17",
|
"vue": "3.5.20",
|
||||||
"vue-advanced-cropper": "^2.8.9",
|
"vue-advanced-cropper": "^2.8.9",
|
||||||
"vue-draggable-plus": "0.6.0",
|
"vue-draggable-plus": "0.6.0",
|
||||||
"vue-i18n": "11.1.10",
|
"vue-i18n": "11.1.11",
|
||||||
"vue-router": "4.5.1"
|
"vue-router": "4.5.1",
|
||||||
|
"xlsx": "0.18.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@elegant-router/vue": "0.3.8",
|
"@elegant-router/vue": "0.3.8",
|
||||||
"@iconify/json": "2.2.359",
|
"@iconify/json": "2.2.378",
|
||||||
"@sa/scripts": "workspace:*",
|
"@sa/scripts": "workspace:*",
|
||||||
"@sa/uno-preset": "workspace:*",
|
"@sa/uno-preset": "workspace:*",
|
||||||
"@soybeanjs/eslint-config": "1.7.1",
|
"@soybeanjs/eslint-config": "1.7.1",
|
||||||
"@types/node": "24.0.15",
|
"@types/node": "24.3.0",
|
||||||
"@types/nprogress": "0.2.3",
|
"@types/nprogress": "0.2.3",
|
||||||
"@unocss/eslint-config": "66.3.3",
|
"@unocss/eslint-config": "66.4.2",
|
||||||
"@unocss/preset-icons": "66.3.3",
|
"@unocss/preset-icons": "66.4.2",
|
||||||
"@unocss/preset-uno": "66.3.3",
|
"@unocss/preset-uno": "66.4.2",
|
||||||
"@unocss/transformer-directives": "66.3.3",
|
"@unocss/transformer-directives": "66.4.2",
|
||||||
"@unocss/transformer-variant-group": "66.3.3",
|
"@unocss/transformer-variant-group": "66.4.2",
|
||||||
"@unocss/vite": "66.3.3",
|
"@unocss/vite": "66.4.2",
|
||||||
"@vitejs/plugin-vue": "6.0.0",
|
"@vitejs/plugin-vue": "6.0.1",
|
||||||
"@vitejs/plugin-vue-jsx": "5.0.1",
|
"@vitejs/plugin-vue-jsx": "5.1.0",
|
||||||
"consola": "3.4.2",
|
"consola": "3.4.2",
|
||||||
"eslint": "9.31.0",
|
"eslint": "9.34.0",
|
||||||
"eslint-plugin-vue": "10.3.0",
|
"eslint-plugin-vue": "10.4.0",
|
||||||
"kolorist": "1.8.0",
|
"kolorist": "1.8.0",
|
||||||
"sass": "1.89.2",
|
"sass": "1.91.0",
|
||||||
"simple-git-hooks": "2.13.0",
|
"simple-git-hooks": "2.13.1",
|
||||||
"tsx": "4.20.3",
|
"tsx": "4.20.5",
|
||||||
"typescript": "5.8.3",
|
"typescript": "5.9.2",
|
||||||
"unplugin-icons": "22.1.0",
|
"unplugin-icons": "22.2.0",
|
||||||
"unplugin-vue-components": "28.8.0",
|
"unplugin-vue-components": "29.0.0",
|
||||||
"vite": "7.0.5",
|
"vite": "7.1.3",
|
||||||
"vite-plugin-monaco-editor": "^1.1.0",
|
"vite-plugin-monaco-editor": "^1.1.0",
|
||||||
"vite-plugin-progress": "0.0.7",
|
"vite-plugin-progress": "0.0.7",
|
||||||
"vite-plugin-static-copy": "^3.1.0",
|
"vite-plugin-static-copy": "^3.1.0",
|
||||||
"vite-plugin-svg-icons": "2.0.1",
|
"vite-plugin-svg-icons": "2.0.1",
|
||||||
"vite-plugin-vue-devtools": "7.7.7",
|
"vite-plugin-vue-devtools": "8.0.1",
|
||||||
"vue-eslint-parser": "10.2.0",
|
"vue-eslint-parser": "10.2.0",
|
||||||
"vue-tsc": "3.0.3"
|
"vue-tsc": "3.0.6"
|
||||||
},
|
},
|
||||||
"simple-git-hooks": {
|
"simple-git-hooks": {
|
||||||
"commit-msg": "pnpm sa git-commit-verify",
|
"commit-msg": "pnpm sa git-commit-verify",
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sa/utils": "workspace:*",
|
"@sa/utils": "workspace:*",
|
||||||
"axios": "1.10.0",
|
"axios": "1.11.0",
|
||||||
"axios-retry": "4.5.0",
|
"axios-retry": "4.5.0",
|
||||||
"qs": "6.14.0"
|
"qs": "6.14.0"
|
||||||
},
|
},
|
||||||
|
@ -14,14 +14,15 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@soybeanjs/changelog": "0.3.24",
|
"@soybeanjs/changelog": "0.3.24",
|
||||||
"bumpp": "10.2.0",
|
"bumpp": "10.2.3",
|
||||||
"c12": "3.1.0",
|
"c12": "3.2.0",
|
||||||
"cac": "6.7.14",
|
"cac": "6.7.14",
|
||||||
"consola": "3.4.2",
|
"consola": "3.4.2",
|
||||||
"enquirer": "2.4.1",
|
"enquirer": "2.4.1",
|
||||||
"execa": "9.6.0",
|
"execa": "9.6.0",
|
||||||
"kolorist": "1.8.0",
|
"kolorist": "1.8.0",
|
||||||
"npm-check-updates": "18.0.1",
|
"npm-check-updates": "18.0.3",
|
||||||
|
"picomatch": "4.0.3",
|
||||||
"rimraf": "6.0.1"
|
"rimraf": "6.0.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2515
pnpm-lock.yaml
generated
2515
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, useAttrs } from 'vue';
|
import { computed, useAttrs } from 'vue';
|
||||||
import type { TagProps } from 'naive-ui';
|
import type { TagProps } from 'naive-ui';
|
||||||
|
import { jsonClone } from '@sa/utils';
|
||||||
import { useDict } from '@/hooks/business/dict';
|
import { useDict } from '@/hooks/business/dict';
|
||||||
import { isNotNull } from '@/utils/common';
|
import { isNotNull } from '@/utils/common';
|
||||||
import { $t } from '@/locales';
|
import { $t } from '@/locales';
|
||||||
@ -28,7 +29,7 @@ const { transformDictData } = useDict(props.dictCode, props.immediate);
|
|||||||
|
|
||||||
const dictTagData = computed<Api.System.DictData[]>(() => {
|
const dictTagData = computed<Api.System.DictData[]>(() => {
|
||||||
if (props.dictData) {
|
if (props.dictData) {
|
||||||
const dictData = props.dictData;
|
const dictData = jsonClone(props.dictData);
|
||||||
if (dictData.dictLabel?.startsWith(`dict.${dictData.dictType}.`)) {
|
if (dictData.dictLabel?.startsWith(`dict.${dictData.dictType}.`)) {
|
||||||
dictData.dictLabel = $t(dictData.dictLabel as App.I18n.I18nKey);
|
dictData.dictLabel = $t(dictData.dictLabel as App.I18n.I18nKey);
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import hljs from 'highlight.js/lib/core';
|
import hljs from 'highlight.js/lib/core';
|
||||||
import json from 'highlight.js/lib/languages/json';
|
import json from 'highlight.js/lib/languages/json';
|
||||||
|
import { twMerge } from 'tailwind-merge';
|
||||||
|
|
||||||
hljs.registerLanguage('json', json);
|
hljs.registerLanguage('json', json);
|
||||||
|
|
||||||
@ -10,15 +11,19 @@ defineOptions({
|
|||||||
});
|
});
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
class?: string;
|
||||||
code?: string;
|
code?: string;
|
||||||
showLineNumbers?: boolean;
|
showLineNumbers?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
|
class: '',
|
||||||
code: '',
|
code: '',
|
||||||
showLineNumbers: false
|
showLineNumbers: false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const DEFAULT_CLASS = 'max-h-500px';
|
||||||
|
|
||||||
/** 格式化JSON数据 */
|
/** 格式化JSON数据 */
|
||||||
const jsonData = computed<string>(() => {
|
const jsonData = computed<string>(() => {
|
||||||
if (!props.code) return '';
|
if (!props.code) return '';
|
||||||
@ -33,9 +38,9 @@ const jsonData = computed<string>(() => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="json-preview">
|
<NScrollbar :class="twMerge(DEFAULT_CLASS, props.class)">
|
||||||
<NCode :code="jsonData" :hljs="hljs" language="json" :show-line-numbers="showLineNumbers" />
|
<NCode :code="jsonData" :hljs="hljs" language="json" :show-line-numbers="showLineNumbers" :word-wrap="true" />
|
||||||
</div>
|
</NScrollbar>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@ -44,18 +49,4 @@ html[class='dark'] {
|
|||||||
background-color: #7c7777;
|
background-color: #7c7777;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.json-preview {
|
|
||||||
width: 100%;
|
|
||||||
max-height: 500px;
|
|
||||||
overflow-y: auto;
|
|
||||||
@include scrollbar();
|
|
||||||
.empty-data {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
height: 100%;
|
|
||||||
color: #999;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,61 +1,524 @@
|
|||||||
|
<!-- Copyright By https://github.com/Daymychen/art-design-pro/blob/main/src/components/core/views/login/LoginLeftView.vue -->
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed } from 'vue';
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
import { getPaletteColorByNumber } from '@sa/color';
|
|
||||||
|
|
||||||
defineOptions({ name: 'WaveBg' });
|
defineOptions({ name: 'WaveBg' });
|
||||||
|
|
||||||
interface Props {
|
const themeStore = useThemeStore();
|
||||||
/** Theme color */
|
|
||||||
themeColor: string;
|
function toggleThemeScheme() {
|
||||||
|
if (themeStore.darkMode) {
|
||||||
|
themeStore.setThemeScheme('light');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
themeStore.setThemeScheme('dark');
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps<Props>();
|
|
||||||
|
|
||||||
const lightColor = computed(() => getPaletteColorByNumber(props.themeColor, 200));
|
|
||||||
const darkColor = computed(() => getPaletteColorByNumber(props.themeColor, 500));
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="absolute-lt z-1 size-full overflow-hidden">
|
<div class="wave-bg">
|
||||||
<div class="absolute -right-300px -top-900px lt-sm:(-right-100px -top-1170px)">
|
<!-- 几何装饰元素 -->
|
||||||
<svg height="1337" width="1337">
|
<div class="geometric-decorations">
|
||||||
<defs>
|
<!-- 基础几何形状 -->
|
||||||
<path
|
<div class="geo-element circle-outline animate-fade-in-up animate-delay-0s"></div>
|
||||||
id="path-1"
|
<div class="geo-element square-rotated animate-fade-in-left animate-delay-0s"></div>
|
||||||
opacity="1"
|
<div class="geo-element circle-small animate-fade-in-up animate-delay-0.3s"></div>
|
||||||
fill-rule="evenodd"
|
|
||||||
d="M1337,668.5 C1337,1037.455193874239 1037.455193874239,1337 668.5,1337 C523.6725684305388,1337 337,1236 370.50000000000006,1094 C434.03835568300906,824.6732385973953 6.906089672974592e-14,892.6277623047779 0,668.5000000000001 C0,299.5448061257611 299.5448061257609,1.1368683772161603e-13 668.4999999999999,0 C1037.455193874239,0 1337,299.544806125761 1337,668.5Z"
|
<div class="geo-element square-bottom-right animate-fade-in-right animate-delay-0s"></div>
|
||||||
/>
|
|
||||||
<linearGradient id="linearGradient-2" x1="0.79" y1="0.62" x2="0.21" y2="0.86">
|
<!-- 背景泡泡 -->
|
||||||
<stop offset="0" :stop-color="lightColor" stop-opacity="1" />
|
<div class="geo-element bg-bubble animate-scale-in animate-delay-0.5s"></div>
|
||||||
<stop offset="1" :stop-color="darkColor" stop-opacity="1" />
|
|
||||||
</linearGradient>
|
<!-- 太阳/月亮 -->
|
||||||
</defs>
|
<div
|
||||||
<g opacity="1">
|
class="geo-element circle-top-right animate-fade-in-down animate-delay-0.5s"
|
||||||
<use xlink:href="#path-1" fill="url(#linearGradient-2)" fill-opacity="1" />
|
@click="toggleThemeScheme"
|
||||||
</g>
|
></div>
|
||||||
</svg>
|
|
||||||
</div>
|
<!-- 装饰点 -->
|
||||||
<div class="absolute -bottom-400px -left-200px lt-sm:(-bottom-760px -left-100px)">
|
<div class="geo-element dot dot-top-left animate-bounce-in animate-delay-0s"></div>
|
||||||
<svg height="896" width="967.8852157128662">
|
<div class="geo-element dot dot-top-right animate-bounce-in animate-delay-0s"></div>
|
||||||
<defs>
|
<div class="geo-element dot dot-center-right animate-bounce-in animate-delay-0s"></div>
|
||||||
<path
|
|
||||||
id="path-2"
|
<!-- 叠加方块组 -->
|
||||||
opacity="1"
|
<div class="squares-group">
|
||||||
fill-rule="evenodd"
|
<i class="geo-element square square-blue animate-fade-in-left-rotated-blue animate-delay-0.2s"></i>
|
||||||
d="M896,448 C1142.6325445712241,465.5747656464056 695.2579309733121,896 448,896 C200.74206902668806,896 5.684341886080802e-14,695.2579309733121 0,448.0000000000001 C0,200.74206902668806 200.74206902668791,5.684341886080802e-14 447.99999999999994,0 C695.2579309733121,0 475,418 896,448Z"
|
<i class="geo-element square square-pink animate-fade-in-left-rotated-pink animate-delay-0.4s"></i>
|
||||||
/>
|
<i class="geo-element square square-purple animate-fade-in-left-no-rotation animate-delay-0.6s"></i>
|
||||||
<linearGradient id="linearGradient-3" x1="0.5" y1="0" x2="0.5" y2="1">
|
</div>
|
||||||
<stop offset="0" :stop-color="darkColor" stop-opacity="1" />
|
|
||||||
<stop offset="1" :stop-color="lightColor" stop-opacity="1" />
|
|
||||||
</linearGradient>
|
|
||||||
</defs>
|
|
||||||
<g opacity="1">
|
|
||||||
<use xlink:href="#path-2" fill="url(#linearGradient-3)" fill-opacity="1" />
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style lang="scss" scoped>
|
||||||
|
// 颜色变量定义
|
||||||
|
$primary-light-7: rgb(var(--primary-50-color));
|
||||||
|
$primary-light-8: rgb(var(--primary-100-color));
|
||||||
|
$primary-light-9: rgb(var(--primary-200-color));
|
||||||
|
$primary-base: rgb(var(--primary-color));
|
||||||
|
$main-bg: rgb(var(--primary-50-color));
|
||||||
|
|
||||||
|
// 混合颜色函数
|
||||||
|
$bg-mix-light-9: color-mix(in srgb, $primary-light-9 100%, $main-bg);
|
||||||
|
$bg-mix-light-8: color-mix(in srgb, $primary-light-8 80%, $main-bg);
|
||||||
|
$bg-mix-light-7: color-mix(in srgb, $primary-light-7 80%, $main-bg);
|
||||||
|
|
||||||
|
.wave-bg {
|
||||||
|
.geometric-decorations {
|
||||||
|
.geo-element {
|
||||||
|
position: absolute;
|
||||||
|
opacity: 0;
|
||||||
|
animation-fill-mode: forwards;
|
||||||
|
animation-duration: 0.8s;
|
||||||
|
animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 动画 mixin
|
||||||
|
@mixin fadeAnimation($direction: '', $rotation: 0deg) {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
|
||||||
|
@if $direction == 'up' {
|
||||||
|
transform: translateY(30px) rotate($rotation);
|
||||||
|
} @else if $direction == 'down' {
|
||||||
|
transform: translateY(-30px) rotate($rotation);
|
||||||
|
} @else if $direction == 'left' {
|
||||||
|
transform: translateX(-30px) rotate($rotation);
|
||||||
|
} @else if $direction == 'right' {
|
||||||
|
transform: translateX(30px) rotate($rotation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
|
||||||
|
@if $direction == 'up' or $direction == 'down' {
|
||||||
|
transform: translateY(0) rotate($rotation);
|
||||||
|
} @else {
|
||||||
|
transform: translateX(0) rotate($rotation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 动画定义
|
||||||
|
@keyframes fadeInUp {
|
||||||
|
@include fadeAnimation('up');
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fadeInDown {
|
||||||
|
@include fadeAnimation('down');
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fadeInLeft {
|
||||||
|
@include fadeAnimation('left');
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fadeInLeftRotated {
|
||||||
|
@include fadeAnimation('left', -25deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fadeInRight {
|
||||||
|
@include fadeAnimation('right');
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fadeInRightRotated {
|
||||||
|
@include fadeAnimation('right', 45deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fadeInLeftRotatedBlue {
|
||||||
|
@include fadeAnimation('left', -10deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fadeInLeftRotatedPink {
|
||||||
|
@include fadeAnimation('left', 10deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fadeInLeftNoRotation {
|
||||||
|
@include fadeAnimation('left');
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes scaleIn {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: scale(0.8);
|
||||||
|
}
|
||||||
|
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes bounceIn {
|
||||||
|
0% {
|
||||||
|
opacity: 0;
|
||||||
|
transform: scale(0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
50% {
|
||||||
|
opacity: 1;
|
||||||
|
transform: scale(1.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
70% {
|
||||||
|
transform: scale(0.9);
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
opacity: 1;
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes lineGrow {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes slideInLeft {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateX(-30px);
|
||||||
|
}
|
||||||
|
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateX(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 动画类
|
||||||
|
.animate-fade-in-up {
|
||||||
|
animation-name: fadeInUp;
|
||||||
|
}
|
||||||
|
|
||||||
|
.animate-fade-in-down {
|
||||||
|
animation-name: fadeInDown;
|
||||||
|
}
|
||||||
|
|
||||||
|
.animate-fade-in-left {
|
||||||
|
animation-name: fadeInLeft;
|
||||||
|
}
|
||||||
|
|
||||||
|
.animate-fade-in-right {
|
||||||
|
animation-name: fadeInRight;
|
||||||
|
}
|
||||||
|
|
||||||
|
.animate-scale-in {
|
||||||
|
animation-name: scaleIn;
|
||||||
|
animation-duration: 1.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.animate-bounce-in {
|
||||||
|
animation-name: bounceIn;
|
||||||
|
animation-duration: 0.6s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.animate-fade-in-left-rotated-blue {
|
||||||
|
animation-name: fadeInLeftRotatedBlue;
|
||||||
|
}
|
||||||
|
|
||||||
|
.animate-fade-in-left-rotated-pink {
|
||||||
|
animation-name: fadeInLeftRotatedPink;
|
||||||
|
}
|
||||||
|
|
||||||
|
.animate-fade-in-left-no-rotation {
|
||||||
|
animation-name: fadeInLeftNoRotation;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 基础几何形状
|
||||||
|
.circle-outline {
|
||||||
|
top: 10%;
|
||||||
|
left: 25%;
|
||||||
|
width: 42px;
|
||||||
|
height: 42px;
|
||||||
|
border: 2px solid $primary-light-8;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.square-rotated {
|
||||||
|
top: 50%;
|
||||||
|
left: 16%;
|
||||||
|
width: 60px;
|
||||||
|
height: 60px;
|
||||||
|
background-color: $bg-mix-light-8;
|
||||||
|
|
||||||
|
&.animate-fade-in-left {
|
||||||
|
animation-name: fadeInLeftRotated;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.circle-small {
|
||||||
|
bottom: 26%;
|
||||||
|
left: 30%;
|
||||||
|
width: 18px;
|
||||||
|
height: 18px;
|
||||||
|
background-color: $primary-light-8;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 太阳/月亮效果
|
||||||
|
.circle-top-right {
|
||||||
|
top: 3%;
|
||||||
|
right: 3%;
|
||||||
|
z-index: 100;
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
cursor: pointer;
|
||||||
|
background: $bg-mix-light-7;
|
||||||
|
border-radius: 50%;
|
||||||
|
transition: all 0.3s;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
content: '';
|
||||||
|
background: linear-gradient(to right, #fcbb04, #fffc00);
|
||||||
|
border-radius: 50%;
|
||||||
|
opacity: 0;
|
||||||
|
transition: all 0.5s;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
box-shadow: 0 0 36px #fffc00;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.square-bottom-right {
|
||||||
|
right: 10%;
|
||||||
|
bottom: 10%;
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
background-color: $primary-light-8;
|
||||||
|
|
||||||
|
&.animate-fade-in-right {
|
||||||
|
animation-name: fadeInRightRotated;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 背景泡泡
|
||||||
|
.bg-bubble {
|
||||||
|
top: -120px;
|
||||||
|
right: -120px;
|
||||||
|
width: 360px;
|
||||||
|
height: 360px;
|
||||||
|
background-color: $bg-mix-light-8;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 装饰点
|
||||||
|
.dot {
|
||||||
|
width: 14px;
|
||||||
|
height: 14px;
|
||||||
|
background-color: $primary-light-7;
|
||||||
|
border-radius: 50%;
|
||||||
|
|
||||||
|
&.dot-top-left {
|
||||||
|
top: 140px;
|
||||||
|
left: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.dot-top-right {
|
||||||
|
top: 140px;
|
||||||
|
right: 120px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.dot-center-right {
|
||||||
|
top: 46%;
|
||||||
|
right: 22%;
|
||||||
|
background-color: $primary-light-8;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 叠加方块组
|
||||||
|
.squares-group {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 18px;
|
||||||
|
left: 20px;
|
||||||
|
width: 140px;
|
||||||
|
height: 140px;
|
||||||
|
pointer-events: none;
|
||||||
|
|
||||||
|
.square {
|
||||||
|
position: absolute;
|
||||||
|
display: block;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 8px 24px rgb(64 87 167 / 12%);
|
||||||
|
|
||||||
|
&.square-blue {
|
||||||
|
top: 12px;
|
||||||
|
left: 30px;
|
||||||
|
z-index: 2;
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
background-color: rgb(from $primary-base r g b / 30%);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.square-pink {
|
||||||
|
top: 30px;
|
||||||
|
left: 48px;
|
||||||
|
z-index: 1;
|
||||||
|
width: 70px;
|
||||||
|
height: 70px;
|
||||||
|
background-color: rgb(from $primary-base r g b / 15%);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.square-purple {
|
||||||
|
top: 66px;
|
||||||
|
left: 86px;
|
||||||
|
z-index: 3;
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
background-color: rgb(from $primary-base r g b / 45%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 装饰线条
|
||||||
|
&::after {
|
||||||
|
position: absolute;
|
||||||
|
top: 86px;
|
||||||
|
left: 72px;
|
||||||
|
width: 80px;
|
||||||
|
height: 1px;
|
||||||
|
content: '';
|
||||||
|
background: linear-gradient(90deg, var(--el-color-primary-light-6), transparent);
|
||||||
|
opacity: 0;
|
||||||
|
transform: rotate(50deg);
|
||||||
|
animation: lineGrow 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
|
||||||
|
animation-delay: 1.2s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (max-width: 1600px) {
|
||||||
|
width: 60vw;
|
||||||
|
|
||||||
|
.text-wrap {
|
||||||
|
bottom: 40px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (max-width: 1280px) {
|
||||||
|
width: auto;
|
||||||
|
height: auto;
|
||||||
|
padding: 0;
|
||||||
|
// 隐藏背景和其他内容,只保留 logo
|
||||||
|
background: transparent;
|
||||||
|
|
||||||
|
.left-img,
|
||||||
|
.text-wrap,
|
||||||
|
.geometric-decorations {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
position: fixed;
|
||||||
|
top: 15px;
|
||||||
|
left: 25px;
|
||||||
|
z-index: 1000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 暗色主题
|
||||||
|
.dark .wave-bg {
|
||||||
|
background-color: color-mix(in srgb, $primary-light-9 60%, #070707);
|
||||||
|
|
||||||
|
@media only screen and (max-width: 1280px) {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.geometric-decorations {
|
||||||
|
// 月亮效果
|
||||||
|
.circle-top-right {
|
||||||
|
background-color: $bg-mix-light-8;
|
||||||
|
box-shadow: 0 0 25px #333 inset;
|
||||||
|
transition: all 0.3s ease-in-out 0.1s;
|
||||||
|
rotate: -48deg;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 15px;
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
content: '';
|
||||||
|
background-color: $bg-mix-light-9;
|
||||||
|
border-radius: 50%;
|
||||||
|
transition: all 0.3s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: transparent;
|
||||||
|
box-shadow: 0 40px 25px #ddd inset;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
left: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-bubble {
|
||||||
|
background-color: $bg-mix-light-9;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 其他元素颜色调整
|
||||||
|
.square-rotated {
|
||||||
|
background-color: $bg-mix-light-9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.circle-small,
|
||||||
|
.dot {
|
||||||
|
background-color: $primary-light-8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.square-bottom-right {
|
||||||
|
background-color: $primary-light-9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dot.dot-top-right {
|
||||||
|
background-color: $primary-light-8;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 方块组暗色调整
|
||||||
|
.squares-group {
|
||||||
|
.square {
|
||||||
|
box-shadow: none;
|
||||||
|
|
||||||
|
&.square-blue {
|
||||||
|
background-color: rgb(from $primary-base r g b / 18%);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.square-pink {
|
||||||
|
background-color: rgb(from $primary-base r g b / 10%);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.square-purple {
|
||||||
|
background-color: rgb(from $primary-base r g b / 20%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
background: linear-gradient(90deg, $primary-light-8, transparent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@ -58,8 +58,8 @@ export const themePageAnimationModeRecord: Record<UnionKey.ThemePageAnimateMode,
|
|||||||
export const themePageAnimationModeOptions = transformRecordToOption(themePageAnimationModeRecord);
|
export const themePageAnimationModeOptions = transformRecordToOption(themePageAnimationModeRecord);
|
||||||
|
|
||||||
export const resetCacheStrategyRecord: Record<UnionKey.ResetCacheStrategy, App.I18n.I18nKey> = {
|
export const resetCacheStrategyRecord: Record<UnionKey.ResetCacheStrategy, App.I18n.I18nKey> = {
|
||||||
close: 'theme.layout.resetCacheStrategy.close',
|
refresh: 'theme.layout.resetCacheStrategy.refresh',
|
||||||
refresh: 'theme.layout.resetCacheStrategy.refresh'
|
close: 'theme.layout.resetCacheStrategy.close'
|
||||||
};
|
};
|
||||||
|
|
||||||
export const resetCacheStrategyOptions = transformRecordToOption(resetCacheStrategyRecord);
|
export const resetCacheStrategyOptions = transformRecordToOption(resetCacheStrategyRecord);
|
||||||
|
@ -4,5 +4,6 @@ export enum SetupStoreId {
|
|||||||
Auth = 'auth-store',
|
Auth = 'auth-store',
|
||||||
Route = 'route-store',
|
Route = 'route-store',
|
||||||
Tab = 'tab-store',
|
Tab = 'tab-store',
|
||||||
Notice = 'notice-store'
|
Notice = 'notice-store',
|
||||||
|
Dict = 'dict-store'
|
||||||
}
|
}
|
||||||
|
@ -113,6 +113,10 @@ export function useDownload() {
|
|||||||
|
|
||||||
const response = await fetch(fullUrl, requestOptions);
|
const response = await fetch(fullUrl, requestOptions);
|
||||||
|
|
||||||
|
if (response.status !== 200) {
|
||||||
|
throw new Error(errorCodeRecord.default);
|
||||||
|
}
|
||||||
|
|
||||||
await handleResponse(response);
|
await handleResponse(response);
|
||||||
|
|
||||||
const rawHeader = response.headers.get('Download-Filename');
|
const rawHeader = response.headers.get('Download-Filename');
|
||||||
|
@ -33,7 +33,7 @@ const toGitee = () => {
|
|||||||
</NBadge>
|
</NBadge>
|
||||||
</NButton>
|
</NButton>
|
||||||
</template>
|
</template>
|
||||||
消息
|
{{ $t('page.home.message') }}
|
||||||
</NTooltip>
|
</NTooltip>
|
||||||
</template>
|
</template>
|
||||||
<NCard
|
<NCard
|
||||||
|
@ -6,6 +6,7 @@ import AppearanceSettings from './modules/appearance/index.vue';
|
|||||||
import LayoutSettings from './modules/layout/index.vue';
|
import LayoutSettings from './modules/layout/index.vue';
|
||||||
import GeneralSettings from './modules/general/index.vue';
|
import GeneralSettings from './modules/general/index.vue';
|
||||||
import ConfigOperation from './modules/config-operation.vue';
|
import ConfigOperation from './modules/config-operation.vue';
|
||||||
|
import PresetSettings from './modules/preset/index.vue';
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'ThemeDrawer'
|
name: 'ThemeDrawer'
|
||||||
@ -33,6 +34,7 @@ const drawerWidth = computed(() => {
|
|||||||
<NTab name="appearance" :tab="$t('theme.tabs.appearance')"></NTab>
|
<NTab name="appearance" :tab="$t('theme.tabs.appearance')"></NTab>
|
||||||
<NTab name="layout" :tab="$t('theme.tabs.layout')"></NTab>
|
<NTab name="layout" :tab="$t('theme.tabs.layout')"></NTab>
|
||||||
<NTab name="general" :tab="$t('theme.tabs.general')"></NTab>
|
<NTab name="general" :tab="$t('theme.tabs.general')"></NTab>
|
||||||
|
<NTab name="preset" :tab="$t('theme.tabs.preset')"></NTab>
|
||||||
</NTabs>
|
</NTabs>
|
||||||
|
|
||||||
<div class="min-h-400px">
|
<div class="min-h-400px">
|
||||||
@ -40,6 +42,7 @@ const drawerWidth = computed(() => {
|
|||||||
<AppearanceSettings v-if="activeTab === 'appearance'" />
|
<AppearanceSettings v-if="activeTab === 'appearance'" />
|
||||||
<LayoutSettings v-else-if="activeTab === 'layout'" />
|
<LayoutSettings v-else-if="activeTab === 'layout'" />
|
||||||
<GeneralSettings v-else-if="activeTab === 'general'" />
|
<GeneralSettings v-else-if="activeTab === 'general'" />
|
||||||
|
<PresetSettings v-else-if="activeTab === 'preset'" />
|
||||||
</KeepAlive>
|
</KeepAlive>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
15
src/layouts/modules/theme-drawer/modules/preset/index.vue
Normal file
15
src/layouts/modules/theme-drawer/modules/preset/index.vue
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import ThemePreset from './modules/theme-preset.vue';
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: 'PresetSettings'
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="flex-col-stretch gap-16px">
|
||||||
|
<ThemePreset />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped></style>
|
@ -0,0 +1,148 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { computed } from 'vue';
|
||||||
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
|
import { $t } from '@/locales';
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: 'ThemePreset'
|
||||||
|
});
|
||||||
|
|
||||||
|
type ThemePreset = Pick<
|
||||||
|
App.Theme.ThemeSetting,
|
||||||
|
| 'themeScheme'
|
||||||
|
| 'grayscale'
|
||||||
|
| 'colourWeakness'
|
||||||
|
| 'recommendColor'
|
||||||
|
| 'themeColor'
|
||||||
|
| 'otherColor'
|
||||||
|
| 'isInfoFollowPrimary'
|
||||||
|
| 'resetCacheStrategy'
|
||||||
|
| 'layout'
|
||||||
|
| 'page'
|
||||||
|
| 'header'
|
||||||
|
| 'tab'
|
||||||
|
| 'fixedHeaderAndTab'
|
||||||
|
| 'sider'
|
||||||
|
| 'footer'
|
||||||
|
| 'watermark'
|
||||||
|
| 'tokens'
|
||||||
|
> & {
|
||||||
|
name: string;
|
||||||
|
desc: string;
|
||||||
|
i18nkey?: string;
|
||||||
|
version: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
const presetModules = import.meta.glob('@/theme/preset/*.json', { eager: true, import: 'default' });
|
||||||
|
|
||||||
|
const themeStore = useThemeStore();
|
||||||
|
|
||||||
|
// Extract preset data
|
||||||
|
const presets = computed(() =>
|
||||||
|
Object.entries(presetModules)
|
||||||
|
.map(([path, presetData]) => {
|
||||||
|
const fileName = path.split('/').pop()?.replace('.json', '') || '';
|
||||||
|
return {
|
||||||
|
id: fileName,
|
||||||
|
...(presetData as ThemePreset)
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.sort((a, b) => {
|
||||||
|
if (a.name === 'default') return -1;
|
||||||
|
if (b.name === 'default') return 1;
|
||||||
|
return a.name.localeCompare(b.name);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
const getPresetName = (preset: ThemePreset): string => {
|
||||||
|
if (!preset.i18nkey) return preset.name;
|
||||||
|
try {
|
||||||
|
const key = `${preset.i18nkey}.name` as App.I18n.I18nKey;
|
||||||
|
const translated = $t(key);
|
||||||
|
return translated !== key ? translated : preset.name;
|
||||||
|
} catch {
|
||||||
|
return preset.name;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const getPresetDesc = (preset: ThemePreset): string => {
|
||||||
|
if (!preset.i18nkey) return preset.desc;
|
||||||
|
try {
|
||||||
|
const key = `${preset.i18nkey}.desc` as App.I18n.I18nKey;
|
||||||
|
const translated = $t(key);
|
||||||
|
return translated !== key ? translated : preset.desc;
|
||||||
|
} catch {
|
||||||
|
return preset.desc;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const applyPreset = ({ themeScheme, grayscale, colourWeakness, layout, watermark, ...rest }: ThemePreset): void => {
|
||||||
|
themeStore.setThemeScheme(themeScheme);
|
||||||
|
themeStore.setGrayscale(grayscale);
|
||||||
|
themeStore.setColourWeakness(colourWeakness);
|
||||||
|
themeStore.setThemeLayout(layout.mode);
|
||||||
|
themeStore.setWatermarkEnableUserName(watermark.enableUserName);
|
||||||
|
themeStore.setWatermarkEnableTime(watermark.enableTime);
|
||||||
|
|
||||||
|
Object.assign(themeStore, {
|
||||||
|
...rest,
|
||||||
|
layout: { ...themeStore.layout, scrollMode: layout.scrollMode },
|
||||||
|
page: { ...rest.page },
|
||||||
|
header: { ...rest.header },
|
||||||
|
tab: { ...rest.tab },
|
||||||
|
sider: { ...rest.sider },
|
||||||
|
footer: { ...rest.footer },
|
||||||
|
watermark: { ...watermark },
|
||||||
|
tokens: { ...rest.tokens }
|
||||||
|
});
|
||||||
|
|
||||||
|
window.$message?.success($t('theme.appearance.preset.applySuccess'));
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<NDivider>{{ $t('theme.appearance.preset.title') }}</NDivider>
|
||||||
|
|
||||||
|
<div class="flex flex-col gap-3">
|
||||||
|
<div
|
||||||
|
v-for="preset in presets"
|
||||||
|
:key="preset.id"
|
||||||
|
class="border border-primary/10 rounded-lg border-solid bg-white/5 p-3 backdrop-blur-10 transition-all duration-300 hover:(shadow-md -translate-y-0.5)"
|
||||||
|
>
|
||||||
|
<div class="mb-2 flex items-center justify-between">
|
||||||
|
<div class="min-w-0 w-full flex flex-1 items-center justify-between gap-2">
|
||||||
|
<h5 class="m-0 truncate text-sm text-primary font-600">
|
||||||
|
{{ getPresetName(preset) }}
|
||||||
|
</h5>
|
||||||
|
<NBadge :value="`v${preset.version}`" type="info" size="small" class="flex-shrink-0 opacity-80" />
|
||||||
|
</div>
|
||||||
|
<NButton type="primary" size="tiny" ghost round class="ml-2 flex-shrink-0" @click="applyPreset(preset)">
|
||||||
|
{{ $t('theme.appearance.preset.apply') }}
|
||||||
|
</NButton>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="line-clamp-2 mb-3 text-xs text-gray-500 leading-4">{{ getPresetDesc(preset) }}</p>
|
||||||
|
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<div class="flex gap-1">
|
||||||
|
<div
|
||||||
|
v-for="(color, key) in { primary: preset.themeColor, ...preset.otherColor }"
|
||||||
|
:key="key"
|
||||||
|
class="h-3 w-3 cursor-pointer border border-white/30 rounded-full transition-transform hover:scale-110"
|
||||||
|
:style="{ backgroundColor: color }"
|
||||||
|
:class="{ 'ring-1 ring-primary/50': key === 'primary' }"
|
||||||
|
:title="key"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center gap-1">
|
||||||
|
<div class="text-lg">
|
||||||
|
{{ preset.themeScheme === 'dark' ? '🌙' : '☀️' }}
|
||||||
|
</div>
|
||||||
|
<div class="text-lg">
|
||||||
|
{{ preset.grayscale ? '🎨' : '' }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
@ -86,7 +86,8 @@ const local: App.I18n.Schema = {
|
|||||||
tabs: {
|
tabs: {
|
||||||
appearance: 'Appearance',
|
appearance: 'Appearance',
|
||||||
layout: 'Layout',
|
layout: 'Layout',
|
||||||
general: 'General'
|
general: 'General',
|
||||||
|
preset: 'Preset'
|
||||||
},
|
},
|
||||||
appearance: {
|
appearance: {
|
||||||
themeSchema: {
|
themeSchema: {
|
||||||
@ -107,7 +108,28 @@ const local: App.I18n.Schema = {
|
|||||||
followPrimary: 'Follow Primary'
|
followPrimary: 'Follow Primary'
|
||||||
},
|
},
|
||||||
recommendColor: 'Apply Recommended Color Algorithm',
|
recommendColor: 'Apply Recommended Color Algorithm',
|
||||||
recommendColorDesc: 'The recommended color algorithm refers to'
|
recommendColorDesc: 'The recommended color algorithm refers to',
|
||||||
|
preset: {
|
||||||
|
title: 'Theme Presets',
|
||||||
|
apply: 'Apply',
|
||||||
|
applySuccess: 'Preset applied successfully',
|
||||||
|
default: {
|
||||||
|
name: 'Default Preset',
|
||||||
|
desc: 'Default theme preset with balanced settings'
|
||||||
|
},
|
||||||
|
dark: {
|
||||||
|
name: 'Dark Preset',
|
||||||
|
desc: 'Dark theme preset for night time usage'
|
||||||
|
},
|
||||||
|
compact: {
|
||||||
|
name: 'Compact Preset',
|
||||||
|
desc: 'Compact layout preset for small screens'
|
||||||
|
},
|
||||||
|
azir: {
|
||||||
|
name: "Azir's Preset",
|
||||||
|
desc: 'It is a cold and elegant preset that Azir likes'
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
layout: {
|
layout: {
|
||||||
layoutMode: {
|
layoutMode: {
|
||||||
@ -345,6 +367,8 @@ const local: App.I18n.Schema = {
|
|||||||
page: {
|
page: {
|
||||||
login: {
|
login: {
|
||||||
common: {
|
common: {
|
||||||
|
title: 'Modern enterprise-level multi-tenant management system',
|
||||||
|
subTitle: 'Provides developers with a complete enterprise management solution',
|
||||||
loginOrRegister: 'Login / Register',
|
loginOrRegister: 'Login / Register',
|
||||||
register: 'Register',
|
register: 'Register',
|
||||||
userNamePlaceholder: 'Please enter user name',
|
userNamePlaceholder: 'Please enter user name',
|
||||||
|
@ -86,7 +86,8 @@ const local: App.I18n.Schema = {
|
|||||||
tabs: {
|
tabs: {
|
||||||
appearance: '外观',
|
appearance: '外观',
|
||||||
layout: '布局',
|
layout: '布局',
|
||||||
general: '通用'
|
general: '通用',
|
||||||
|
preset: '预设'
|
||||||
},
|
},
|
||||||
appearance: {
|
appearance: {
|
||||||
themeSchema: {
|
themeSchema: {
|
||||||
@ -107,7 +108,28 @@ const local: App.I18n.Schema = {
|
|||||||
followPrimary: '跟随主色'
|
followPrimary: '跟随主色'
|
||||||
},
|
},
|
||||||
recommendColor: '应用推荐算法的颜色',
|
recommendColor: '应用推荐算法的颜色',
|
||||||
recommendColorDesc: '推荐颜色的算法参照'
|
recommendColorDesc: '推荐颜色的算法参照',
|
||||||
|
preset: {
|
||||||
|
title: '主题预设',
|
||||||
|
apply: '应用',
|
||||||
|
applySuccess: '预设应用成功',
|
||||||
|
default: {
|
||||||
|
name: '默认预设',
|
||||||
|
desc: 'Soybean 默认主题预设'
|
||||||
|
},
|
||||||
|
dark: {
|
||||||
|
name: '暗色预设',
|
||||||
|
desc: '适用于夜间使用的暗色主题预设'
|
||||||
|
},
|
||||||
|
compact: {
|
||||||
|
name: '紧凑型',
|
||||||
|
desc: '适用于小屏幕的紧凑布局预设'
|
||||||
|
},
|
||||||
|
azir: {
|
||||||
|
name: 'Azir的预设',
|
||||||
|
desc: '是 Azir 比较喜欢的莫兰迪色系冷淡风'
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
layout: {
|
layout: {
|
||||||
layoutMode: {
|
layoutMode: {
|
||||||
@ -342,6 +364,8 @@ const local: App.I18n.Schema = {
|
|||||||
page: {
|
page: {
|
||||||
login: {
|
login: {
|
||||||
common: {
|
common: {
|
||||||
|
title: '现代化的企业级多租户管理系统',
|
||||||
|
subTitle: '为开发者提供了完整的企业管理解决方案',
|
||||||
loginOrRegister: '登录 / 注册',
|
loginOrRegister: '登录 / 注册',
|
||||||
register: '注册',
|
register: '注册',
|
||||||
userNamePlaceholder: '请输入用户名',
|
userNamePlaceholder: '请输入用户名',
|
||||||
|
@ -8,7 +8,7 @@ import { decrypt, encrypt } from '@/utils/jsencrypt';
|
|||||||
import { getAuthorization, handleExpiredRequest, showErrorMsg } from './shared';
|
import { getAuthorization, handleExpiredRequest, showErrorMsg } from './shared';
|
||||||
import type { RequestInstanceState } from './type';
|
import type { RequestInstanceState } from './type';
|
||||||
|
|
||||||
const encryptHeader = 'encrypt-key';
|
const encryptHeader = import.meta.env.VITE_HEADER_FLAG || 'encrypt-key';
|
||||||
const isHttpProxy = import.meta.env.DEV && import.meta.env.VITE_HTTP_PROXY === 'Y';
|
const isHttpProxy = import.meta.env.DEV && import.meta.env.VITE_HTTP_PROXY === 'Y';
|
||||||
const { baseURL } = getServiceBaseURL(import.meta.env, isHttpProxy);
|
const { baseURL } = getServiceBaseURL(import.meta.env, isHttpProxy);
|
||||||
|
|
||||||
@ -25,23 +25,6 @@ export const request = createFlatRequest(
|
|||||||
refreshTokenPromise: null
|
refreshTokenPromise: null
|
||||||
} as RequestInstanceState,
|
} as RequestInstanceState,
|
||||||
transform(response: AxiosResponse<App.Service.Response<any>>) {
|
transform(response: AxiosResponse<App.Service.Response<any>>) {
|
||||||
if (import.meta.env.VITE_APP_ENCRYPT === 'Y') {
|
|
||||||
// 加密后的 AES 秘钥
|
|
||||||
const keyStr = response.headers[encryptHeader];
|
|
||||||
// 加密
|
|
||||||
if (keyStr && keyStr !== '') {
|
|
||||||
const data = String(response.data);
|
|
||||||
// 请求体 AES 解密
|
|
||||||
const base64Str = decrypt(keyStr);
|
|
||||||
// base64 解码 得到请求头的 AES 秘钥
|
|
||||||
const aesKey = decryptBase64(base64Str.toString());
|
|
||||||
// aesKey 解码 data
|
|
||||||
const decryptData = decryptWithAes(data, aesKey);
|
|
||||||
// 将结果 (得到的是 JSON 字符串) 转为 JSON
|
|
||||||
response.data = JSON.parse(decryptData);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 二进制数据则直接返回
|
// 二进制数据则直接返回
|
||||||
if (response.request.responseType === 'blob' || response.request.responseType === 'arraybuffer') {
|
if (response.request.responseType === 'blob' || response.request.responseType === 'arraybuffer') {
|
||||||
return response.data;
|
return response.data;
|
||||||
@ -81,6 +64,14 @@ export const request = createFlatRequest(
|
|||||||
isBackendSuccess(response) {
|
isBackendSuccess(response) {
|
||||||
// when the backend response code is "0000"(default), it means the request is success
|
// when the backend response code is "0000"(default), it means the request is success
|
||||||
// to change this logic by yourself, you can modify the `VITE_SERVICE_SUCCESS_CODE` in `.env` file
|
// to change this logic by yourself, you can modify the `VITE_SERVICE_SUCCESS_CODE` in `.env` file
|
||||||
|
if (import.meta.env.VITE_APP_ENCRYPT === 'Y' && response.headers[encryptHeader]) {
|
||||||
|
const keyStr = response.headers[encryptHeader];
|
||||||
|
const data = String(response.data);
|
||||||
|
const base64Str = decrypt(keyStr);
|
||||||
|
const aesKey = decryptBase64(base64Str.toString());
|
||||||
|
const decryptData = decryptWithAes(data, aesKey);
|
||||||
|
response.data = JSON.parse(decryptData);
|
||||||
|
}
|
||||||
return String(response.data.code) === import.meta.env.VITE_SERVICE_SUCCESS_CODE;
|
return String(response.data.code) === import.meta.env.VITE_SERVICE_SUCCESS_CODE;
|
||||||
},
|
},
|
||||||
async onBackendFail(response, instance) {
|
async onBackendFail(response, instance) {
|
||||||
|
@ -8,6 +8,7 @@ import { localStg } from '@/utils/storage';
|
|||||||
import { SetupStoreId } from '@/enum';
|
import { SetupStoreId } from '@/enum';
|
||||||
import { useRouteStore } from '../route';
|
import { useRouteStore } from '../route';
|
||||||
import { useTabStore } from '../tab';
|
import { useTabStore } from '../tab';
|
||||||
|
import useNoticeStore from '../notice';
|
||||||
import { clearAuthStorage, getToken } from './shared';
|
import { clearAuthStorage, getToken } from './shared';
|
||||||
|
|
||||||
export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
||||||
@ -15,6 +16,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
|||||||
const authStore = useAuthStore();
|
const authStore = useAuthStore();
|
||||||
const routeStore = useRouteStore();
|
const routeStore = useRouteStore();
|
||||||
const tabStore = useTabStore();
|
const tabStore = useTabStore();
|
||||||
|
const noticeStore = useNoticeStore();
|
||||||
const { toLogin, redirectFromLogin } = useRouterPush(false);
|
const { toLogin, redirectFromLogin } = useRouterPush(false);
|
||||||
const { loading: loginLoading, startLoading, endLoading } = useLoading();
|
const { loading: loginLoading, startLoading, endLoading } = useLoading();
|
||||||
|
|
||||||
@ -48,6 +50,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
|||||||
await toLogin();
|
await toLogin();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
noticeStore.clearNotice();
|
||||||
tabStore.cacheTabs();
|
tabStore.cacheTabs();
|
||||||
routeStore.resetStore();
|
routeStore.resetStore();
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { $t } from '@/locales';
|
import { $t } from '@/locales';
|
||||||
|
import { SetupStoreId } from '@/enum';
|
||||||
|
|
||||||
export const useDictStore = defineStore('dict', () => {
|
export const useDictStore = defineStore(SetupStoreId.Dict, () => {
|
||||||
const dictData = ref<{ [key: string]: Api.System.DictData[] }>({});
|
const dictData = ref<{ [key: string]: Api.System.DictData[] }>({});
|
||||||
|
|
||||||
const getDict = (key: string) => {
|
const getDict = (key: string) => {
|
||||||
|
@ -127,7 +127,7 @@ export const useRouteStore = defineStore(SetupStoreId.Route, () => {
|
|||||||
}
|
}
|
||||||
// @ts-expect-error no hidden field
|
// @ts-expect-error no hidden field
|
||||||
route.meta.hideInMenu = route.hidden;
|
route.meta.hideInMenu = route.hidden;
|
||||||
if (route.meta.hideInMenu && parent) {
|
if (route.meta.hideInMenu && parent && !route.meta.activeMenu) {
|
||||||
// @ts-expect-error parent.name is activeMenu type
|
// @ts-expect-error parent.name is activeMenu type
|
||||||
route.meta.activeMenu = parent.name;
|
route.meta.activeMenu = parent.name;
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ html,
|
|||||||
body,
|
body,
|
||||||
#app {
|
#app {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
font-family: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
html {
|
html {
|
||||||
|
90
src/theme/preset/azir.json
Normal file
90
src/theme/preset/azir.json
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
{
|
||||||
|
"name": "Azir's Preset",
|
||||||
|
"desc": "It is a cold and elegant preset that Azir likes",
|
||||||
|
"i18nkey": "theme.appearance.preset.azir",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"themeScheme": "light",
|
||||||
|
"grayscale": false,
|
||||||
|
"colourWeakness": false,
|
||||||
|
"recommendColor": true,
|
||||||
|
"themeColor": "#78a878",
|
||||||
|
"otherColor": {
|
||||||
|
"info": "#89b989",
|
||||||
|
"success": "#99c299",
|
||||||
|
"warning": "#d4bb9d",
|
||||||
|
"error": "#c49a9a"
|
||||||
|
},
|
||||||
|
"isInfoFollowPrimary": true,
|
||||||
|
"resetCacheStrategy": "refresh",
|
||||||
|
"layout": {
|
||||||
|
"mode": "vertical-mix",
|
||||||
|
"scrollMode": "wrapper"
|
||||||
|
},
|
||||||
|
"page": {
|
||||||
|
"animate": true,
|
||||||
|
"animateMode": "zoom-fade"
|
||||||
|
},
|
||||||
|
"header": {
|
||||||
|
"height": 64,
|
||||||
|
"breadcrumb": {
|
||||||
|
"visible": true,
|
||||||
|
"showIcon": true
|
||||||
|
},
|
||||||
|
"multilingual": {
|
||||||
|
"visible": true
|
||||||
|
},
|
||||||
|
"globalSearch": {
|
||||||
|
"visible": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tab": {
|
||||||
|
"visible": true,
|
||||||
|
"cache": true,
|
||||||
|
"height": 48,
|
||||||
|
"mode": "chrome"
|
||||||
|
},
|
||||||
|
"fixedHeaderAndTab": true,
|
||||||
|
"sider": {
|
||||||
|
"inverted": false,
|
||||||
|
"width": 220,
|
||||||
|
"collapsedWidth": 64,
|
||||||
|
"mixWidth": 90,
|
||||||
|
"mixCollapsedWidth": 64,
|
||||||
|
"mixChildMenuWidth": 200
|
||||||
|
},
|
||||||
|
"footer": {
|
||||||
|
"visible": true,
|
||||||
|
"fixed": true,
|
||||||
|
"height": 56,
|
||||||
|
"right": true
|
||||||
|
},
|
||||||
|
"watermark": {
|
||||||
|
"visible": false,
|
||||||
|
"text": "SoybeanAdmin",
|
||||||
|
"enableUserName": false,
|
||||||
|
"enableTime": true,
|
||||||
|
"timeFormat": "YYYY-MM-DD HH:mm:ss"
|
||||||
|
},
|
||||||
|
"tokens": {
|
||||||
|
"light": {
|
||||||
|
"colors": {
|
||||||
|
"container": "rgb(255, 255, 255)",
|
||||||
|
"layout": "rgb(247, 250, 252)",
|
||||||
|
"inverted": "rgb(0, 20, 40)",
|
||||||
|
"base-text": "rgb(31, 31, 31)"
|
||||||
|
},
|
||||||
|
"boxShadow": {
|
||||||
|
"header": "0 1px 2px rgb(0, 21, 41, 0.08)",
|
||||||
|
"sider": "2px 0 8px 0 rgb(29, 35, 41, 0.05)",
|
||||||
|
"tab": "0 1px 2px rgb(0, 21, 41, 0.08)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dark": {
|
||||||
|
"colors": {
|
||||||
|
"container": "rgb(28, 28, 28)",
|
||||||
|
"layout": "rgb(18, 18, 18)",
|
||||||
|
"base-text": "rgb(224, 224, 224)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
90
src/theme/preset/compact.json
Normal file
90
src/theme/preset/compact.json
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
{
|
||||||
|
"name": "Compact Preset",
|
||||||
|
"desc": "Compact layout preset for small screens",
|
||||||
|
"i18nkey": "theme.appearance.preset.compact",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"themeScheme": "light",
|
||||||
|
"grayscale": false,
|
||||||
|
"colourWeakness": false,
|
||||||
|
"recommendColor": false,
|
||||||
|
"themeColor": "#646cff",
|
||||||
|
"otherColor": {
|
||||||
|
"info": "#2080f0",
|
||||||
|
"success": "#52c41a",
|
||||||
|
"warning": "#faad14",
|
||||||
|
"error": "#f5222d"
|
||||||
|
},
|
||||||
|
"isInfoFollowPrimary": true,
|
||||||
|
"resetCacheStrategy": "close",
|
||||||
|
"layout": {
|
||||||
|
"mode": "vertical",
|
||||||
|
"scrollMode": "content"
|
||||||
|
},
|
||||||
|
"page": {
|
||||||
|
"animate": true,
|
||||||
|
"animateMode": "fade-slide"
|
||||||
|
},
|
||||||
|
"header": {
|
||||||
|
"height": 48,
|
||||||
|
"breadcrumb": {
|
||||||
|
"visible": true,
|
||||||
|
"showIcon": true
|
||||||
|
},
|
||||||
|
"multilingual": {
|
||||||
|
"visible": false
|
||||||
|
},
|
||||||
|
"globalSearch": {
|
||||||
|
"visible": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tab": {
|
||||||
|
"visible": true,
|
||||||
|
"cache": true,
|
||||||
|
"height": 36,
|
||||||
|
"mode": "button"
|
||||||
|
},
|
||||||
|
"fixedHeaderAndTab": true,
|
||||||
|
"sider": {
|
||||||
|
"inverted": false,
|
||||||
|
"width": 180,
|
||||||
|
"collapsedWidth": 48,
|
||||||
|
"mixWidth": 80,
|
||||||
|
"mixCollapsedWidth": 48,
|
||||||
|
"mixChildMenuWidth": 180
|
||||||
|
},
|
||||||
|
"footer": {
|
||||||
|
"visible": false,
|
||||||
|
"fixed": false,
|
||||||
|
"height": 40,
|
||||||
|
"right": true
|
||||||
|
},
|
||||||
|
"watermark": {
|
||||||
|
"visible": false,
|
||||||
|
"text": "SoybeanAdmin",
|
||||||
|
"enableUserName": false,
|
||||||
|
"enableTime": false,
|
||||||
|
"timeFormat": "YYYY-MM-DD HH:mm"
|
||||||
|
},
|
||||||
|
"tokens": {
|
||||||
|
"light": {
|
||||||
|
"colors": {
|
||||||
|
"container": "rgb(255, 255, 255)",
|
||||||
|
"layout": "rgb(247, 250, 252)",
|
||||||
|
"inverted": "rgb(0, 20, 40)",
|
||||||
|
"base-text": "rgb(31, 31, 31)"
|
||||||
|
},
|
||||||
|
"boxShadow": {
|
||||||
|
"header": "0 1px 2px rgb(0, 21, 41, 0.08)",
|
||||||
|
"sider": "2px 0 8px 0 rgb(29, 35, 41, 0.05)",
|
||||||
|
"tab": "0 1px 2px rgb(0, 21, 41, 0.08)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dark": {
|
||||||
|
"colors": {
|
||||||
|
"container": "rgb(28, 28, 28)",
|
||||||
|
"layout": "rgb(18, 18, 18)",
|
||||||
|
"base-text": "rgb(224, 224, 224)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
90
src/theme/preset/dark.json
Normal file
90
src/theme/preset/dark.json
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
{
|
||||||
|
"name": "Dark Preset",
|
||||||
|
"desc": "Dark theme preset for night time usage",
|
||||||
|
"i18nkey": "theme.appearance.preset.dark",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"themeScheme": "dark",
|
||||||
|
"grayscale": false,
|
||||||
|
"colourWeakness": false,
|
||||||
|
"recommendColor": false,
|
||||||
|
"themeColor": "#409eff",
|
||||||
|
"otherColor": {
|
||||||
|
"info": "#2080f0",
|
||||||
|
"success": "#52c41a",
|
||||||
|
"warning": "#faad14",
|
||||||
|
"error": "#f5222d"
|
||||||
|
},
|
||||||
|
"isInfoFollowPrimary": true,
|
||||||
|
"resetCacheStrategy": "close",
|
||||||
|
"layout": {
|
||||||
|
"mode": "vertical",
|
||||||
|
"scrollMode": "content"
|
||||||
|
},
|
||||||
|
"page": {
|
||||||
|
"animate": true,
|
||||||
|
"animateMode": "fade-slide"
|
||||||
|
},
|
||||||
|
"header": {
|
||||||
|
"height": 56,
|
||||||
|
"breadcrumb": {
|
||||||
|
"visible": true,
|
||||||
|
"showIcon": true
|
||||||
|
},
|
||||||
|
"multilingual": {
|
||||||
|
"visible": true
|
||||||
|
},
|
||||||
|
"globalSearch": {
|
||||||
|
"visible": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tab": {
|
||||||
|
"visible": true,
|
||||||
|
"cache": true,
|
||||||
|
"height": 44,
|
||||||
|
"mode": "chrome"
|
||||||
|
},
|
||||||
|
"fixedHeaderAndTab": true,
|
||||||
|
"sider": {
|
||||||
|
"inverted": true,
|
||||||
|
"width": 220,
|
||||||
|
"collapsedWidth": 64,
|
||||||
|
"mixWidth": 90,
|
||||||
|
"mixCollapsedWidth": 64,
|
||||||
|
"mixChildMenuWidth": 200
|
||||||
|
},
|
||||||
|
"footer": {
|
||||||
|
"visible": true,
|
||||||
|
"fixed": false,
|
||||||
|
"height": 48,
|
||||||
|
"right": true
|
||||||
|
},
|
||||||
|
"watermark": {
|
||||||
|
"visible": false,
|
||||||
|
"text": "SoybeanAdmin",
|
||||||
|
"enableUserName": false,
|
||||||
|
"enableTime": false,
|
||||||
|
"timeFormat": "YYYY-MM-DD HH:mm"
|
||||||
|
},
|
||||||
|
"tokens": {
|
||||||
|
"light": {
|
||||||
|
"colors": {
|
||||||
|
"container": "rgb(255, 255, 255)",
|
||||||
|
"layout": "rgb(247, 250, 252)",
|
||||||
|
"inverted": "rgb(0, 20, 40)",
|
||||||
|
"base-text": "rgb(31, 31, 31)"
|
||||||
|
},
|
||||||
|
"boxShadow": {
|
||||||
|
"header": "0 1px 2px rgb(0, 21, 41, 0.08)",
|
||||||
|
"sider": "2px 0 8px 0 rgb(29, 35, 41, 0.05)",
|
||||||
|
"tab": "0 1px 2px rgb(0, 21, 41, 0.08)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dark": {
|
||||||
|
"colors": {
|
||||||
|
"container": "rgb(28, 28, 28)",
|
||||||
|
"layout": "rgb(18, 18, 18)",
|
||||||
|
"base-text": "rgb(224, 224, 224)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
90
src/theme/preset/default.json
Normal file
90
src/theme/preset/default.json
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
{
|
||||||
|
"name": "default",
|
||||||
|
"desc": "Default theme preset with balanced settings",
|
||||||
|
"i18nkey": "theme.appearance.preset.default",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"themeScheme": "light",
|
||||||
|
"grayscale": false,
|
||||||
|
"colourWeakness": false,
|
||||||
|
"recommendColor": false,
|
||||||
|
"themeColor": "#646cff",
|
||||||
|
"otherColor": {
|
||||||
|
"info": "#2080f0",
|
||||||
|
"success": "#52c41a",
|
||||||
|
"warning": "#faad14",
|
||||||
|
"error": "#f5222d"
|
||||||
|
},
|
||||||
|
"isInfoFollowPrimary": true,
|
||||||
|
"resetCacheStrategy": "close",
|
||||||
|
"layout": {
|
||||||
|
"mode": "vertical",
|
||||||
|
"scrollMode": "content"
|
||||||
|
},
|
||||||
|
"page": {
|
||||||
|
"animate": true,
|
||||||
|
"animateMode": "fade-slide"
|
||||||
|
},
|
||||||
|
"header": {
|
||||||
|
"height": 56,
|
||||||
|
"breadcrumb": {
|
||||||
|
"visible": true,
|
||||||
|
"showIcon": true
|
||||||
|
},
|
||||||
|
"multilingual": {
|
||||||
|
"visible": true
|
||||||
|
},
|
||||||
|
"globalSearch": {
|
||||||
|
"visible": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tab": {
|
||||||
|
"visible": true,
|
||||||
|
"cache": true,
|
||||||
|
"height": 44,
|
||||||
|
"mode": "chrome"
|
||||||
|
},
|
||||||
|
"fixedHeaderAndTab": true,
|
||||||
|
"sider": {
|
||||||
|
"inverted": false,
|
||||||
|
"width": 220,
|
||||||
|
"collapsedWidth": 64,
|
||||||
|
"mixWidth": 90,
|
||||||
|
"mixCollapsedWidth": 64,
|
||||||
|
"mixChildMenuWidth": 200
|
||||||
|
},
|
||||||
|
"footer": {
|
||||||
|
"visible": true,
|
||||||
|
"fixed": false,
|
||||||
|
"height": 48,
|
||||||
|
"right": true
|
||||||
|
},
|
||||||
|
"watermark": {
|
||||||
|
"visible": false,
|
||||||
|
"text": "SoybeanAdmin",
|
||||||
|
"enableUserName": false,
|
||||||
|
"enableTime": false,
|
||||||
|
"timeFormat": "YYYY-MM-DD HH:mm"
|
||||||
|
},
|
||||||
|
"tokens": {
|
||||||
|
"light": {
|
||||||
|
"colors": {
|
||||||
|
"container": "rgb(255, 255, 255)",
|
||||||
|
"layout": "rgb(247, 250, 252)",
|
||||||
|
"inverted": "rgb(0, 20, 40)",
|
||||||
|
"base-text": "rgb(31, 31, 31)"
|
||||||
|
},
|
||||||
|
"boxShadow": {
|
||||||
|
"header": "0 1px 2px rgb(0, 21, 41, 0.08)",
|
||||||
|
"sider": "2px 0 8px 0 rgb(29, 35, 41, 0.05)",
|
||||||
|
"tab": "0 1px 2px rgb(0, 21, 41, 0.08)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dark": {
|
||||||
|
"colors": {
|
||||||
|
"container": "rgb(28, 28, 28)",
|
||||||
|
"layout": "rgb(18, 18, 18)",
|
||||||
|
"base-text": "rgb(224, 224, 224)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -12,7 +12,7 @@ export const themeSettings: App.Theme.ThemeSetting = {
|
|||||||
error: '#CB2634'
|
error: '#CB2634'
|
||||||
},
|
},
|
||||||
isInfoFollowPrimary: true,
|
isInfoFollowPrimary: true,
|
||||||
resetCacheStrategy: 'close',
|
resetCacheStrategy: 'refresh',
|
||||||
layout: {
|
layout: {
|
||||||
mode: 'vertical',
|
mode: 'vertical',
|
||||||
scrollMode: 'content'
|
scrollMode: 'content'
|
||||||
@ -43,7 +43,7 @@ export const themeSettings: App.Theme.ThemeSetting = {
|
|||||||
fixedHeaderAndTab: true,
|
fixedHeaderAndTab: true,
|
||||||
sider: {
|
sider: {
|
||||||
inverted: false,
|
inverted: false,
|
||||||
width: 220,
|
width: 230,
|
||||||
collapsedWidth: 64,
|
collapsedWidth: 64,
|
||||||
mixWidth: 90,
|
mixWidth: 90,
|
||||||
mixCollapsedWidth: 64,
|
mixCollapsedWidth: 64,
|
||||||
|
14
src/typings/app.d.ts
vendored
14
src/typings/app.d.ts
vendored
@ -406,6 +406,7 @@ declare namespace App {
|
|||||||
appearance: string;
|
appearance: string;
|
||||||
layout: string;
|
layout: string;
|
||||||
general: string;
|
general: string;
|
||||||
|
preset: string;
|
||||||
};
|
};
|
||||||
appearance: {
|
appearance: {
|
||||||
themeSchema: { title: string } & Record<UnionKey.ThemeScheme, string>;
|
themeSchema: { title: string } & Record<UnionKey.ThemeScheme, string>;
|
||||||
@ -417,6 +418,17 @@ declare namespace App {
|
|||||||
} & Theme.ThemeColor;
|
} & Theme.ThemeColor;
|
||||||
recommendColor: string;
|
recommendColor: string;
|
||||||
recommendColorDesc: string;
|
recommendColorDesc: string;
|
||||||
|
preset: {
|
||||||
|
title: string;
|
||||||
|
apply: string;
|
||||||
|
applySuccess: string;
|
||||||
|
[key: string]:
|
||||||
|
| {
|
||||||
|
name: string;
|
||||||
|
desc: string;
|
||||||
|
}
|
||||||
|
| string;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
layout: {
|
layout: {
|
||||||
layoutMode: { title: string } & Record<UnionKey.ThemeLayoutMode, string> & {
|
layoutMode: { title: string } & Record<UnionKey.ThemeLayoutMode, string> & {
|
||||||
@ -517,6 +529,8 @@ declare namespace App {
|
|||||||
};
|
};
|
||||||
login: {
|
login: {
|
||||||
common: {
|
common: {
|
||||||
|
title: string;
|
||||||
|
subTitle: string;
|
||||||
loginOrRegister: string;
|
loginOrRegister: string;
|
||||||
register: string;
|
register: string;
|
||||||
userNamePlaceholder: string;
|
userNamePlaceholder: string;
|
||||||
|
2
src/typings/components.d.ts
vendored
2
src/typings/components.d.ts
vendored
@ -68,6 +68,8 @@ declare module 'vue' {
|
|||||||
NCollapseItem: typeof import('naive-ui')['NCollapseItem']
|
NCollapseItem: typeof import('naive-ui')['NCollapseItem']
|
||||||
NColorPicker: typeof import('naive-ui')['NColorPicker']
|
NColorPicker: typeof import('naive-ui')['NColorPicker']
|
||||||
NDataTable: typeof import('naive-ui')['NDataTable']
|
NDataTable: typeof import('naive-ui')['NDataTable']
|
||||||
|
NDescriptions: typeof import('naive-ui')['NDescriptions']
|
||||||
|
NDescriptionsItem: typeof import('naive-ui')['NDescriptionsItem']
|
||||||
NDialogProvider: typeof import('naive-ui')['NDialogProvider']
|
NDialogProvider: typeof import('naive-ui')['NDialogProvider']
|
||||||
NDivider: typeof import('naive-ui')['NDivider']
|
NDivider: typeof import('naive-ui')['NDivider']
|
||||||
NDrawer: typeof import('naive-ui')['NDrawer']
|
NDrawer: typeof import('naive-ui')['NDrawer']
|
||||||
|
1
src/typings/vite-env.d.ts
vendored
1
src/typings/vite-env.d.ts
vendored
@ -114,6 +114,7 @@ declare namespace Env {
|
|||||||
readonly VITE_DEVTOOLS_LAUNCH_EDITOR?: import('vite-plugin-vue-devtools').VitePluginVueDevToolsOptions['launchEditor'];
|
readonly VITE_DEVTOOLS_LAUNCH_EDITOR?: import('vite-plugin-vue-devtools').VitePluginVueDevToolsOptions['launchEditor'];
|
||||||
readonly VITE_APP_CLIENT_ID?: string;
|
readonly VITE_APP_CLIENT_ID?: string;
|
||||||
readonly VITE_APP_ENCRYPT?: CommonType.YesOrNo;
|
readonly VITE_APP_ENCRYPT?: CommonType.YesOrNo;
|
||||||
|
readonly VITE_HEADER_FLAG?: string;
|
||||||
readonly VITE_APP_RSA_PUBLIC_KEY?: string;
|
readonly VITE_APP_RSA_PUBLIC_KEY?: string;
|
||||||
readonly VITE_APP_RSA_PRIVATE_KEY?: string;
|
readonly VITE_APP_RSA_PRIVATE_KEY?: string;
|
||||||
readonly VITE_APP_WEBSOCKET: CommonType.YesOrNo;
|
readonly VITE_APP_WEBSOCKET: CommonType.YesOrNo;
|
||||||
|
67
src/utils/export.ts
Normal file
67
src/utils/export.ts
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
import { utils, writeFile } from 'xlsx';
|
||||||
|
import { isNotNull } from '@/utils/common';
|
||||||
|
import { $t } from '@/locales';
|
||||||
|
|
||||||
|
export interface ExportExcelProps<T> {
|
||||||
|
columns: NaiveUI.TableColumn<T>[];
|
||||||
|
data: T[];
|
||||||
|
filename: string;
|
||||||
|
ignoreKeys?: (keyof T | (string & {}))[];
|
||||||
|
dicts?: Record<keyof T, string>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function exportExcel<T>({
|
||||||
|
columns,
|
||||||
|
data,
|
||||||
|
filename,
|
||||||
|
dicts,
|
||||||
|
ignoreKeys = ['index', 'operate']
|
||||||
|
}: ExportExcelProps<T>) {
|
||||||
|
const exportColumns = columns.filter(col => isTableColumnHasKey(col) && !ignoreKeys?.includes(col.key));
|
||||||
|
|
||||||
|
const excelList = data.map(item => exportColumns.map(col => getTableValue(col, item, dicts)));
|
||||||
|
|
||||||
|
const titleList = exportColumns.map(col => (isTableColumnHasTitle(col) && col.title) || null);
|
||||||
|
|
||||||
|
excelList.unshift(titleList);
|
||||||
|
|
||||||
|
const workBook = utils.book_new();
|
||||||
|
|
||||||
|
const workSheet = utils.aoa_to_sheet(excelList);
|
||||||
|
|
||||||
|
workSheet['!cols'] = exportColumns.map(item => ({
|
||||||
|
width: Math.round(Number(item.width) / 10 || 20)
|
||||||
|
}));
|
||||||
|
|
||||||
|
utils.book_append_sheet(workBook, workSheet, filename);
|
||||||
|
|
||||||
|
writeFile(workBook, `${filename}.xlsx`);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getTableValue<T>(col: NaiveUI.TableColumn<T>, item: T, dicts?: Record<keyof T, string>) {
|
||||||
|
if (!isTableColumnHasKey(col)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const { key } = col;
|
||||||
|
|
||||||
|
if (key === 'operate') {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isNotNull(dicts?.[key as keyof T]) && isNotNull(item[key as keyof T])) {
|
||||||
|
return $t(item[key as keyof T] as App.I18n.I18nKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
return item[key as keyof T];
|
||||||
|
}
|
||||||
|
|
||||||
|
function isTableColumnHasKey<T>(column: NaiveUI.TableColumn<T>): column is NaiveUI.TableColumnWithKey<T> {
|
||||||
|
return Boolean((column as NaiveUI.TableColumnWithKey<T>).key);
|
||||||
|
}
|
||||||
|
|
||||||
|
function isTableColumnHasTitle<T>(column: NaiveUI.TableColumn<T>): column is NaiveUI.TableColumnWithKey<T> & {
|
||||||
|
title: string;
|
||||||
|
} {
|
||||||
|
return Boolean((column as NaiveUI.TableColumnWithKey<T>).title);
|
||||||
|
}
|
@ -1,6 +1,7 @@
|
|||||||
import { watch } from 'vue';
|
import { watch } from 'vue';
|
||||||
import { useEventSource } from '@vueuse/core';
|
import { useEventSource } from '@vueuse/core';
|
||||||
import useNoticeStore from '@/store/modules/notice';
|
import useNoticeStore from '@/store/modules/notice';
|
||||||
|
import { $t } from '@/locales';
|
||||||
import { localStg } from './storage';
|
import { localStg } from './storage';
|
||||||
|
|
||||||
// 初始化
|
// 初始化
|
||||||
@ -34,9 +35,14 @@ export const initSSE = (url: any) => {
|
|||||||
read: false,
|
read: false,
|
||||||
time: new Date().toLocaleString()
|
time: new Date().toLocaleString()
|
||||||
});
|
});
|
||||||
|
let content = data.value;
|
||||||
|
const noticeType = content.match(/\[dict\.(.*?)\]/)?.[1];
|
||||||
|
if (noticeType) {
|
||||||
|
content = content.replace(`dict.${noticeType}`, $t(`dict.${noticeType}` as App.I18n.I18nKey));
|
||||||
|
}
|
||||||
window.$notification?.create({
|
window.$notification?.create({
|
||||||
title: '消息',
|
title: '消息',
|
||||||
content: data.value,
|
content,
|
||||||
type: 'success',
|
type: 'success',
|
||||||
duration: 3000
|
duration: 3000
|
||||||
});
|
});
|
||||||
|
@ -39,46 +39,69 @@ const activeModule = computed(() => moduleMap[props.module || 'pwd-login']);
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="relative min-h-screen w-full flex flex-wrap">
|
<div class="scroll box-border size-full flex">
|
||||||
<div class="hidden min-h-screen w-50% bg-primary-100 lg:block dark:bg-primary-800">
|
<div class="relative box-border hidden h-full w-65vw overflow-hidden bg-primary-50 xl:block dark:bg-primary-900">
|
||||||
<div class="size-full flex-center">
|
<div class="relative z-100 flex items-center pl-30px pt-30px">
|
||||||
<img class="w-60% sm:w-80%" :src="loginBackground" />
|
<SystemLogo class="text-32px text-primary" />
|
||||||
|
<h3 class="ml-10px text-20px font-400">{{ $t('system.title') }}</h3>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="absolute inset-x-0 inset-b-10.5% inset-t-0 z-10 m-auto w-40%">
|
||||||
|
<img class="size-full" :src="loginBackground" />
|
||||||
|
</div>
|
||||||
|
<div class="absolute bottom-80px w-full text-center">
|
||||||
|
<h1 class="text-24px font-400">{{ $t('page.login.common.title') }}</h1>
|
||||||
|
<p class="mt-8px text-14px color-gray-500">{{ $t('page.login.common.subTitle') }}</p>
|
||||||
|
</div>
|
||||||
|
<WaveBg />
|
||||||
</div>
|
</div>
|
||||||
<div class="w-full flex-col-center px-24px py-32px lg:w-50%">
|
<div class="relative h-full flex-1 xl:m-auto sm:!w-full">
|
||||||
<div class="mx-auto max-w-464px w-full">
|
<header class="flex-y-center justify-between px-30px pt-30px xl:justify-end">
|
||||||
<header class="flex-y-center justify-between">
|
<div class="relative z-100 block flex items-center xl:hidden">
|
||||||
<div class="flex-y-center gap-16px">
|
<SystemLogo class="text-32px text-primary" />
|
||||||
<SystemLogo class="text-30px text-primary sm:text-42px" />
|
<h3 class="ml-10px text-20px font-400">{{ $t('system.title') }}</h3>
|
||||||
<h3 class="text-24px text-primary font-500 sm:text-32px">{{ $t('system.title') }}</h3>
|
</div>
|
||||||
</div>
|
<div class="flex items-center justify-end">
|
||||||
<div class="flex-y-center">
|
<ThemeSchemaSwitch
|
||||||
<ThemeSchemaSwitch
|
:theme-schema="themeStore.themeScheme"
|
||||||
:theme-schema="themeStore.themeScheme"
|
:show-tooltip="false"
|
||||||
:show-tooltip="false"
|
class="text-20px lt-sm:text-18px"
|
||||||
class="text-20px lt-sm:text-18px"
|
@switch="themeStore.toggleThemeScheme"
|
||||||
@switch="themeStore.toggleThemeScheme"
|
/>
|
||||||
/>
|
<LangSwitch
|
||||||
<LangSwitch
|
v-if="themeStore.header.multilingual.visible"
|
||||||
v-if="themeStore.header.multilingual.visible"
|
:lang="appStore.locale"
|
||||||
:lang="appStore.locale"
|
:lang-options="appStore.localeOptions"
|
||||||
:lang-options="appStore.localeOptions"
|
:show-tooltip="false"
|
||||||
:show-tooltip="false"
|
class="text-20px lt-sm:text-18px"
|
||||||
class="text-20px lt-sm:text-18px"
|
@change-lang="appStore.changeLocale"
|
||||||
@change-lang="appStore.changeLocale"
|
/>
|
||||||
/>
|
</div>
|
||||||
</div>
|
</header>
|
||||||
</header>
|
<main
|
||||||
<main class="pt-24px">
|
class="m-auto mt-10% h-630px max-w-450px w-full rounded-5px bg-cover px-24px xl:absolute xl:inset-0 lg:mt-15% xl:mt-auto"
|
||||||
<div>
|
>
|
||||||
<Transition :name="themeStore.page.animateMode" mode="out-in" appear>
|
<Transition :name="themeStore.page.animateMode" mode="out-in" appear>
|
||||||
<component :is="activeModule.component" />
|
<component :is="activeModule.component" />
|
||||||
</Transition>
|
</Transition>
|
||||||
</div>
|
</main>
|
||||||
</main>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped>
|
||||||
|
.scroll {
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scroll::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scroll {
|
||||||
|
-ms-overflow-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scroll {
|
||||||
|
scrollbar-width: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@ -40,6 +40,10 @@ async function handleSubmit() {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<div class="mb-5px text-32px text-black font-600 sm:text-30px dark:text-white">
|
||||||
|
{{ $t('page.login.codeLogin.title') }}
|
||||||
|
</div>
|
||||||
|
<div class="pb-18px text-16px text-#858585">请输入您的手机号,我们将发送验证码到您的手机</div>
|
||||||
<NForm ref="formRef" :model="model" :rules="rules" size="large" :show-label="false" @keyup.enter="handleSubmit">
|
<NForm ref="formRef" :model="model" :rules="rules" size="large" :show-label="false" @keyup.enter="handleSubmit">
|
||||||
<NFormItem path="phone">
|
<NFormItem path="phone">
|
||||||
<NInput v-model:value="model.phone" :placeholder="$t('page.login.common.phonePlaceholder')" />
|
<NInput v-model:value="model.phone" :placeholder="$t('page.login.common.phonePlaceholder')" />
|
||||||
@ -52,15 +56,32 @@ async function handleSubmit() {
|
|||||||
</NButton>
|
</NButton>
|
||||||
</div>
|
</div>
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
<NSpace vertical :size="18" class="w-full">
|
<NSpace vertical :size="20" class="w-full">
|
||||||
<NButton type="primary" size="large" round block @click="handleSubmit">
|
<NButton type="primary" size="large" block @click="handleSubmit">
|
||||||
{{ $t('common.confirm') }}
|
{{ $t('page.login.codeLogin.title') }}
|
||||||
</NButton>
|
</NButton>
|
||||||
<NButton size="large" round block @click="toggleLoginModule('pwd-login')">
|
<NButton size="large" block @click="toggleLoginModule('pwd-login')">
|
||||||
{{ $t('page.login.common.back') }}
|
{{ $t('page.login.common.back') }}
|
||||||
</NButton>
|
</NButton>
|
||||||
</NSpace>
|
</NSpace>
|
||||||
</NForm>
|
</NForm>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped>
|
||||||
|
:deep(.n-base-selection),
|
||||||
|
:deep(.n-input) {
|
||||||
|
--n-height: 42px !important;
|
||||||
|
--n-font-size: 16px !important;
|
||||||
|
--n-border-radius: 8px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.n-base-selection-label) {
|
||||||
|
padding: 0 6px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.n-button) {
|
||||||
|
--n-height: 42px !important;
|
||||||
|
--n-font-size: 18px !important;
|
||||||
|
--n-border-radius: 8px !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@ -124,8 +124,8 @@ async function handleSocialLogin(type: Api.System.SocialSource) {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="mb-12px text-24px text-black font-500 sm:text-30px dark:text-white">登录到您的账户</div>
|
<div class="mb-5px text-32px text-black font-600 dark:text-white">登录到您的账户</div>
|
||||||
<div class="pb-24px text-18px text-#858585">欢迎回来!请输入您的账户信息</div>
|
<div class="pb-18px text-16px text-#858585">欢迎回来!请输入您的账户信息</div>
|
||||||
<NForm
|
<NForm
|
||||||
ref="formRef"
|
ref="formRef"
|
||||||
:model="model"
|
:model="model"
|
||||||
@ -156,16 +156,16 @@ async function handleSocialLogin(type: Api.System.SocialSource) {
|
|||||||
<NFormItem v-if="captchaEnabled" path="code">
|
<NFormItem v-if="captchaEnabled" path="code">
|
||||||
<div class="w-full flex-y-center gap-16px">
|
<div class="w-full flex-y-center gap-16px">
|
||||||
<NInput v-model:value="model.code" :placeholder="$t('page.login.common.codePlaceholder')" />
|
<NInput v-model:value="model.code" :placeholder="$t('page.login.common.codePlaceholder')" />
|
||||||
<NSpin :show="codeLoading" :size="28" class="h-52px">
|
<NSpin :show="codeLoading" :size="28" class="h-42px">
|
||||||
<NButton :focusable="false" class="login-code h-52px w-136px" @click="handleFetchCaptchaCode">
|
<NButton :focusable="false" class="login-code h-42px w-136px" @click="handleFetchCaptchaCode">
|
||||||
<img v-if="codeUrl" :src="codeUrl" />
|
<img v-if="codeUrl" :src="codeUrl" />
|
||||||
<NEmpty v-else :show-icon="false" description="暂无验证码" />
|
<NEmpty v-else :show-icon="false" description="暂无验证码" />
|
||||||
</NButton>
|
</NButton>
|
||||||
</NSpin>
|
</NSpin>
|
||||||
</div>
|
</div>
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
<NSpace vertical :size="16" class="mb-8px">
|
<NSpace vertical :size="12" class="mb-8px">
|
||||||
<div class="mx-6px mb-10px flex-y-center justify-between">
|
<div class="mx-6px mb-8px flex-y-center justify-between">
|
||||||
<NCheckbox v-model:checked="remberMe" size="large">{{ $t('page.login.pwdLogin.rememberMe') }}</NCheckbox>
|
<NCheckbox v-model:checked="remberMe" size="large">{{ $t('page.login.pwdLogin.rememberMe') }}</NCheckbox>
|
||||||
<NA type="primary" class="text-18px" @click="toggleLoginModule('reset-pwd')">
|
<NA type="primary" class="text-18px" @click="toggleLoginModule('reset-pwd')">
|
||||||
{{ $t('page.login.pwdLogin.forgetPassword') }}
|
{{ $t('page.login.pwdLogin.forgetPassword') }}
|
||||||
@ -199,7 +199,7 @@ async function handleSocialLogin(type: Api.System.SocialSource) {
|
|||||||
</NButton>
|
</NButton>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mt-32px w-full text-center text-18px text-#858585">
|
<div class="mt-24px w-full text-center text-18px text-#858585">
|
||||||
您还没有账户?
|
您还没有账户?
|
||||||
<NA type="primary" class="text-18px" @click="toggleLoginModule('register')">
|
<NA type="primary" class="text-18px" @click="toggleLoginModule('register')">
|
||||||
{{ $t('page.login.common.register') }}
|
{{ $t('page.login.common.register') }}
|
||||||
@ -216,13 +216,13 @@ async function handleSocialLogin(type: Api.System.SocialSource) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
height: 52px;
|
height: 42px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.n-base-selection),
|
:deep(.n-base-selection),
|
||||||
:deep(.n-input) {
|
:deep(.n-input) {
|
||||||
--n-height: 52px !important;
|
--n-height: 42px !important;
|
||||||
--n-font-size: 16px !important;
|
--n-font-size: 16px !important;
|
||||||
--n-border-radius: 8px !important;
|
--n-border-radius: 8px !important;
|
||||||
}
|
}
|
||||||
@ -237,7 +237,7 @@ async function handleSocialLogin(type: Api.System.SocialSource) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
:deep(.n-button) {
|
:deep(.n-button) {
|
||||||
--n-height: 52px !important;
|
--n-height: 42px !important;
|
||||||
--n-font-size: 18px !important;
|
--n-font-size: 18px !important;
|
||||||
--n-border-radius: 8px !important;
|
--n-border-radius: 8px !important;
|
||||||
}
|
}
|
||||||
|
@ -104,8 +104,8 @@ handleFetchCaptchaCode();
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="mb-12px text-24px text-black font-500 sm:text-30px dark:text-white">注册新账户</div>
|
<div class="mb-5px text-32px text-black font-600 sm:text-30px dark:text-white">注册新账户</div>
|
||||||
<div class="pb-24px text-18px text-#858585">欢迎注册!请输入您的账户信息</div>
|
<div class="pb-18px text-16px text-#858585">欢迎注册!请输入您的账户信息</div>
|
||||||
<NForm
|
<NForm
|
||||||
ref="formRef"
|
ref="formRef"
|
||||||
:model="model"
|
:model="model"
|
||||||
@ -147,14 +147,14 @@ handleFetchCaptchaCode();
|
|||||||
</NSpin>
|
</NSpin>
|
||||||
</div>
|
</div>
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
<NSpace vertical :size="18" class="w-full pt-6px">
|
<NSpace vertical :size="18" class="w-full">
|
||||||
<NButton type="primary" size="large" block :loading="registerLoading" @click="handleSubmit">
|
<NButton type="primary" size="large" block :loading="registerLoading" @click="handleSubmit">
|
||||||
{{ $t('page.login.common.register') }}
|
{{ $t('page.login.common.register') }}
|
||||||
</NButton>
|
</NButton>
|
||||||
</NSpace>
|
</NSpace>
|
||||||
</NForm>
|
</NForm>
|
||||||
|
|
||||||
<div class="mt-32px w-full text-center text-18px text-#858585">
|
<div class="mt-24px w-full text-center text-18px text-#858585">
|
||||||
您已有账户?
|
您已有账户?
|
||||||
<NA type="primary" class="text-18px" @click="toggleLoginModule('pwd-login')">
|
<NA type="primary" class="text-18px" @click="toggleLoginModule('pwd-login')">
|
||||||
{{ $t('common.login') }}
|
{{ $t('common.login') }}
|
||||||
@ -177,7 +177,7 @@ handleFetchCaptchaCode();
|
|||||||
|
|
||||||
:deep(.n-base-selection),
|
:deep(.n-base-selection),
|
||||||
:deep(.n-input) {
|
:deep(.n-input) {
|
||||||
--n-height: 52px !important;
|
--n-height: 42px !important;
|
||||||
--n-font-size: 16px !important;
|
--n-font-size: 16px !important;
|
||||||
--n-border-radius: 8px !important;
|
--n-border-radius: 8px !important;
|
||||||
}
|
}
|
||||||
@ -187,7 +187,7 @@ handleFetchCaptchaCode();
|
|||||||
}
|
}
|
||||||
|
|
||||||
:deep(.n-button) {
|
:deep(.n-button) {
|
||||||
--n-height: 52px !important;
|
--n-height: 42px !important;
|
||||||
--n-font-size: 18px !important;
|
--n-font-size: 18px !important;
|
||||||
--n-border-radius: 8px !important;
|
--n-border-radius: 8px !important;
|
||||||
}
|
}
|
||||||
|
@ -46,10 +46,10 @@ async function handleSubmit() {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="mb-12px text-24px text-black font-500 sm:text-30px dark:text-white">
|
<div class="mb-5px text-32px text-black font-600 sm:text-30px dark:text-white">
|
||||||
{{ $t('page.login.resetPwd.title') }}
|
{{ $t('page.login.resetPwd.title') }}
|
||||||
</div>
|
</div>
|
||||||
<div class="pb-24px text-18px text-#858585">请输入您的手机号,我们将发送验证码到您的手机</div>
|
<div class="pb-18px text-16px text-#858585">请输入您的手机号,我们将发送验证码到您的手机</div>
|
||||||
<NForm ref="formRef" :model="model" :rules="rules" size="large" :show-label="false" @keyup.enter="handleSubmit">
|
<NForm ref="formRef" :model="model" :rules="rules" size="large" :show-label="false" @keyup.enter="handleSubmit">
|
||||||
<NFormItem path="phone">
|
<NFormItem path="phone">
|
||||||
<NInput v-model:value="model.phone" :placeholder="$t('page.login.common.phonePlaceholder')" />
|
<NInput v-model:value="model.phone" :placeholder="$t('page.login.common.phonePlaceholder')" />
|
||||||
@ -73,7 +73,7 @@ async function handleSubmit() {
|
|||||||
:placeholder="$t('page.login.common.confirmPasswordPlaceholder')"
|
:placeholder="$t('page.login.common.confirmPasswordPlaceholder')"
|
||||||
/>
|
/>
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
<NSpace vertical :size="18" class="w-full">
|
<NSpace vertical :size="20" class="w-full">
|
||||||
<NButton type="primary" size="large" block @click="handleSubmit">
|
<NButton type="primary" size="large" block @click="handleSubmit">
|
||||||
{{ $t('page.login.resetPwd.title') }}
|
{{ $t('page.login.resetPwd.title') }}
|
||||||
</NButton>
|
</NButton>
|
||||||
@ -88,7 +88,7 @@ async function handleSubmit() {
|
|||||||
<style scoped>
|
<style scoped>
|
||||||
:deep(.n-base-selection),
|
:deep(.n-base-selection),
|
||||||
:deep(.n-input) {
|
:deep(.n-input) {
|
||||||
--n-height: 52px !important;
|
--n-height: 42px !important;
|
||||||
--n-font-size: 16px !important;
|
--n-font-size: 16px !important;
|
||||||
--n-border-radius: 8px !important;
|
--n-border-radius: 8px !important;
|
||||||
}
|
}
|
||||||
@ -98,7 +98,7 @@ async function handleSubmit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
:deep(.n-button) {
|
:deep(.n-button) {
|
||||||
--n-height: 52px !important;
|
--n-height: 42px !important;
|
||||||
--n-font-size: 18px !important;
|
--n-font-size: 18px !important;
|
||||||
--n-border-radius: 8px !important;
|
--n-border-radius: 8px !important;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user