mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-10-24 02:23:41 +08:00
Compare commits
31 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
de2829fde7 | ||
|
c1bee4046c | ||
|
473095b01b | ||
|
e6abf93457 | ||
|
882f281482 | ||
|
0b2f68ac04 | ||
|
2ca2b766f8 | ||
|
da611fb10b | ||
|
eb8e49e23c | ||
|
0907d38c06 | ||
|
2a9b725c6a | ||
|
8f24a94ed3 | ||
|
4eefc95baa | ||
|
1681c34a52 | ||
|
47ab0184b7 | ||
|
58591f660a | ||
|
3c7e1cf442 | ||
|
055d4cce33 | ||
|
a3dfe61a7b | ||
|
f9d47c081f | ||
|
ff5bf62989 | ||
|
1f6d079644 | ||
|
5c085a1986 | ||
|
9a23817473 | ||
|
56ea8937f6 | ||
|
4f51263501 | ||
|
bb2eab60f4 | ||
|
44e4c04811 | ||
|
b5839eab26 | ||
|
780ac75bf6 | ||
|
a252138594 |
@@ -1 +1,2 @@
|
|||||||
VITE_HTTP_PROXY=Y
|
VITE_HTTP_PROXY=Y
|
||||||
|
VITE_SOYBEAN_ROUTE_PLUGIN=Y
|
||||||
|
8
.vscode/launch.json
vendored
8
.vscode/launch.json
vendored
@@ -7,6 +7,14 @@
|
|||||||
"name": "Vue debugger",
|
"name": "Vue debugger",
|
||||||
"url": "http://localhost:3200",
|
"url": "http://localhost:3200",
|
||||||
"webRoot": "${workspaceFolder}"
|
"webRoot": "${workspaceFolder}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "TS debugger",
|
||||||
|
"skipFiles": ["<node_internals>/**"],
|
||||||
|
"runtimeArgs": ["--loader", "tsx"],
|
||||||
|
"program": "${relativeFile}"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
1313
CHANGELOG.md
1313
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
53
README.md
53
README.md
@@ -19,6 +19,19 @@
|
|||||||
- **权限路由**:提供前端静态和后端动态两种路由模式,基于 mock 的动态路由能快速实现后端动态路由
|
- **权限路由**:提供前端静态和后端动态两种路由模式,基于 mock 的动态路由能快速实现后端动态路由
|
||||||
- **请求函数**:基于 axios 的完善的请求函数封装,提供 Promise 和 hooks 两种请求函数,加入请求结果数据转换的适配器
|
- **请求函数**:基于 axios 的完善的请求函数封装,提供 Promise 和 hooks 两种请求函数,加入请求结果数据转换的适配器
|
||||||
|
|
||||||
|
## SoybeanJS 工具库
|
||||||
|
|
||||||
|
- [@soybeanjs/cli](https://github.com/soybeanjs/cli): SoybeanJS 命令行工具,包含发布、git 和依赖等相关的实用命令
|
||||||
|
- [@soybeanjs/changelog](https://github.com/soybeanjs/changelog): 根据 git tags 和 commits 生成 changelog [示例](./CHANGELOG.md)
|
||||||
|
- [eslint-config-soybeanjs](https://github.com/soybeanjs/eslint-config): SoybeanJS 的 eslint 预设配置
|
||||||
|
- [@soybeanjs/materials](https://github.com/soybeanjs/materials): SoybeanJS 的物料仓库
|
||||||
|
- [@soybeanjs/vite-plugin-vue-page-route](https://github.com/soybeanjs/vite-plugin-vue-page-route): SoybeanAdmin 的路由插件
|
||||||
|
|
||||||
|
## 基于 SoybeanAdmin 二次开发的项目
|
||||||
|
|
||||||
|
- [electron-mock-admin](https://github.com/lixin59/electron-mock-api): 一个 Mock Api 管理系统,帮助前端开发伙伴快速实现接口的 mock。
|
||||||
|
- [T-Shell](https://github.com/TheBlindM/T-Shell): 是一个可配置命令提示的终端模拟器和 SSH 客户端。
|
||||||
|
|
||||||
## 在线预览
|
## 在线预览
|
||||||
|
|
||||||
- [Soybean Admin 预览地址](https://soybean.pro/)
|
- [Soybean Admin 预览地址](https://soybean.pro/)
|
||||||
@@ -29,14 +42,12 @@
|
|||||||
|
|
||||||
## 代码仓库
|
## 代码仓库
|
||||||
|
|
||||||
| 仓库 | github地址 | gitee镜像 | 预览 |
|
| 仓库 | github 地址 | gitee 镜像 | 预览 |
|
||||||
|---------------|-----------------------------------------------------------------------------|---------------------------------------------------------------------------|--------------|
|
| -------------- | ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | --------------------------------------------------------- |
|
||||||
| soybean-admin | [github](https://github.com/honghuangdc/soybean-admin) | [gitee](https://gitee.com/honghuangdc/soybean-admin) | [预览](https://soybean.pro/) |
|
| soybean-admin | [github](https://github.com/honghuangdc/soybean-admin) | [gitee](https://gitee.com/honghuangdc/soybean-admin) | [预览](https://soybean.pro/) |
|
||||||
| tauri 版 | [tauri 版](https://github.com/honghuangdc/soybean-admin/tree/tauri) | [tauri 版](https://gitee.com/honghuangdc/soybean-admin/tree/tauri) | |
|
| tauri 版 | [tauri 版](https://github.com/honghuangdc/soybean-admin/tree/tauri) | [tauri 版](https://gitee.com/honghuangdc/soybean-admin/tree/tauri) | |
|
||||||
| 精简版 | [精简版](https://github.com/honghuangdc/soybean-admin/tree/thin) | [精简版](https://gitee.com/honghuangdc/soybean-admin/tree/thin) | |
|
| 精简版 | [精简版](https://github.com/honghuangdc/soybean-admin/tree/thin) | [精简版](https://gitee.com/honghuangdc/soybean-admin/tree/thin) | |
|
||||||
| 集成fast-crud | [集成fast-crud](https://github.com/honghuangdc/soybean-admin/tree/fast-crud) | [集成fast-crud](https://gitee.com/honghuangdc/soybean-admin/tree/fast-crud) | [预览](http://fast-crud.docmirror.cn/soybean/#/crud/demo)|
|
| 集成 fast-crud | [集成 fast-crud](https://github.com/honghuangdc/soybean-admin/tree/fast-crud) | [集成 fast-crud](https://gitee.com/honghuangdc/soybean-admin/tree/fast-crud) | [预览](http://fast-crud.docmirror.cn/soybean/#/crud/demo) |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 更新日志
|
## 更新日志
|
||||||
|
|
||||||
@@ -56,13 +67,15 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -70,6 +83,12 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
<img style="width:380px;margin-right:18px;border:1px solid #dedede;" src="https://s2.loli.net/2023/06/07/A5Nonc9vI6pB1lr.png" />
|
||||||
|
|
||||||
|
<img style="width:380px;border:1px solid #dedede;" src="https://s2.loli.net/2023/06/07/VwBjqEhTke3OxXF.png" />
|
||||||
|
</div>
|
||||||
|
|
||||||
## 安装使用
|
## 安装使用
|
||||||
|
|
||||||
- 环境配置
|
- 环境配置
|
||||||
@@ -121,10 +140,6 @@ docker run --name soybean -p 80:80 -d soybeanjs/soybean-admin:v0.9.6
|
|||||||
|
|
||||||
项目已用 simple-git-hooks 代替了 husky, 旧版本用了 husky,执行 pnpm soy init-git-hooks 进行初始化配置
|
项目已用 simple-git-hooks 代替了 husky, 旧版本用了 husky,执行 pnpm soy init-git-hooks 进行初始化配置
|
||||||
|
|
||||||
## 基于 SoybeanAdmin 二次开发的项目
|
|
||||||
- [electron-mock-admin](https://github.com/lixin59/electron-mock-api): 一个 Mock Api 管理系统,帮助前端开发伙伴快速实现接口的mock。
|
|
||||||
- [T-Shell](https://github.com/TheBlindM/T-Shell): 是一个可配置命令提示的终端模拟器和 SSH客户端。
|
|
||||||
|
|
||||||
## 浏览器支持
|
## 浏览器支持
|
||||||
|
|
||||||
本地开发推荐使用`Chrome 90+` 浏览器
|
本地开发推荐使用`Chrome 90+` 浏览器
|
||||||
@@ -144,17 +159,13 @@ docker run --name soybean -p 80:80 -d soybeanjs/soybean-admin:v0.9.6
|
|||||||
`Soybean Admin` 是完全开源免费的项目,在帮助开发者更方便地进行中大型管理系统开发,同时也提供微信和 QQ 交流群,使用问题欢迎在群内提问。
|
`Soybean Admin` 是完全开源免费的项目,在帮助开发者更方便地进行中大型管理系统开发,同时也提供微信和 QQ 交流群,使用问题欢迎在群内提问。
|
||||||
|
|
||||||
<div style="display:flex;">
|
<div style="display:flex;">
|
||||||
<!-- <div style="padding-right:24px;">
|
|
||||||
<p>微信交流群</p>
|
|
||||||
<img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/uPic/soybeanjs-wechat0503.jpeg" style="width:200px" />
|
|
||||||
</div> -->
|
|
||||||
<div style="padding-right:24px;">
|
<div style="padding-right:24px;">
|
||||||
<p>QQ交流群</p>
|
<p>QQ交流群</p>
|
||||||
<img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/uPic/qq-soybean-admin.jpg" style="width:200px" />
|
<img src="https://i.loli.net/2021/11/24/1J6REWXiHomU2kM.jpg" style="width:200px" />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<p>添加本人微信,欢迎来技术交流,业务咨询</p>
|
<p>添加本人微信,欢迎来技术交流,业务咨询</p>
|
||||||
<img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/uPic/soybeanjs.jpeg" style="width:180px" />
|
<img src="https://s2.loli.net/2023/06/07/sVyCUFBvzQ9f5b7.jpg" style="width:200px" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -166,4 +177,4 @@ docker run --name soybean -p 80:80 -d soybeanjs/soybean-admin:v0.9.6
|
|||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
[MIT © Soybean-2021](./LICENSE)
|
本项目基于[MIT © Soybean-2021](./LICENSE) 协议,仅供参考学习,商用时请保留作者的版权信息,作者不对软件做担保和负责。
|
||||||
|
@@ -3,6 +3,7 @@ import vue from '@vitejs/plugin-vue';
|
|||||||
import vueJsx from '@vitejs/plugin-vue-jsx';
|
import vueJsx from '@vitejs/plugin-vue-jsx';
|
||||||
import unocss from '@unocss/vite';
|
import unocss from '@unocss/vite';
|
||||||
import progress from 'vite-plugin-progress';
|
import progress from 'vite-plugin-progress';
|
||||||
|
import VueDevtools from 'vite-plugin-vue-devtools';
|
||||||
import pageRoute from '@soybeanjs/vite-plugin-vue-page-route';
|
import pageRoute from '@soybeanjs/vite-plugin-vue-page-route';
|
||||||
import unplugin from './unplugin';
|
import unplugin from './unplugin';
|
||||||
import mock from './mock';
|
import mock from './mock';
|
||||||
@@ -22,11 +23,11 @@ export function setupVitePlugins(viteEnv: ImportMetaEnv): (PluginOption | Plugin
|
|||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
vueJsx(),
|
vueJsx(),
|
||||||
|
VueDevtools(),
|
||||||
...unplugin(viteEnv),
|
...unplugin(viteEnv),
|
||||||
unocss(),
|
unocss(),
|
||||||
mock(viteEnv),
|
mock(viteEnv),
|
||||||
progress(),
|
progress()
|
||||||
pageRoute()
|
|
||||||
];
|
];
|
||||||
|
|
||||||
if (viteEnv.VITE_VISUALIZER === 'Y') {
|
if (viteEnv.VITE_VISUALIZER === 'Y') {
|
||||||
@@ -38,6 +39,9 @@ export function setupVitePlugins(viteEnv: ImportMetaEnv): (PluginOption | Plugin
|
|||||||
if (viteEnv.VITE_PWA === 'Y' || viteEnv.VITE_VERCEL === 'Y') {
|
if (viteEnv.VITE_PWA === 'Y' || viteEnv.VITE_VERCEL === 'Y') {
|
||||||
plugins.push(pwa());
|
plugins.push(pwa());
|
||||||
}
|
}
|
||||||
|
if (viteEnv.VITE_SOYBEAN_ROUTE_PLUGIN === 'Y') {
|
||||||
|
plugins.push(pageRoute());
|
||||||
|
}
|
||||||
|
|
||||||
return plugins;
|
return plugins;
|
||||||
}
|
}
|
||||||
|
58
package.json
58
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "soybean-admin",
|
"name": "soybean-admin",
|
||||||
"version": "0.10.0",
|
"version": "0.10.3",
|
||||||
"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",
|
||||||
@@ -45,34 +45,34 @@
|
|||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"typecheck": "vue-tsc --noEmit --skipLibCheck",
|
"typecheck": "vue-tsc --noEmit --skipLibCheck",
|
||||||
"lint": "eslint . --fix",
|
"lint": "eslint . --fix",
|
||||||
"format": "soy prettier-format",
|
"format": "soy prettier-write",
|
||||||
"commit": "soy git-commit",
|
"commit": "soy git-commit",
|
||||||
"cleanup": "soy cleanup",
|
"cleanup": "soy cleanup",
|
||||||
"update-pkg": "soy update-pkg",
|
"update-pkg": "soy ncu",
|
||||||
|
"release": "soy release",
|
||||||
"tsx": "tsx",
|
"tsx": "tsx",
|
||||||
"logo": "tsx ./scripts/logo.ts",
|
"logo": "tsx ./scripts/logo.ts",
|
||||||
"update-version": "bumpp --commit --push --tag",
|
"prepare": "soy init-simple-git-hooks"
|
||||||
"prepare": "soy init-git-hooks"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@antv/data-set": "0.11.8",
|
"@antv/data-set": "0.11.8",
|
||||||
"@antv/g2": "4.2.10",
|
"@antv/g2": "4.2.10",
|
||||||
"@better-scroll/core": "2.5.1",
|
"@better-scroll/core": "2.5.1",
|
||||||
"@soybeanjs/vue-materials": "0.1.15",
|
"@soybeanjs/vue-materials": "0.2.0",
|
||||||
"@vueuse/core": "10.1.2",
|
"@vueuse/core": "10.1.2",
|
||||||
"axios": "1.4.0",
|
"axios": "1.4.0",
|
||||||
"clipboard": "2.0.11",
|
"clipboard": "2.0.11",
|
||||||
"colord": "2.9.3",
|
"colord": "2.9.3",
|
||||||
"crypto-js": "4.1.1",
|
"crypto-js": "4.1.1",
|
||||||
"dayjs": "1.11.7",
|
"dayjs": "1.11.8",
|
||||||
"echarts": "5.4.2",
|
"echarts": "5.4.2",
|
||||||
"form-data": "4.0.0",
|
"form-data": "4.0.0",
|
||||||
"lodash-es": "4.17.21",
|
"lodash-es": "4.17.21",
|
||||||
"naive-ui": "2.34.4",
|
"naive-ui": "2.34.4",
|
||||||
"pinia": "2.1.3",
|
"pinia": "2.1.4",
|
||||||
"print-js": "1.6.0",
|
"print-js": "1.6.0",
|
||||||
"qs": "6.11.2",
|
"qs": "6.11.2",
|
||||||
"swiper": "9.3.2",
|
"swiper": "9.4.1",
|
||||||
"ua-parser-js": "1.0.35",
|
"ua-parser-js": "1.0.35",
|
||||||
"vditor": "3.9.3",
|
"vditor": "3.9.3",
|
||||||
"vue": "3.3.4",
|
"vue": "3.3.4",
|
||||||
@@ -80,43 +80,42 @@
|
|||||||
"vue-router": "4.2.2",
|
"vue-router": "4.2.2",
|
||||||
"vuedraggable": "4.1.0",
|
"vuedraggable": "4.1.0",
|
||||||
"wangeditor": "4.7.15",
|
"wangeditor": "4.7.15",
|
||||||
"xgplayer": "3.0.2"
|
"xgplayer": "3.0.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@amap/amap-jsapi-types": "0.0.13",
|
"@amap/amap-jsapi-types": "0.0.13",
|
||||||
"@iconify/json": "2.2.71",
|
"@iconify/json": "2.2.78",
|
||||||
"@iconify/vue": "4.1.1",
|
"@iconify/vue": "4.1.1",
|
||||||
"@soybeanjs/cli": "0.3.2",
|
"@soybeanjs/cli": "0.6.2",
|
||||||
"@soybeanjs/vite-plugin-vue-page-route": "0.0.5",
|
"@soybeanjs/vite-plugin-vue-page-route": "0.0.5",
|
||||||
"@types/bmapgl": "0.0.7",
|
"@types/bmapgl": "0.0.7",
|
||||||
"@types/crypto-js": "4.1.1",
|
"@types/crypto-js": "4.1.1",
|
||||||
"@types/node": "20.2.5",
|
"@types/node": "20.3.1",
|
||||||
"@types/qs": "6.9.7",
|
"@types/qs": "6.9.7",
|
||||||
"@types/ua-parser-js": "0.7.36",
|
"@types/ua-parser-js": "0.7.36",
|
||||||
"@unocss/preset-uno": "0.52.5",
|
"@unocss/preset-uno": "0.53.1",
|
||||||
"@unocss/transformer-directives": "0.52.5",
|
"@unocss/transformer-directives": "0.53.1",
|
||||||
"@unocss/vite": "0.52.5",
|
"@unocss/vite": "0.53.1",
|
||||||
"@vitejs/plugin-vue": "4.2.3",
|
"@vitejs/plugin-vue": "4.2.3",
|
||||||
"@vitejs/plugin-vue-jsx": "3.0.1",
|
"@vitejs/plugin-vue-jsx": "3.0.1",
|
||||||
"bumpp": "9.1.0",
|
|
||||||
"cross-env": "7.0.3",
|
"cross-env": "7.0.3",
|
||||||
"eslint": "8.41.0",
|
"eslint": "8.42.0",
|
||||||
"eslint-config-soybeanjs": "0.4.7",
|
"eslint-config-soybeanjs": "0.4.9",
|
||||||
"lint-staged": "13.2.2",
|
|
||||||
"mockjs": "1.1.0",
|
"mockjs": "1.1.0",
|
||||||
"rollup-plugin-visualizer": "5.9.0",
|
"rollup-plugin-visualizer": "5.9.2",
|
||||||
"sass": "1.62.1",
|
"sass": "1.63.4",
|
||||||
"simple-git-hooks": "2.8.1",
|
"simple-git-hooks": "2.8.1",
|
||||||
"tsx": "3.12.7",
|
"tsx": "3.12.7",
|
||||||
"typescript": "5.0.4",
|
"typescript": "5.1.3",
|
||||||
"unplugin-icons": "0.16.1",
|
"unplugin-icons": "0.16.3",
|
||||||
"unplugin-vue-components": "0.25.0",
|
"unplugin-vue-components": "0.25.1",
|
||||||
"vite": "4.3.9",
|
"vite": "4.3.9",
|
||||||
"vite-plugin-compression": "0.5.1",
|
"vite-plugin-compression": "0.5.1",
|
||||||
"vite-plugin-mock": "2.9.8",
|
"vite-plugin-mock": "2.9.8",
|
||||||
"vite-plugin-progress": "0.0.7",
|
"vite-plugin-progress": "0.0.7",
|
||||||
"vite-plugin-pwa": "0.15.2",
|
"vite-plugin-pwa": "0.16.4",
|
||||||
"vite-plugin-svg-icons": "2.0.1",
|
"vite-plugin-svg-icons": "2.0.1",
|
||||||
|
"vite-plugin-vue-devtools": "0.2.0",
|
||||||
"vue-tsc": "1.6.5"
|
"vue-tsc": "1.6.5"
|
||||||
},
|
},
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
@@ -126,10 +125,9 @@
|
|||||||
},
|
},
|
||||||
"simple-git-hooks": {
|
"simple-git-hooks": {
|
||||||
"commit-msg": "pnpm soy git-commit-verify",
|
"commit-msg": "pnpm soy git-commit-verify",
|
||||||
"pre-commit": "pnpm typecheck && pnpm lint-staged"
|
"pre-commit": "pnpm typecheck && pnpm soy lint-staged"
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"soybean": {
|
||||||
"*.{js,mjs,jsx,ts,mts,tsx,json,vue,svelte,astro}": "eslint . --fix",
|
"useSoybeanToken": true
|
||||||
"*.!{js,mjs,jsx,ts,mts,tsx,json,vue,svelte,astro}": "format"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
4121
pnpm-lock.yaml
generated
4121
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
|||||||
import { h } from 'vue';
|
import { h } from 'vue';
|
||||||
import SvgIcon from '~/src/components/custom/svg-icon.vue';
|
import SvgIcon from '@/components/custom/svg-icon.vue';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 图标渲染
|
* 图标渲染
|
||||||
|
6
src/constants/_shared.ts
Normal file
6
src/constants/_shared.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
export function transformObjectToOption<T extends object>(obj: T) {
|
||||||
|
return Object.entries(obj).map(([value, label]) => ({
|
||||||
|
value,
|
||||||
|
label
|
||||||
|
})) as Common.OptionWithKey<keyof T>[];
|
||||||
|
}
|
@@ -1,3 +1,5 @@
|
|||||||
|
import { transformObjectToOption } from './_shared';
|
||||||
|
|
||||||
export const loginModuleLabels: Record<UnionKey.LoginModule, string> = {
|
export const loginModuleLabels: Record<UnionKey.LoginModule, string> = {
|
||||||
'pwd-login': '账密登录',
|
'pwd-login': '账密登录',
|
||||||
'code-login': '手机验证码登录',
|
'code-login': '手机验证码登录',
|
||||||
@@ -11,23 +13,14 @@ export const userRoleLabels: Record<Auth.RoleType, string> = {
|
|||||||
admin: '管理员',
|
admin: '管理员',
|
||||||
user: '普通用户'
|
user: '普通用户'
|
||||||
};
|
};
|
||||||
|
export const userRoleOptions = transformObjectToOption(userRoleLabels);
|
||||||
export const userRoleOptions: Common.OptionWithKey<Auth.RoleType>[] = [
|
|
||||||
{ value: 'super', label: userRoleLabels.super },
|
|
||||||
{ value: 'admin', label: userRoleLabels.admin },
|
|
||||||
{ value: 'user', label: userRoleLabels.user }
|
|
||||||
];
|
|
||||||
|
|
||||||
/** 用户性别 */
|
/** 用户性别 */
|
||||||
export const genderLabels: Record<UserManagement.GenderKey, string> = {
|
export const genderLabels: Record<UserManagement.GenderKey, string> = {
|
||||||
0: '女',
|
0: '女',
|
||||||
1: '男'
|
1: '男'
|
||||||
};
|
};
|
||||||
|
export const genderOptions = transformObjectToOption(genderLabels);
|
||||||
export const genderOptions: Common.OptionWithKey<UserManagement.GenderKey>[] = [
|
|
||||||
{ value: '0', label: genderLabels['0'] },
|
|
||||||
{ value: '1', label: genderLabels['1'] }
|
|
||||||
];
|
|
||||||
|
|
||||||
/** 用户状态 */
|
/** 用户状态 */
|
||||||
export const userStatusLabels: Record<UserManagement.UserStatusKey, string> = {
|
export const userStatusLabels: Record<UserManagement.UserStatusKey, string> = {
|
||||||
@@ -36,10 +29,4 @@ export const userStatusLabels: Record<UserManagement.UserStatusKey, string> = {
|
|||||||
3: '冻结',
|
3: '冻结',
|
||||||
4: '软删除'
|
4: '软删除'
|
||||||
};
|
};
|
||||||
|
export const userStatusOptions = transformObjectToOption(userStatusLabels);
|
||||||
export const userStatusOptions: Common.OptionWithKey<UserManagement.UserStatusKey>[] = [
|
|
||||||
{ value: '1', label: userStatusLabels['1'] },
|
|
||||||
{ value: '2', label: userStatusLabels['2'] },
|
|
||||||
{ value: '3', label: userStatusLabels['3'] },
|
|
||||||
{ value: '4', label: userStatusLabels['4'] }
|
|
||||||
];
|
|
||||||
|
@@ -1,81 +1,31 @@
|
|||||||
|
import { transformObjectToOption } from './_shared';
|
||||||
|
|
||||||
export const themeLayoutModeLabels: Record<UnionKey.ThemeLayoutMode, string> = {
|
export const themeLayoutModeLabels: Record<UnionKey.ThemeLayoutMode, string> = {
|
||||||
vertical: '左侧菜单模式',
|
vertical: '左侧菜单模式',
|
||||||
horizontal: '顶部菜单模式',
|
horizontal: '顶部菜单模式',
|
||||||
'vertical-mix': '左侧菜单混合模式',
|
'vertical-mix': '左侧菜单混合模式',
|
||||||
'horizontal-mix': '顶部菜单混合模式'
|
'horizontal-mix': '顶部菜单混合模式'
|
||||||
};
|
};
|
||||||
|
export const themeLayoutModeOptions = transformObjectToOption(themeLayoutModeLabels);
|
||||||
export const themeLayoutModeOptions: Common.OptionWithKey<UnionKey.ThemeLayoutMode>[] = [
|
|
||||||
{
|
|
||||||
value: 'vertical',
|
|
||||||
label: themeLayoutModeLabels.vertical
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'horizontal',
|
|
||||||
label: themeLayoutModeLabels.horizontal
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'vertical-mix',
|
|
||||||
label: themeLayoutModeLabels['vertical-mix']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'horizontal-mix',
|
|
||||||
label: themeLayoutModeLabels['horizontal-mix']
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
export const themeScrollModeLabels: Record<UnionKey.ThemeScrollMode, string> = {
|
export const themeScrollModeLabels: Record<UnionKey.ThemeScrollMode, string> = {
|
||||||
wrapper: '外层滚动',
|
wrapper: '外层滚动',
|
||||||
content: '主体滚动'
|
content: '主体滚动'
|
||||||
};
|
};
|
||||||
|
export const themeScrollModeOptions = transformObjectToOption(themeScrollModeLabels);
|
||||||
export const themeScrollModeOptions: Common.OptionWithKey<UnionKey.ThemeScrollMode>[] = [
|
|
||||||
{
|
|
||||||
value: 'wrapper',
|
|
||||||
label: themeScrollModeLabels.wrapper
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'content',
|
|
||||||
label: themeScrollModeLabels.content
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
export const themeTabModeLabels: Record<UnionKey.ThemeTabMode, string> = {
|
export const themeTabModeLabels: Record<UnionKey.ThemeTabMode, string> = {
|
||||||
chrome: '谷歌风格',
|
chrome: '谷歌风格',
|
||||||
button: '按钮风格'
|
button: '按钮风格'
|
||||||
};
|
};
|
||||||
|
export const themeTabModeOptions = transformObjectToOption(themeTabModeLabels);
|
||||||
export const themeTabModeOptions: Common.OptionWithKey<UnionKey.ThemeTabMode>[] = [
|
|
||||||
{
|
|
||||||
value: 'chrome',
|
|
||||||
label: themeTabModeLabels.chrome
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'button',
|
|
||||||
label: themeTabModeLabels.button
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
export const themeHorizontalMenuPositionLabels: Record<UnionKey.ThemeHorizontalMenuPosition, string> = {
|
export const themeHorizontalMenuPositionLabels: Record<UnionKey.ThemeHorizontalMenuPosition, string> = {
|
||||||
'flex-start': '居左',
|
'flex-start': '居左',
|
||||||
center: '居中',
|
center: '居中',
|
||||||
'flex-end': '居右'
|
'flex-end': '居右'
|
||||||
};
|
};
|
||||||
|
export const themeHorizontalMenuPositionOptions = transformObjectToOption(themeHorizontalMenuPositionLabels);
|
||||||
export const themeHorizontalMenuPositionOptions: Common.OptionWithKey<UnionKey.ThemeHorizontalMenuPosition>[] = [
|
|
||||||
{
|
|
||||||
value: 'flex-start',
|
|
||||||
label: themeHorizontalMenuPositionLabels['flex-start']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'center',
|
|
||||||
label: themeHorizontalMenuPositionLabels.center
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'flex-end',
|
|
||||||
label: themeHorizontalMenuPositionLabels['flex-end']
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
export const themeAnimateModeLabels: Record<UnionKey.ThemeAnimateMode, string> = {
|
export const themeAnimateModeLabels: Record<UnionKey.ThemeAnimateMode, string> = {
|
||||||
'zoom-fade': '渐变',
|
'zoom-fade': '渐变',
|
||||||
@@ -85,30 +35,4 @@ export const themeAnimateModeLabels: Record<UnionKey.ThemeAnimateMode, string> =
|
|||||||
'fade-bottom': '底部消退',
|
'fade-bottom': '底部消退',
|
||||||
'fade-scale': '缩放消退'
|
'fade-scale': '缩放消退'
|
||||||
};
|
};
|
||||||
|
export const themeAnimateModeOptions = transformObjectToOption(themeAnimateModeLabels);
|
||||||
export const themeAnimateModeOptions: Common.OptionWithKey<UnionKey.ThemeAnimateMode>[] = [
|
|
||||||
{
|
|
||||||
value: 'zoom-fade',
|
|
||||||
label: themeAnimateModeLabels['zoom-fade']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'zoom-out',
|
|
||||||
label: themeAnimateModeLabels['zoom-out']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'fade-slide',
|
|
||||||
label: themeAnimateModeLabels['fade-slide']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'fade',
|
|
||||||
label: themeAnimateModeLabels.fade
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'fade-bottom',
|
|
||||||
label: themeAnimateModeLabels['fade-bottom']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'fade-scale',
|
|
||||||
label: themeAnimateModeLabels['fade-scale']
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<hover-container class="w-40px h-full">
|
<hover-container class="w-40px h-full" :inverted="theme.header.inverted">
|
||||||
<n-dropdown :options="options" trigger="hover" :value="language" @select="handleSelect">
|
<n-dropdown :options="options" trigger="hover" :value="language" @select="handleSelect">
|
||||||
<icon-cil:language class="text-18px outline-transparent" />
|
<icon-cil:language class="text-18px outline-transparent" />
|
||||||
</n-dropdown>
|
</n-dropdown>
|
||||||
@@ -9,8 +9,10 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import { useThemeStore } from '@/store';
|
||||||
import { localStg } from '@/utils';
|
import { localStg } from '@/utils';
|
||||||
|
|
||||||
|
const theme = useThemeStore();
|
||||||
const { locale } = useI18n();
|
const { locale } = useI18n();
|
||||||
|
|
||||||
const language = ref<I18nType.langType>(localStg.get('lang') || 'zh-CN');
|
const language = ref<I18nType.langType>(localStg.get('lang') || 'zh-CN');
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
>
|
>
|
||||||
<component :is="icon" :class="[isMini ? 'text-16px' : 'text-20px']" />
|
<component :is="icon" :class="[isMini ? 'text-16px' : 'text-20px']" />
|
||||||
<p
|
<p
|
||||||
class="text-12px overflow-hidden transition-height duration-300 ease-in-out"
|
class="w-full text-center ellipsis-text text-12px transition-height duration-300 ease-in-out"
|
||||||
:class="[isMini ? 'h-0 pt-0' : 'h-24px pt-4px']"
|
:class="[isMini ? 'h-0 pt-0' : 'h-24px pt-4px']"
|
||||||
>
|
>
|
||||||
{{ label }}
|
{{ label }}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<dark-mode-container class="flex h-full" :inverted="theme.sider.inverted" @mouseleave="resetFirstDegreeMenus">
|
<dark-mode-container class="flex h-full" :inverted="theme.sider.inverted" @mouseleave="resetFirstDegreeMenus">
|
||||||
<div class="flex-1 flex-col-stretch h-full">
|
<div class="flex-1-hidden flex-col-stretch h-full">
|
||||||
<global-logo :show-title="false" :style="{ height: theme.header.height + 'px' }" />
|
<global-logo :show-title="false" :style="{ height: theme.header.height + 'px' }" />
|
||||||
<n-scrollbar class="flex-1-hidden">
|
<n-scrollbar class="flex-1-hidden">
|
||||||
<mix-menu-detail
|
<mix-menu-detail
|
||||||
|
2
src/typings/env.d.ts
vendored
2
src/typings/env.d.ts
vendored
@@ -66,6 +66,8 @@ interface ImportMetaEnv {
|
|||||||
readonly VITE_PROD_MOCK?: 'Y' | 'N';
|
readonly VITE_PROD_MOCK?: 'Y' | 'N';
|
||||||
/** hash路由模式 */
|
/** hash路由模式 */
|
||||||
readonly VITE_HASH_ROUTE?: 'Y' | 'N';
|
readonly VITE_HASH_ROUTE?: 'Y' | 'N';
|
||||||
|
/** 是否应用自动生成路由的插件 */
|
||||||
|
readonly VITE_SOYBEAN_ROUTE_PLUGIN?: 'Y' | 'N';
|
||||||
/** 是否是部署的vercel */
|
/** 是否是部署的vercel */
|
||||||
readonly VITE_VERCEL?: 'Y' | 'N';
|
readonly VITE_VERCEL?: 'Y' | 'N';
|
||||||
}
|
}
|
||||||
|
6
src/typings/package.d.ts
vendored
6
src/typings/package.d.ts
vendored
@@ -7,9 +7,3 @@ declare namespace BMap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
declare const TMap: any;
|
declare const TMap: any;
|
||||||
|
|
||||||
declare module 'unplugin-vue-define-options/vite' {
|
|
||||||
const plugin: (options?: import('unplugin-vue-define-options/dist/unplugin.d-59ddef99').B) => import('vite').Plugin;
|
|
||||||
|
|
||||||
export default plugin;
|
|
||||||
}
|
|
||||||
|
@@ -3,7 +3,11 @@ import presetUno from '@unocss/preset-uno';
|
|||||||
import transformerDirectives from '@unocss/transformer-directives';
|
import transformerDirectives from '@unocss/transformer-directives';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
exclude: ['node_modules', 'dist', '.git', '.husky', '.vscode', 'public', 'build', 'mock', './stats.html'],
|
content: {
|
||||||
|
pipeline: {
|
||||||
|
exclude: ['node_modules', 'dist', '.git', '.husky', '.vscode', 'public', 'build', 'mock', './stats.html']
|
||||||
|
}
|
||||||
|
},
|
||||||
presets: [presetUno({ dark: 'class' })],
|
presets: [presetUno({ dark: 'class' })],
|
||||||
transformers: [transformerDirectives()],
|
transformers: [transformerDirectives()],
|
||||||
shortcuts: {
|
shortcuts: {
|
||||||
|
Reference in New Issue
Block a user