mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-10-14 05:43:41 +08:00
Compare commits
1 Commits
tauri-v1.3
...
tauri-v1.3
Author | SHA1 | Date | |
---|---|---|---|
|
ccc1508890 |
88
CHANGELOG.md
88
CHANGELOG.md
@@ -1,94 +1,6 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
|
||||||
## [v1.3.4](https://github.com/honghuangdc/soybean-admin/compare/v1.3.3...v1.3.4) (2024-08-01)
|
|
||||||
|
|
||||||
### 🚨 Breaking Changes
|
|
||||||
|
|
||||||
- **projects**: don't reset active menu of vertical-mix layout when it is mixSiderFixed - by @honghuangdc [<samp>(939c5)</samp>](https://github.com/honghuangdc/soybean-admin/commit/939c512)
|
|
||||||
|
|
||||||
### 🛠 Optimizations
|
|
||||||
|
|
||||||
- **projects**: optimize code - by @honghuangdc [<samp>(cb1d4)</samp>](https://github.com/honghuangdc/soybean-admin/commit/cb1d445)
|
|
||||||
|
|
||||||
### 🏡 Chore
|
|
||||||
|
|
||||||
- **projects**: update deps & fix vue-router type - by @honghuangdc [<samp>(96837)</samp>](https://github.com/honghuangdc/soybean-admin/commit/968370b)
|
|
||||||
|
|
||||||
### ❤️ Contributors
|
|
||||||
|
|
||||||
[](https://github.com/honghuangdc)
|
|
||||||
|
|
||||||
## [v1.3.3](https://github.com/honghuangdc/soybean-admin/compare/v1.3.2...v1.3.3) (2024-07-30)
|
|
||||||
|
|
||||||
### 🐞 Bug Fixes
|
|
||||||
|
|
||||||
- **projects**: fix watermark settings - by @honghuangdc [<samp>(5646a)</samp>](https://github.com/honghuangdc/soybean-admin/commit/5646a50)
|
|
||||||
|
|
||||||
### 📖 Documentation
|
|
||||||
|
|
||||||
- **projects**: update CHANGELOG - by @honghuangdc [<samp>(ebc83)</samp>](https://github.com/honghuangdc/soybean-admin/commit/ebc838c)
|
|
||||||
|
|
||||||
### ❤️ Contributors
|
|
||||||
|
|
||||||
[](https://github.com/honghuangdc)
|
|
||||||
|
|
||||||
## [v1.3.2](https://github.com/honghuangdc/soybean-admin/compare/v1.3.1...v1.3.2) (2024-07-30)
|
|
||||||
|
|
||||||
### 🚀 Features
|
|
||||||
|
|
||||||
- **projects**:
|
|
||||||
- add color fading mode.close #567 - by @Azir-11 in https://github.com/honghuangdc/soybean-admin/issues/569 and https://github.com/honghuangdc/soybean-admin/issues/567 [<samp>(4dde4)</samp>](https://github.com/honghuangdc/soybean-admin/commit/4dde4c2)
|
|
||||||
- add full screen watermark. close#571 - by @paynezhuang in https://github.com/honghuangdc/soybean-admin/issues/573 and https://github.com/honghuangdc/soybean-admin/issues/571 [<samp>(ea8aa)</samp>](https://github.com/honghuangdc/soybean-admin/commit/ea8aa6c)
|
|
||||||
|
|
||||||
### 🐞 Bug Fixes
|
|
||||||
|
|
||||||
- **projects**: fix vertical-mix menu selected - by @honghuangdc [<samp>(59f07)</samp>](https://github.com/honghuangdc/soybean-admin/commit/59f07d8)
|
|
||||||
|
|
||||||
### 🛠 Optimizations
|
|
||||||
|
|
||||||
- **projects**:
|
|
||||||
- add type WatermarkProps - by @honghuangdc [<samp>(f26d0)</samp>](https://github.com/honghuangdc/soybean-admin/commit/f26d0a6)
|
|
||||||
- remove home NAlert closable - by @honghuangdc [<samp>(98b75)</samp>](https://github.com/honghuangdc/soybean-admin/commit/98b75c2)
|
|
||||||
- optimize response code comparison - by @honghuangdc [<samp>(cf67d)</samp>](https://github.com/honghuangdc/soybean-admin/commit/cf67d55)
|
|
||||||
- **types**:
|
|
||||||
- remove useless types. - by **Azir** [<samp>(eed61)</samp>](https://github.com/honghuangdc/soybean-admin/commit/eed617f)
|
|
||||||
|
|
||||||
### 📖 Documentation
|
|
||||||
|
|
||||||
- **projects**: update CHANGELOG - by @honghuangdc [<samp>(d3759)</samp>](https://github.com/honghuangdc/soybean-admin/commit/d37591d)
|
|
||||||
|
|
||||||
### 🏡 Chore
|
|
||||||
|
|
||||||
- **deps**: update deps - by @honghuangdc [<samp>(993e9)</samp>](https://github.com/honghuangdc/soybean-admin/commit/993e9ca)
|
|
||||||
|
|
||||||
### ❤️ Contributors
|
|
||||||
|
|
||||||
[](https://github.com/honghuangdc) [](https://github.com/paynezhuang) [](https://github.com/Azir-11)
|
|
||||||
[Azir](mailto:2075125282@qq.com),
|
|
||||||
|
|
||||||
## [v1.3.1](https://github.com/honghuangdc/soybean-admin/compare/v1.3.0...v1.3.1) (2024-07-22)
|
|
||||||
|
|
||||||
### 🐞 Bug Fixes
|
|
||||||
|
|
||||||
- **projects**:
|
|
||||||
- fix the issue of abnormal width of the sidebar in the top menu mix and reverse mode - by @Azir-11 in https://github.com/honghuangdc/soybean-admin/issues/562 [<samp>(c4695)</samp>](https://github.com/honghuangdc/soybean-admin/commit/c469512)
|
|
||||||
- fix HorizontalMixMenu inverted. fixed #563 - by @honghuangdc in https://github.com/honghuangdc/soybean-admin/issues/563 [<samp>(4e55b)</samp>](https://github.com/honghuangdc/soybean-admin/commit/4e55b0e)
|
|
||||||
- fix vertical-menu will not render when the layout is from mobile - by @honghuangdc [<samp>(84027)</samp>](https://github.com/honghuangdc/soybean-admin/commit/8402734)
|
|
||||||
|
|
||||||
### 📖 Documentation
|
|
||||||
|
|
||||||
- **projects**: update CHANGELOG - by @honghuangdc [<samp>(613c8)</samp>](https://github.com/honghuangdc/soybean-admin/commit/613c836)
|
|
||||||
|
|
||||||
### 🎨 Styles
|
|
||||||
|
|
||||||
- **other**: modify the Chinese name of the grayscale mode - by **Azir** [<samp>(53770)</samp>](https://github.com/honghuangdc/soybean-admin/commit/5377002)
|
|
||||||
|
|
||||||
### ❤️ Contributors
|
|
||||||
|
|
||||||
[](https://github.com/honghuangdc) [](https://github.com/Azir-11)
|
|
||||||
[Azir](mailto:2075125282@qq.com),
|
|
||||||
|
|
||||||
## [v1.3.0](https://github.com/soybeanjs/soybean-admin/compare/v1.2.8...v1.3.0) (2024-07-22)
|
## [v1.3.0](https://github.com/soybeanjs/soybean-admin/compare/v1.2.8...v1.3.0) (2024-07-22)
|
||||||
|
|
||||||
### 🚨 Breaking Changes
|
### 🚨 Breaking Changes
|
||||||
|
@@ -1,61 +1,5 @@
|
|||||||
# 更新日志
|
# 更新日志
|
||||||
|
|
||||||
## [v1.3.2](https://github.com/honghuangdc/soybean-admin/compare/v1.3.1...v1.3.2) (2024-07-30)
|
|
||||||
|
|
||||||
### 🚀 新功能
|
|
||||||
|
|
||||||
- **项目**:
|
|
||||||
- 添加颜色渐变模式。关闭 #567 - 由 @Azir-11 在 https://github.com/honghuangdc/soybean-admin/issues/569 和 https://github.com/honghuangdc/soybean-admin/issues/567 [<samp>(4dde4)</samp>](https://github.com/honghuangdc/soybean-admin/commit/4dde4c2)
|
|
||||||
- 添加全屏水印。关闭 #571 - 由 @paynezhuang 在 https://github.com/honghuangdc/soybean-admin/issues/573 和 https://github.com/honghuangdc/soybean-admin/issues/571 [<samp>(ea8aa)</samp>](https://github.com/honghuangdc/soybean-admin/commit/ea8aa6c)
|
|
||||||
|
|
||||||
### 🐞 Bug 修复
|
|
||||||
|
|
||||||
- **项目**: 修复 vertical-mix 菜单选中问题 - 由 @honghuangdc [<samp>(59f07)</samp>](https://github.com/honghuangdc/soybean-admin/commit/59f07d8)
|
|
||||||
|
|
||||||
### 🛠 优化
|
|
||||||
|
|
||||||
- **项目**:
|
|
||||||
- 添加类型 WatermarkProps - 由 @honghuangdc [<samp>(f26d0)</samp>](https://github.com/honghuangdc/soybean-admin/commit/f26d0a6)
|
|
||||||
- 移除 home NAlert 可关闭 - 由 @honghuangdc [<samp>(98b75)</samp>](https://github.com/honghuangdc/soybean-admin/commit/98b75c2)
|
|
||||||
- 优化响应代码比较 - 由 @honghuangdc [<samp>(cf67d)</samp>](https://github.com/honghuangdc/soybean-admin/commit/cf67d55)
|
|
||||||
- **类型**:
|
|
||||||
- 移除无用类型。 - 由 **Azir** [<samp>(eed61)</samp>](https://github.com/honghuangdc/soybean-admin/commit/eed617f)
|
|
||||||
|
|
||||||
### 📖 文档
|
|
||||||
|
|
||||||
- **项目**: 更新更新日志 - 由 @honghuangdc [<samp>(d3759)</samp>](https://github.com/honghuangdc/soybean-admin/commit/d37591d)
|
|
||||||
|
|
||||||
### 🏡 杂项
|
|
||||||
|
|
||||||
- **依赖**: 更新依赖 - 由 @honghuangdc [<samp>(993e9)</samp>](https://github.com/honghuangdc/soybean-admin/commit/993e9ca)
|
|
||||||
|
|
||||||
### ❤️ 贡献者
|
|
||||||
|
|
||||||
[](https://github.com/honghuangdc) [](https://github.com/paynezhuang) [](https://github.com/Azir-11)
|
|
||||||
[Azir](mailto:2075125282@qq.com),
|
|
||||||
|
|
||||||
## [v1.3.1](https://github.com/honghuangdc/soybean-admin/compare/v1.3.0...v1.3.1) (2024-07-22)
|
|
||||||
|
|
||||||
### 🐞 Bug 修复
|
|
||||||
|
|
||||||
- **项目**:
|
|
||||||
- 修复顶部菜单混合和反向模式下侧边栏宽度异常的问题 - 由 @Azir-11 在 https://github.com/honghuangdc/soybean-admin/issues/562 修复 [<samp>(c4695)</samp>](https://github.com/honghuangdc/soybean-admin/commit/c469512)
|
|
||||||
- 修复水平混合菜单反转问题。修复 #563 - 由 @honghuangdc 在 https://github.com/honghuangdc/soybean-admin/issues/563 修复 [<samp>(4e55b)</samp>](https://github.com/honghuangdc/soybean-admin/commit/4e55b0e)
|
|
||||||
- 修复当布局来自移动端时垂直菜单不渲染的问题 - 由 @honghuangdc 修复 [<samp>(84027)</samp>](https://github.com/honghuangdc/soybean-admin/commit/8402734)
|
|
||||||
|
|
||||||
### 📖 文档
|
|
||||||
|
|
||||||
- **项目**: 更新更新日志 - 由 @honghuangdc 更新 [<samp>(613c8)</samp>](https://github.com/honghuangdc/soybean-admin/commit/613c836)
|
|
||||||
|
|
||||||
### 🎨 样式
|
|
||||||
|
|
||||||
- **其他**: 修改灰度模式的中文名称 - 由 **Azir** 修改 [<samp>(53770)</samp>](https://github.com/honghuangdc/soybean-admin/commit/5377002)
|
|
||||||
|
|
||||||
### ❤️ 贡献者
|
|
||||||
|
|
||||||
[](https://github.com/honghuangdc) [](https://github.com/Azir-11)
|
|
||||||
[Azir](mailto:2075125282@qq.com),
|
|
||||||
|
|
||||||
|
|
||||||
## [v1.3.0](https://github.com/soybeanjs/soybean-admin/compare/v1.2.8...v1.3.0) (2024-07-22)
|
## [v1.3.0](https://github.com/soybeanjs/soybean-admin/compare/v1.2.8...v1.3.0) (2024-07-22)
|
||||||
|
|
||||||
|
44
package.json
44
package.json
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "soybean-admin",
|
"name": "soybean-admin",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "1.3.4",
|
"version": "1.3.0",
|
||||||
"description": "A fresh and elegant admin template, based on Vue3、Vite3、TypeScript、NaiveUI and UnoCSS. 一个基于Vue3、Vite3、TypeScript、NaiveUI and UnoCSS的清新优雅的中后台模版。",
|
"description": "A fresh and elegant admin template, based on Vue3、Vite3、TypeScript、NaiveUI and UnoCSS. 一个基于Vue3、Vite3、TypeScript、NaiveUI and UnoCSS的清新优雅的中后台模版。",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Soybean",
|
"name": "Soybean",
|
||||||
@@ -63,45 +63,45 @@
|
|||||||
"echarts": "5.5.1",
|
"echarts": "5.5.1",
|
||||||
"naive-ui": "2.39.0",
|
"naive-ui": "2.39.0",
|
||||||
"nprogress": "0.2.0",
|
"nprogress": "0.2.0",
|
||||||
"pinia": "2.2.0",
|
"pinia": "2.1.7",
|
||||||
"tailwind-merge": "2.4.0",
|
"tailwind-merge": "2.4.0",
|
||||||
"vue": "3.4.35",
|
"vue": "3.4.33",
|
||||||
"vue-draggable-plus": "0.5.2",
|
"vue-draggable-plus": "0.5.2",
|
||||||
"vue-i18n": "9.13.1",
|
"vue-i18n": "9.13.1",
|
||||||
"vue-router": "4.4.1"
|
"vue-router": "4.4.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@elegant-router/vue": "0.3.8",
|
"@elegant-router/vue": "0.3.7",
|
||||||
"@iconify/json": "2.2.232",
|
"@iconify/json": "2.2.230",
|
||||||
"@sa/scripts": "workspace:*",
|
"@sa/scripts": "workspace:*",
|
||||||
"@sa/uno-preset": "workspace:*",
|
"@sa/uno-preset": "workspace:*",
|
||||||
"@soybeanjs/eslint-config": "1.4.0",
|
"@soybeanjs/eslint-config": "1.3.7",
|
||||||
"@tauri-apps/cli": "1.6.0",
|
"@tauri-apps/cli": "1.6.0",
|
||||||
"@types/node": "22.0.1",
|
"@types/node": "20.14.11",
|
||||||
"@types/nprogress": "0.2.3",
|
"@types/nprogress": "0.2.3",
|
||||||
"@unocss/eslint-config": "0.61.9",
|
"@unocss/eslint-config": "0.61.5",
|
||||||
"@unocss/preset-icons": "0.61.9",
|
"@unocss/preset-icons": "0.61.5",
|
||||||
"@unocss/preset-uno": "0.61.9",
|
"@unocss/preset-uno": "0.61.5",
|
||||||
"@unocss/transformer-directives": "0.61.9",
|
"@unocss/transformer-directives": "0.61.5",
|
||||||
"@unocss/transformer-variant-group": "0.61.9",
|
"@unocss/transformer-variant-group": "0.61.5",
|
||||||
"@unocss/vite": "0.61.9",
|
"@unocss/vite": "0.61.5",
|
||||||
"@vitejs/plugin-vue": "5.1.1",
|
"@vitejs/plugin-vue": "5.0.5",
|
||||||
"@vitejs/plugin-vue-jsx": "4.0.0",
|
"@vitejs/plugin-vue-jsx": "4.0.0",
|
||||||
"eslint": "9.8.0",
|
"eslint": "9.7.0",
|
||||||
"eslint-plugin-vue": "9.27.0",
|
"eslint-plugin-vue": "9.27.0",
|
||||||
"lint-staged": "15.2.7",
|
"lint-staged": "15.2.7",
|
||||||
"sass": "1.77.8",
|
"sass": "1.77.8",
|
||||||
"simple-git-hooks": "2.11.1",
|
"simple-git-hooks": "2.11.1",
|
||||||
"tsx": "4.16.3",
|
"tsx": "4.16.2",
|
||||||
"typescript": "5.5.4",
|
"typescript": "5.5.3",
|
||||||
"unplugin-icons": "0.19.1",
|
"unplugin-icons": "0.19.0",
|
||||||
"unplugin-vue-components": "0.27.3",
|
"unplugin-vue-components": "0.27.3",
|
||||||
"vite": "5.3.5",
|
"vite": "5.3.4",
|
||||||
"vite-plugin-progress": "0.0.7",
|
"vite-plugin-progress": "0.0.7",
|
||||||
"vite-plugin-svg-icons": "2.0.1",
|
"vite-plugin-svg-icons": "2.0.1",
|
||||||
"vite-plugin-vue-devtools": "7.3.7",
|
"vite-plugin-vue-devtools": "7.3.6",
|
||||||
"vue-eslint-parser": "9.4.3",
|
"vue-eslint-parser": "9.4.3",
|
||||||
"vue-tsc": "2.0.29"
|
"vue-tsc": "2.0.26"
|
||||||
},
|
},
|
||||||
"simple-git-hooks": {
|
"simple-git-hooks": {
|
||||||
"commit-msg": "pnpm sa git-commit-verify",
|
"commit-msg": "pnpm sa git-commit-verify",
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/axios",
|
"name": "@sa/axios",
|
||||||
"version": "1.3.4",
|
"version": "1.3.0",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sa/utils": "workspace:*",
|
"@sa/utils": "workspace:*",
|
||||||
"axios": "1.7.2",
|
"axios": "1.7.2",
|
||||||
"axios-retry": "4.4.2",
|
"axios-retry": "4.4.1",
|
||||||
"qs": "6.12.3"
|
"qs": "6.12.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/color",
|
"name": "@sa/color",
|
||||||
"version": "1.3.4",
|
"version": "1.3.0",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/hooks",
|
"name": "@sa/hooks",
|
||||||
"version": "1.3.4",
|
"version": "1.3.0",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/materials",
|
"name": "@sa/materials",
|
||||||
"version": "1.3.4",
|
"version": "1.3.0",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/fetch",
|
"name": "@sa/fetch",
|
||||||
"version": "1.3.4",
|
"version": "1.3.0",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/scripts",
|
"name": "@sa/scripts",
|
||||||
"version": "1.3.4",
|
"version": "1.3.0",
|
||||||
"bin": {
|
"bin": {
|
||||||
"sa": "./bin.ts"
|
"sa": "./bin.ts"
|
||||||
},
|
},
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
"enquirer": "2.4.1",
|
"enquirer": "2.4.1",
|
||||||
"execa": "9.3.0",
|
"execa": "9.3.0",
|
||||||
"kolorist": "1.8.0",
|
"kolorist": "1.8.0",
|
||||||
"npm-check-updates": "17.0.0",
|
"npm-check-updates": "16.14.20",
|
||||||
"rimraf": "6.0.1"
|
"rimraf": "6.0.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/uno-preset",
|
"name": "@sa/uno-preset",
|
||||||
"version": "1.3.4",
|
"version": "1.3.0",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sa/utils",
|
"name": "@sa/utils",
|
||||||
"version": "1.3.4",
|
"version": "1.3.0",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
|
3898
pnpm-lock.yaml
generated
3898
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
18
src/App.vue
18
src/App.vue
@@ -1,7 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { NConfigProvider, darkTheme } from 'naive-ui';
|
import { NConfigProvider, darkTheme } from 'naive-ui';
|
||||||
import type { WatermarkProps } from 'naive-ui';
|
|
||||||
import { useAppStore } from './store/modules/app';
|
import { useAppStore } from './store/modules/app';
|
||||||
import { useThemeStore } from './store/modules/theme';
|
import { useThemeStore } from './store/modules/theme';
|
||||||
import { naiveDateLocales, naiveLocales } from './locales/naive';
|
import { naiveDateLocales, naiveLocales } from './locales/naive';
|
||||||
@@ -22,22 +21,6 @@ const naiveLocale = computed(() => {
|
|||||||
const naiveDateLocale = computed(() => {
|
const naiveDateLocale = computed(() => {
|
||||||
return naiveDateLocales[appStore.locale];
|
return naiveDateLocales[appStore.locale];
|
||||||
});
|
});
|
||||||
|
|
||||||
const watermarkProps = computed<WatermarkProps>(() => {
|
|
||||||
return {
|
|
||||||
content: themeStore.watermark?.text || 'SoybeanAdmin',
|
|
||||||
cross: true,
|
|
||||||
fullscreen: true,
|
|
||||||
fontSize: 16,
|
|
||||||
lineHeight: 16,
|
|
||||||
width: 384,
|
|
||||||
height: 384,
|
|
||||||
xOffset: 12,
|
|
||||||
yOffset: 60,
|
|
||||||
rotate: -15,
|
|
||||||
zIndex: 9999
|
|
||||||
};
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -50,7 +33,6 @@ const watermarkProps = computed<WatermarkProps>(() => {
|
|||||||
>
|
>
|
||||||
<AppProvider>
|
<AppProvider>
|
||||||
<RouterView class="bg-layout" />
|
<RouterView class="bg-layout" />
|
||||||
<NWatermark v-if="themeStore.watermark?.visible" v-bind="watermarkProps" />
|
|
||||||
</AppProvider>
|
</AppProvider>
|
||||||
</NConfigProvider>
|
</NConfigProvider>
|
||||||
</template>
|
</template>
|
||||||
|
@@ -85,13 +85,8 @@ function getSiderWidth() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getSiderCollapsedWidth() {
|
function getSiderCollapsedWidth() {
|
||||||
const { reverseHorizontalMix } = themeStore.layout;
|
|
||||||
const { collapsedWidth, mixCollapsedWidth, mixChildMenuWidth } = themeStore.sider;
|
const { collapsedWidth, mixCollapsedWidth, mixChildMenuWidth } = themeStore.sider;
|
||||||
|
|
||||||
if (isHorizontalMix.value && reverseHorizontalMix) {
|
|
||||||
return isActiveFirstLevelMenuHasChildren.value ? collapsedWidth : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
let w = isVerticalMix.value || isHorizontalMix.value ? mixCollapsedWidth : collapsedWidth;
|
let w = isVerticalMix.value || isHorizontalMix.value ? mixCollapsedWidth : collapsedWidth;
|
||||||
|
|
||||||
if (isVerticalMix.value && appStore.mixSiderFixed && childLevelMenus.value.length) {
|
if (isVerticalMix.value && appStore.mixSiderFixed && childLevelMenus.value.length) {
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import type { Component } from 'vue';
|
import type { Component } from 'vue';
|
||||||
import { useAppStore } from '@/store/modules/app';
|
|
||||||
import { useThemeStore } from '@/store/modules/theme';
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
import VerticalMenu from './modules/vertical-menu.vue';
|
import VerticalMenu from './modules/vertical-menu.vue';
|
||||||
import VerticalMixMenu from './modules/vertical-mix-menu.vue';
|
import VerticalMixMenu from './modules/vertical-mix-menu.vue';
|
||||||
@@ -13,7 +12,6 @@ defineOptions({
|
|||||||
name: 'GlobalMenu'
|
name: 'GlobalMenu'
|
||||||
});
|
});
|
||||||
|
|
||||||
const appStore = useAppStore();
|
|
||||||
const themeStore = useThemeStore();
|
const themeStore = useThemeStore();
|
||||||
|
|
||||||
const activeMenu = computed(() => {
|
const activeMenu = computed(() => {
|
||||||
@@ -26,12 +24,10 @@ const activeMenu = computed(() => {
|
|||||||
|
|
||||||
return menuMap[themeStore.layout.mode];
|
return menuMap[themeStore.layout.mode];
|
||||||
});
|
});
|
||||||
|
|
||||||
const reRenderVertical = computed(() => themeStore.layout.mode === 'vertical' && appStore.isMobile);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<component :is="activeMenu" :key="reRenderVertical" />
|
<component :is="activeMenu" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
@@ -18,6 +18,8 @@ const themeStore = useThemeStore();
|
|||||||
const { allMenus, childLevelMenus, activeFirstLevelMenuKey, setActiveFirstLevelMenuKey } = useMixMenuContext();
|
const { allMenus, childLevelMenus, activeFirstLevelMenuKey, setActiveFirstLevelMenuKey } = useMixMenuContext();
|
||||||
const { routerPushByKeyWithMetaQuery } = useRouterPush();
|
const { routerPushByKeyWithMetaQuery } = useRouterPush();
|
||||||
|
|
||||||
|
const inverted = computed(() => !themeStore.darkMode && themeStore.sider.inverted);
|
||||||
|
|
||||||
const selectedKey = computed(() => {
|
const selectedKey = computed(() => {
|
||||||
const { hideInMenu, activeMenu } = route.meta;
|
const { hideInMenu, activeMenu } = route.meta;
|
||||||
const name = route.name as string;
|
const name = route.name as string;
|
||||||
@@ -51,12 +53,15 @@ function handleSelectMixMenu(menu: App.Global.Menu) {
|
|||||||
<FirstLevelMenu
|
<FirstLevelMenu
|
||||||
:menus="allMenus"
|
:menus="allMenus"
|
||||||
:active-menu-key="activeFirstLevelMenuKey"
|
:active-menu-key="activeFirstLevelMenuKey"
|
||||||
|
:inverted="inverted"
|
||||||
:sider-collapse="appStore.siderCollapse"
|
:sider-collapse="appStore.siderCollapse"
|
||||||
:dark-mode="themeStore.darkMode"
|
:dark-mode="themeStore.darkMode"
|
||||||
:theme-color="themeStore.themeColor"
|
:theme-color="themeStore.themeColor"
|
||||||
@select="handleSelectMixMenu"
|
@select="handleSelectMixMenu"
|
||||||
@toggle-sider-collapse="appStore.toggleSiderCollapse"
|
@toggle-sider-collapse="appStore.toggleSiderCollapse"
|
||||||
/>
|
>
|
||||||
|
<slot></slot>
|
||||||
|
</FirstLevelMenu>
|
||||||
</Teleport>
|
</Teleport>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@@ -27,6 +27,8 @@ const {
|
|||||||
} = useMixMenuContext();
|
} = useMixMenuContext();
|
||||||
const { routerPushByKeyWithMetaQuery } = useRouterPush();
|
const { routerPushByKeyWithMetaQuery } = useRouterPush();
|
||||||
|
|
||||||
|
const inverted = computed(() => !themeStore.darkMode && themeStore.sider.inverted);
|
||||||
|
|
||||||
const selectedKey = computed(() => {
|
const selectedKey = computed(() => {
|
||||||
const { hideInMenu, activeMenu } = route.meta;
|
const { hideInMenu, activeMenu } = route.meta;
|
||||||
const name = route.name as string;
|
const name = route.name as string;
|
||||||
@@ -84,6 +86,7 @@ watch(
|
|||||||
:collapsed-width="themeStore.sider.collapsedWidth"
|
:collapsed-width="themeStore.sider.collapsedWidth"
|
||||||
:collapsed-icon-size="22"
|
:collapsed-icon-size="22"
|
||||||
:options="childLevelMenus"
|
:options="childLevelMenus"
|
||||||
|
:inverted="inverted"
|
||||||
:indent="18"
|
:indent="18"
|
||||||
@update:value="routerPushByKeyWithMetaQuery"
|
@update:value="routerPushByKeyWithMetaQuery"
|
||||||
/>
|
/>
|
||||||
|
@@ -49,11 +49,8 @@ function handleSelectMixMenu(menu: App.Global.Menu) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleResetActiveMenu() {
|
function handleResetActiveMenu() {
|
||||||
|
getActiveFirstLevelMenuKey();
|
||||||
setDrawerVisible(false);
|
setDrawerVisible(false);
|
||||||
|
|
||||||
if (!appStore.mixSiderFixed) {
|
|
||||||
getActiveFirstLevelMenuKey();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const selectedKey = computed(() => {
|
const selectedKey = computed(() => {
|
||||||
@@ -120,7 +117,6 @@ watch(
|
|||||||
<NMenu
|
<NMenu
|
||||||
v-model:expanded-keys="expandedKeys"
|
v-model:expanded-keys="expandedKeys"
|
||||||
mode="vertical"
|
mode="vertical"
|
||||||
:value="selectedKey"
|
|
||||||
:options="childLevelMenus"
|
:options="childLevelMenus"
|
||||||
:collapsed="appStore.siderCollapse"
|
:collapsed="appStore.siderCollapse"
|
||||||
:collapsed-width="themeStore.sider.collapsedWidth"
|
:collapsed-width="themeStore.sider.collapsedWidth"
|
||||||
|
@@ -25,10 +25,6 @@ function handleGrayscaleChange(value: boolean) {
|
|||||||
themeStore.setGrayscale(value);
|
themeStore.setGrayscale(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleColourWeaknessChange(value: boolean) {
|
|
||||||
themeStore.setColourWeakness(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
const showSiderInverted = computed(() => !themeStore.darkMode && themeStore.layout.mode.includes('vertical'));
|
const showSiderInverted = computed(() => !themeStore.darkMode && themeStore.layout.mode.includes('vertical'));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -57,9 +53,6 @@ const showSiderInverted = computed(() => !themeStore.darkMode && themeStore.layo
|
|||||||
<SettingItem :label="$t('theme.grayscale')">
|
<SettingItem :label="$t('theme.grayscale')">
|
||||||
<NSwitch :value="themeStore.grayscale" @update:value="handleGrayscaleChange" />
|
<NSwitch :value="themeStore.grayscale" @update:value="handleGrayscaleChange" />
|
||||||
</SettingItem>
|
</SettingItem>
|
||||||
<SettingItem :label="$t('theme.colourWeakness')">
|
|
||||||
<NSwitch :value="themeStore.colourWeakness" @update:value="handleColourWeaknessChange" />
|
|
||||||
</SettingItem>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@@ -101,19 +101,6 @@ const isWrapperScrollMode = computed(() => themeStore.layout.scrollMode === 'wra
|
|||||||
>
|
>
|
||||||
<NSwitch v-model:value="themeStore.footer.right" />
|
<NSwitch v-model:value="themeStore.footer.right" />
|
||||||
</SettingItem>
|
</SettingItem>
|
||||||
<SettingItem v-if="themeStore.watermark" key="8" :label="$t('theme.watermark.visible')">
|
|
||||||
<NSwitch v-model:value="themeStore.watermark.visible" />
|
|
||||||
</SettingItem>
|
|
||||||
<SettingItem v-if="themeStore.watermark?.visible" key="8-1" :label="$t('theme.watermark.text')">
|
|
||||||
<NInput
|
|
||||||
v-model:value="themeStore.watermark.text"
|
|
||||||
autosize
|
|
||||||
type="text"
|
|
||||||
size="small"
|
|
||||||
class="w-120px"
|
|
||||||
placeholder="SoybeanAdmin"
|
|
||||||
/>
|
|
||||||
</SettingItem>
|
|
||||||
</TransitionGroup>
|
</TransitionGroup>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@@ -65,7 +65,6 @@ const local: App.I18n.Schema = {
|
|||||||
auto: 'Follow System'
|
auto: 'Follow System'
|
||||||
},
|
},
|
||||||
grayscale: 'Grayscale',
|
grayscale: 'Grayscale',
|
||||||
colourWeakness: 'Colour Weakness',
|
|
||||||
layoutMode: {
|
layoutMode: {
|
||||||
title: 'Layout Mode',
|
title: 'Layout Mode',
|
||||||
vertical: 'Vertical Menu Mode',
|
vertical: 'Vertical Menu Mode',
|
||||||
@@ -135,10 +134,6 @@ const local: App.I18n.Schema = {
|
|||||||
height: 'Footer Height',
|
height: 'Footer Height',
|
||||||
right: 'Right Footer'
|
right: 'Right Footer'
|
||||||
},
|
},
|
||||||
watermark: {
|
|
||||||
visible: 'Watermark Full Screen Visible',
|
|
||||||
text: 'Watermark Text'
|
|
||||||
},
|
|
||||||
themeDrawerTitle: 'Theme Configuration',
|
themeDrawerTitle: 'Theme Configuration',
|
||||||
pageFunTitle: 'Page Function',
|
pageFunTitle: 'Page Function',
|
||||||
configOperation: {
|
configOperation: {
|
||||||
|
@@ -64,8 +64,7 @@ const local: App.I18n.Schema = {
|
|||||||
dark: '暗黑模式',
|
dark: '暗黑模式',
|
||||||
auto: '跟随系统'
|
auto: '跟随系统'
|
||||||
},
|
},
|
||||||
grayscale: '灰色模式',
|
grayscale: '灰度模式',
|
||||||
colourWeakness: '色弱模式',
|
|
||||||
layoutMode: {
|
layoutMode: {
|
||||||
title: '布局模式',
|
title: '布局模式',
|
||||||
vertical: '左侧菜单模式',
|
vertical: '左侧菜单模式',
|
||||||
@@ -135,10 +134,6 @@ const local: App.I18n.Schema = {
|
|||||||
height: '底部高度',
|
height: '底部高度',
|
||||||
right: '底部局右'
|
right: '底部局右'
|
||||||
},
|
},
|
||||||
watermark: {
|
|
||||||
visible: '显示全屏水印',
|
|
||||||
text: '水印文本'
|
|
||||||
},
|
|
||||||
themeDrawerTitle: '主题配置',
|
themeDrawerTitle: '主题配置',
|
||||||
pageFunTitle: '页面功能',
|
pageFunTitle: '页面功能',
|
||||||
configOperation: {
|
configOperation: {
|
||||||
|
@@ -97,13 +97,10 @@ function transformElegantRouteToVueRoute(
|
|||||||
if (component) {
|
if (component) {
|
||||||
if (isSingleLevelRoute(route)) {
|
if (isSingleLevelRoute(route)) {
|
||||||
const { layout, view } = getSingleLevelRouteComponent(component);
|
const { layout, view } = getSingleLevelRouteComponent(component);
|
||||||
|
|
||||||
const singleLevelRoute: RouteRecordRaw = {
|
const singleLevelRoute: RouteRecordRaw = {
|
||||||
path,
|
path,
|
||||||
component: layouts[layout],
|
component: layouts[layout],
|
||||||
meta: {
|
|
||||||
title: route.meta?.title || ''
|
|
||||||
},
|
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
name,
|
name,
|
||||||
@@ -113,35 +110,36 @@ function transformElegantRouteToVueRoute(
|
|||||||
} as RouteRecordRaw
|
} as RouteRecordRaw
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
return [singleLevelRoute];
|
return [singleLevelRoute];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isLayout(component)) {
|
if (isLayout(component)) {
|
||||||
const layoutName = getLayoutName(component);
|
const layoutName = getLayoutName(component);
|
||||||
|
|
||||||
vueRoute.component = layouts[layoutName];
|
vueRoute.component = layouts[layoutName];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isView(component)) {
|
if (isView(component)) {
|
||||||
const viewName = getViewName(component);
|
const viewName = getViewName(component);
|
||||||
|
|
||||||
vueRoute.component = views[viewName];
|
vueRoute.component = views[viewName];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.error(`Error transforming route "${route.name}": ${error.toString()}`);
|
console.error(`Error transforming route "${route.name}": ${error.toString()}`);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// add redirect to child
|
// add redirect to child
|
||||||
if (children?.length && !vueRoute.redirect) {
|
if (children?.length && !vueRoute.redirect) {
|
||||||
vueRoute.redirect = {
|
vueRoute.redirect = {
|
||||||
name: children[0].name
|
name: children[0].name
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (children?.length) {
|
if (children?.length) {
|
||||||
const childRoutes = children.flatMap(child => transformElegantRouteToVueRoute(child, layouts, views));
|
const childRoutes = children.flatMap(child => transformElegantRouteToVueRoute(child, layouts, views));
|
||||||
|
|
||||||
|
@@ -35,7 +35,6 @@ export const request = createFlatRequest<App.Service.Response, RequestInstanceSt
|
|||||||
},
|
},
|
||||||
async onBackendFail(response, instance) {
|
async onBackendFail(response, instance) {
|
||||||
const authStore = useAuthStore();
|
const authStore = useAuthStore();
|
||||||
const responseCode = String(response.data.code);
|
|
||||||
|
|
||||||
function handleLogout() {
|
function handleLogout() {
|
||||||
authStore.resetStore();
|
authStore.resetStore();
|
||||||
@@ -50,14 +49,14 @@ export const request = createFlatRequest<App.Service.Response, RequestInstanceSt
|
|||||||
|
|
||||||
// when the backend response code is in `logoutCodes`, it means the user will be logged out and redirected to login page
|
// when the backend response code is in `logoutCodes`, it means the user will be logged out and redirected to login page
|
||||||
const logoutCodes = import.meta.env.VITE_SERVICE_LOGOUT_CODES?.split(',') || [];
|
const logoutCodes = import.meta.env.VITE_SERVICE_LOGOUT_CODES?.split(',') || [];
|
||||||
if (logoutCodes.includes(responseCode)) {
|
if (logoutCodes.includes(response.data.code)) {
|
||||||
handleLogout();
|
handleLogout();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// when the backend response code is in `modalLogoutCodes`, it means the user will be logged out by displaying a modal
|
// when the backend response code is in `modalLogoutCodes`, it means the user will be logged out by displaying a modal
|
||||||
const modalLogoutCodes = import.meta.env.VITE_SERVICE_MODAL_LOGOUT_CODES?.split(',') || [];
|
const modalLogoutCodes = import.meta.env.VITE_SERVICE_MODAL_LOGOUT_CODES?.split(',') || [];
|
||||||
if (modalLogoutCodes.includes(responseCode) && !request.state.errMsgStack?.includes(response.data.msg)) {
|
if (modalLogoutCodes.includes(response.data.code) && !request.state.errMsgStack?.includes(response.data.msg)) {
|
||||||
request.state.errMsgStack = [...(request.state.errMsgStack || []), response.data.msg];
|
request.state.errMsgStack = [...(request.state.errMsgStack || []), response.data.msg];
|
||||||
|
|
||||||
// prevent the user from refreshing the page
|
// prevent the user from refreshing the page
|
||||||
@@ -83,7 +82,7 @@ export const request = createFlatRequest<App.Service.Response, RequestInstanceSt
|
|||||||
// when the backend response code is in `expiredTokenCodes`, it means the token is expired, and refresh token
|
// when the backend response code is in `expiredTokenCodes`, it means the token is expired, and refresh token
|
||||||
// the api `refreshToken` can not return error code in `expiredTokenCodes`, otherwise it will be a dead loop, should return `logoutCodes` or `modalLogoutCodes`
|
// the api `refreshToken` can not return error code in `expiredTokenCodes`, otherwise it will be a dead loop, should return `logoutCodes` or `modalLogoutCodes`
|
||||||
const expiredTokenCodes = import.meta.env.VITE_SERVICE_EXPIRED_TOKEN_CODES?.split(',') || [];
|
const expiredTokenCodes = import.meta.env.VITE_SERVICE_EXPIRED_TOKEN_CODES?.split(',') || [];
|
||||||
if (expiredTokenCodes.includes(responseCode) && !request.state.isRefreshingToken) {
|
if (expiredTokenCodes.includes(response.data.code) && !request.state.isRefreshingToken) {
|
||||||
request.state.isRefreshingToken = true;
|
request.state.isRefreshingToken = true;
|
||||||
|
|
||||||
const refreshConfig = await handleRefreshToken(response.config);
|
const refreshConfig = await handleRefreshToken(response.config);
|
||||||
@@ -109,7 +108,7 @@ export const request = createFlatRequest<App.Service.Response, RequestInstanceSt
|
|||||||
// get backend error message and code
|
// get backend error message and code
|
||||||
if (error.code === BACKEND_ERROR_CODE) {
|
if (error.code === BACKEND_ERROR_CODE) {
|
||||||
message = error.response?.data?.msg || message;
|
message = error.response?.data?.msg || message;
|
||||||
backendErrorCode = String(error.response?.data?.code || '');
|
backendErrorCode = error.response?.data?.code || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// the error message is displayed in the modal
|
// the error message is displayed in the modal
|
||||||
|
@@ -10,8 +10,8 @@ import {
|
|||||||
createThemeToken,
|
createThemeToken,
|
||||||
getNaiveTheme,
|
getNaiveTheme,
|
||||||
initThemeSettings,
|
initThemeSettings,
|
||||||
toggleAuxiliaryColorModes,
|
toggleCssDarkMode,
|
||||||
toggleCssDarkMode
|
toggleGrayscaleMode
|
||||||
} from './shared';
|
} from './shared';
|
||||||
|
|
||||||
/** Theme store */
|
/** Theme store */
|
||||||
@@ -33,9 +33,6 @@ export const useThemeStore = defineStore(SetupStoreId.Theme, () => {
|
|||||||
/** grayscale mode */
|
/** grayscale mode */
|
||||||
const grayscaleMode = computed(() => settings.value.grayscale);
|
const grayscaleMode = computed(() => settings.value.grayscale);
|
||||||
|
|
||||||
/** colourWeakness mode */
|
|
||||||
const colourWeaknessMode = computed(() => settings.value.colourWeakness);
|
|
||||||
|
|
||||||
/** Theme colors */
|
/** Theme colors */
|
||||||
const themeColors = computed(() => {
|
const themeColors = computed(() => {
|
||||||
const { themeColor, otherColor, isInfoFollowPrimary } = settings.value;
|
const { themeColor, otherColor, isInfoFollowPrimary } = settings.value;
|
||||||
@@ -82,15 +79,6 @@ export const useThemeStore = defineStore(SetupStoreId.Theme, () => {
|
|||||||
settings.value.grayscale = isGrayscale;
|
settings.value.grayscale = isGrayscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set colourWeakness value
|
|
||||||
*
|
|
||||||
* @param isColourWeakness
|
|
||||||
*/
|
|
||||||
function setColourWeakness(isColourWeakness: boolean) {
|
|
||||||
settings.value.colourWeakness = isColourWeakness;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Toggle theme scheme */
|
/** Toggle theme scheme */
|
||||||
function toggleThemeScheme() {
|
function toggleThemeScheme() {
|
||||||
const themeSchemes: UnionKey.ThemeScheme[] = ['light', 'dark', 'auto'];
|
const themeSchemes: UnionKey.ThemeScheme[] = ['light', 'dark', 'auto'];
|
||||||
@@ -179,9 +167,9 @@ export const useThemeStore = defineStore(SetupStoreId.Theme, () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
[grayscaleMode, colourWeaknessMode],
|
grayscaleMode,
|
||||||
val => {
|
val => {
|
||||||
toggleAuxiliaryColorModes(val[0], val[1]);
|
toggleGrayscaleMode(val);
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
@@ -209,7 +197,6 @@ export const useThemeStore = defineStore(SetupStoreId.Theme, () => {
|
|||||||
naiveTheme,
|
naiveTheme,
|
||||||
settingsJson,
|
settingsJson,
|
||||||
setGrayscale,
|
setGrayscale,
|
||||||
setColourWeakness,
|
|
||||||
resetStore,
|
resetStore,
|
||||||
setThemeScheme,
|
setThemeScheme,
|
||||||
toggleThemeScheme,
|
toggleThemeScheme,
|
||||||
|
@@ -180,16 +180,20 @@ export function toggleCssDarkMode(darkMode = false) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggle auxiliary color modes
|
* Toggle grayscale mode
|
||||||
*
|
*
|
||||||
* @param grayscaleMode
|
* @param grayscaleMode Is grayscale mode
|
||||||
* @param colourWeakness
|
|
||||||
*/
|
*/
|
||||||
export function toggleAuxiliaryColorModes(grayscaleMode = false, colourWeakness = false) {
|
export function toggleGrayscaleMode(grayscaleMode = false) {
|
||||||
const htmlElement = document.documentElement;
|
const GRAYSCALE_CLASS = 'grayscale';
|
||||||
htmlElement.style.filter = [grayscaleMode ? 'grayscale(100%)' : '', colourWeakness ? 'invert(80%)' : '']
|
|
||||||
.filter(Boolean)
|
const { add, remove } = toggleHtmlClass(GRAYSCALE_CLASS);
|
||||||
.join(' ');
|
|
||||||
|
if (grayscaleMode) {
|
||||||
|
add();
|
||||||
|
} else {
|
||||||
|
remove();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type NaiveColorScene = '' | 'Suppl' | 'Hover' | 'Pressed' | 'Active';
|
type NaiveColorScene = '' | 'Suppl' | 'Hover' | 'Pressed' | 'Active';
|
||||||
|
@@ -11,3 +11,7 @@ body,
|
|||||||
html {
|
html {
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
html.grayscale {
|
||||||
|
filter: grayscale(100%);
|
||||||
|
}
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
export const themeSettings: App.Theme.ThemeSetting = {
|
export const themeSettings: App.Theme.ThemeSetting = {
|
||||||
themeScheme: 'light',
|
themeScheme: 'light',
|
||||||
grayscale: false,
|
grayscale: false,
|
||||||
colourWeakness: false,
|
|
||||||
recommendColor: false,
|
recommendColor: false,
|
||||||
themeColor: '#646cff',
|
themeColor: '#646cff',
|
||||||
otherColor: {
|
otherColor: {
|
||||||
@@ -49,10 +48,6 @@ export const themeSettings: App.Theme.ThemeSetting = {
|
|||||||
height: 48,
|
height: 48,
|
||||||
right: true
|
right: true
|
||||||
},
|
},
|
||||||
watermark: {
|
|
||||||
visible: false,
|
|
||||||
text: 'SoybeanAdmin'
|
|
||||||
},
|
|
||||||
tokens: {
|
tokens: {
|
||||||
light: {
|
light: {
|
||||||
colors: {
|
colors: {
|
||||||
|
138
src/typings/api.d.ts
vendored
138
src/typings/api.d.ts
vendored
@@ -81,4 +81,142 @@ declare namespace Api {
|
|||||||
home: import('@elegant-router/types').LastLevelRouteKey;
|
home: import('@elegant-router/types').LastLevelRouteKey;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* namespace SystemManage
|
||||||
|
*
|
||||||
|
* backend api module: "systemManage"
|
||||||
|
*/
|
||||||
|
namespace SystemManage {
|
||||||
|
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'current' | 'size'>;
|
||||||
|
|
||||||
|
/** role */
|
||||||
|
type Role = Common.CommonRecord<{
|
||||||
|
/** role name */
|
||||||
|
roleName: string;
|
||||||
|
/** role code */
|
||||||
|
roleCode: string;
|
||||||
|
/** role description */
|
||||||
|
roleDesc: string;
|
||||||
|
}>;
|
||||||
|
|
||||||
|
/** role search params */
|
||||||
|
type RoleSearchParams = CommonType.RecordNullable<
|
||||||
|
Pick<Api.SystemManage.Role, 'roleName' | 'roleCode' | 'status'> & CommonSearchParams
|
||||||
|
>;
|
||||||
|
|
||||||
|
/** role list */
|
||||||
|
type RoleList = Common.PaginatingQueryRecord<Role>;
|
||||||
|
|
||||||
|
/** all role */
|
||||||
|
type AllRole = Pick<Role, 'id' | 'roleName' | 'roleCode'>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* user gender
|
||||||
|
*
|
||||||
|
* - "1": "male"
|
||||||
|
* - "2": "female"
|
||||||
|
*/
|
||||||
|
type UserGender = '1' | '2';
|
||||||
|
|
||||||
|
/** user */
|
||||||
|
type User = Common.CommonRecord<{
|
||||||
|
/** user name */
|
||||||
|
userName: string;
|
||||||
|
/** user gender */
|
||||||
|
userGender: UserGender | null;
|
||||||
|
/** user nick name */
|
||||||
|
nickName: string;
|
||||||
|
/** user phone */
|
||||||
|
userPhone: string;
|
||||||
|
/** user email */
|
||||||
|
userEmail: string;
|
||||||
|
/** user role code collection */
|
||||||
|
userRoles: string[];
|
||||||
|
}>;
|
||||||
|
|
||||||
|
/** user search params */
|
||||||
|
type UserSearchParams = CommonType.RecordNullable<
|
||||||
|
Pick<Api.SystemManage.User, 'userName' | 'userGender' | 'nickName' | 'userPhone' | 'userEmail' | 'status'> &
|
||||||
|
CommonSearchParams
|
||||||
|
>;
|
||||||
|
|
||||||
|
/** user list */
|
||||||
|
type UserList = Common.PaginatingQueryRecord<User>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* menu type
|
||||||
|
*
|
||||||
|
* - "1": directory
|
||||||
|
* - "2": menu
|
||||||
|
*/
|
||||||
|
type MenuType = '1' | '2';
|
||||||
|
|
||||||
|
type MenuButton = {
|
||||||
|
/**
|
||||||
|
* button code
|
||||||
|
*
|
||||||
|
* it can be used to control the button permission
|
||||||
|
*/
|
||||||
|
code: string;
|
||||||
|
/** button description */
|
||||||
|
desc: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* icon type
|
||||||
|
*
|
||||||
|
* - "1": iconify icon
|
||||||
|
* - "2": local icon
|
||||||
|
*/
|
||||||
|
type IconType = '1' | '2';
|
||||||
|
|
||||||
|
type MenuPropsOfRoute = Pick<
|
||||||
|
import('vue-router').RouteMeta,
|
||||||
|
| 'i18nKey'
|
||||||
|
| 'keepAlive'
|
||||||
|
| 'constant'
|
||||||
|
| 'order'
|
||||||
|
| 'href'
|
||||||
|
| 'hideInMenu'
|
||||||
|
| 'activeMenu'
|
||||||
|
| 'multiTab'
|
||||||
|
| 'fixedIndexInTab'
|
||||||
|
| 'query'
|
||||||
|
>;
|
||||||
|
|
||||||
|
type Menu = Common.CommonRecord<{
|
||||||
|
/** parent menu id */
|
||||||
|
parentId: number;
|
||||||
|
/** menu type */
|
||||||
|
menuType: MenuType;
|
||||||
|
/** menu name */
|
||||||
|
menuName: string;
|
||||||
|
/** route name */
|
||||||
|
routeName: string;
|
||||||
|
/** route path */
|
||||||
|
routePath: string;
|
||||||
|
/** component */
|
||||||
|
component?: string;
|
||||||
|
/** iconify icon name or local icon name */
|
||||||
|
icon: string;
|
||||||
|
/** icon type */
|
||||||
|
iconType: IconType;
|
||||||
|
/** buttons */
|
||||||
|
buttons?: MenuButton[] | null;
|
||||||
|
/** children menu */
|
||||||
|
children?: Menu[] | null;
|
||||||
|
}> &
|
||||||
|
MenuPropsOfRoute;
|
||||||
|
|
||||||
|
/** menu list */
|
||||||
|
type MenuList = Common.PaginatingQueryRecord<Menu>;
|
||||||
|
|
||||||
|
type MenuTree = {
|
||||||
|
id: number;
|
||||||
|
label: string;
|
||||||
|
pId: number;
|
||||||
|
children?: MenuTree[];
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
14
src/typings/app.d.ts
vendored
14
src/typings/app.d.ts
vendored
@@ -10,8 +10,6 @@ declare namespace App {
|
|||||||
themeScheme: UnionKey.ThemeScheme;
|
themeScheme: UnionKey.ThemeScheme;
|
||||||
/** grayscale mode */
|
/** grayscale mode */
|
||||||
grayscale: boolean;
|
grayscale: boolean;
|
||||||
/** colour weakness mode */
|
|
||||||
colourWeakness: boolean;
|
|
||||||
/** Whether to recommend color */
|
/** Whether to recommend color */
|
||||||
recommendColor: boolean;
|
recommendColor: boolean;
|
||||||
/** Theme color */
|
/** Theme color */
|
||||||
@@ -95,13 +93,6 @@ declare namespace App {
|
|||||||
/** Whether float the footer to the right when the layout is 'horizontal-mix' */
|
/** Whether float the footer to the right when the layout is 'horizontal-mix' */
|
||||||
right: boolean;
|
right: boolean;
|
||||||
};
|
};
|
||||||
/** Watermark */
|
|
||||||
watermark?: {
|
|
||||||
/** Whether to show the watermark */
|
|
||||||
visible: boolean;
|
|
||||||
/** Watermark text */
|
|
||||||
text: string;
|
|
||||||
};
|
|
||||||
/** define some theme settings tokens, will transform to css variables */
|
/** define some theme settings tokens, will transform to css variables */
|
||||||
tokens: {
|
tokens: {
|
||||||
light: ThemeSettingToken;
|
light: ThemeSettingToken;
|
||||||
@@ -341,7 +332,6 @@ declare namespace App {
|
|||||||
theme: {
|
theme: {
|
||||||
themeSchema: { title: string } & Record<UnionKey.ThemeScheme, string>;
|
themeSchema: { title: string } & Record<UnionKey.ThemeScheme, string>;
|
||||||
grayscale: string;
|
grayscale: string;
|
||||||
colourWeakness: string;
|
|
||||||
layoutMode: { title: string; reverseHorizontalMix: string } & Record<UnionKey.ThemeLayoutMode, string>;
|
layoutMode: { title: string; reverseHorizontalMix: string } & Record<UnionKey.ThemeLayoutMode, string>;
|
||||||
recommendColor: string;
|
recommendColor: string;
|
||||||
recommendColorDesc: string;
|
recommendColorDesc: string;
|
||||||
@@ -382,10 +372,6 @@ declare namespace App {
|
|||||||
height: string;
|
height: string;
|
||||||
right: string;
|
right: string;
|
||||||
};
|
};
|
||||||
watermark: {
|
|
||||||
visible: string;
|
|
||||||
text: string;
|
|
||||||
};
|
|
||||||
themeDrawerTitle: string;
|
themeDrawerTitle: string;
|
||||||
pageFunTitle: string;
|
pageFunTitle: string;
|
||||||
configOperation: {
|
configOperation: {
|
||||||
|
1
src/typings/components.d.ts
vendored
1
src/typings/components.d.ts
vendored
@@ -84,7 +84,6 @@ declare module 'vue' {
|
|||||||
NThing: typeof import('naive-ui')['NThing']
|
NThing: typeof import('naive-ui')['NThing']
|
||||||
NTooltip: typeof import('naive-ui')['NTooltip']
|
NTooltip: typeof import('naive-ui')['NTooltip']
|
||||||
NTree: typeof import('naive-ui')['NTree']
|
NTree: typeof import('naive-ui')['NTree']
|
||||||
NWatermark: typeof import('naive-ui')['NWatermark']
|
|
||||||
PinToggler: typeof import('./../components/common/pin-toggler.vue')['default']
|
PinToggler: typeof import('./../components/common/pin-toggler.vue')['default']
|
||||||
ReloadButton: typeof import('./../components/common/reload-button.vue')['default']
|
ReloadButton: typeof import('./../components/common/reload-button.vue')['default']
|
||||||
RouterLink: typeof import('vue-router')['RouterLink']
|
RouterLink: typeof import('vue-router')['RouterLink']
|
||||||
|
4
src/typings/elegant-router.d.ts
vendored
4
src/typings/elegant-router.d.ts
vendored
@@ -37,7 +37,7 @@ declare module "@elegant-router/types" {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* custom route key
|
* custom route key
|
||||||
*/
|
*/
|
||||||
export type CustomRouteKey = Extract<
|
export type CustomRouteKey = Extract<
|
||||||
RouteKey,
|
RouteKey,
|
||||||
| "root"
|
| "root"
|
||||||
@@ -46,7 +46,7 @@ declare module "@elegant-router/types" {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* the generated route key
|
* the generated route key
|
||||||
*/
|
*/
|
||||||
export type GeneratedRouteKey = Exclude<RouteKey, CustomRouteKey>;
|
export type GeneratedRouteKey = Exclude<RouteKey, CustomRouteKey>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -15,7 +15,7 @@ const gap = computed(() => (appStore.isMobile ? 0 : 16));
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<NSpace vertical :size="16">
|
<NSpace vertical :size="16">
|
||||||
<NAlert :title="$t('common.warning')" type="warning">
|
<NAlert :title="$t('common.warning')" type="warning" closable>
|
||||||
{{ $t('page.home.branchDesc') }}
|
{{ $t('page.home.branchDesc') }}
|
||||||
</NAlert>
|
</NAlert>
|
||||||
<HeaderBanner />
|
<HeaderBanner />
|
||||||
|
Reference in New Issue
Block a user