mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-09-18 17:46:38 +08:00
refactor(projects): 抽离格式化相关依赖配置
This commit is contained in:
parent
16dce9a4ce
commit
f4d37cf7f0
@ -1,14 +1,5 @@
|
|||||||
*.sh
|
|
||||||
node_modules
|
|
||||||
lib
|
|
||||||
*.md
|
|
||||||
*.woff
|
|
||||||
*.ttf
|
|
||||||
.vscode
|
.vscode
|
||||||
.idea
|
.idea
|
||||||
/dist/
|
|
||||||
/public
|
|
||||||
/docs
|
|
||||||
.vscode
|
.vscode
|
||||||
.local
|
.local
|
||||||
!.env-config.ts
|
!.env-config.ts
|
||||||
|
131
.eslintrc.js
131
.eslintrc.js
@ -1,44 +1,18 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
env: {
|
extends: ['@soybeanjs'],
|
||||||
browser: true,
|
settings: {
|
||||||
es2021: true
|
'import/resolver': {
|
||||||
},
|
alias: {
|
||||||
globals: {
|
map: [
|
||||||
PROJECT_BUILD_TIME: 'readonly',
|
['~', '.'],
|
||||||
AMap: 'readonly',
|
['@', './src']
|
||||||
BMap: 'readonly',
|
],
|
||||||
TMap: 'readonly'
|
extensions: ['.js', '.jsx', '.mjs', '.ts', '.tsx', 'mts', '.d.ts']
|
||||||
},
|
|
||||||
parser: 'vue-eslint-parser',
|
|
||||||
parserOptions: {
|
|
||||||
ecmaVersion: 12,
|
|
||||||
parser: '@typescript-eslint/parser',
|
|
||||||
sourceType: 'module'
|
|
||||||
},
|
|
||||||
plugins: ['vue', '@typescript-eslint'],
|
|
||||||
extends: [
|
|
||||||
'airbnb-base',
|
|
||||||
'eslint:recommended',
|
|
||||||
'plugin:vue/vue3-recommended',
|
|
||||||
'plugin:prettier/recommended',
|
|
||||||
'@vue/eslint-config-typescript/recommended',
|
|
||||||
'@vue/eslint-config-prettier',
|
|
||||||
'@vue/typescript/recommended'
|
|
||||||
],
|
|
||||||
rules: {
|
|
||||||
'import/extensions': [
|
|
||||||
'warn',
|
|
||||||
'ignorePackages',
|
|
||||||
{
|
|
||||||
js: 'never',
|
|
||||||
jsx: 'never',
|
|
||||||
mjs: 'never',
|
|
||||||
ts: 'never',
|
|
||||||
tsx: 'never',
|
|
||||||
mts: 'never'
|
|
||||||
}
|
}
|
||||||
],
|
}
|
||||||
'import/no-extraneous-dependencies': ['error', { devDependencies: true, peerDependencies: true }],
|
},
|
||||||
|
rules: {
|
||||||
|
'import/no-unresolved': ['error', { ignore: ['uno.css', '~icons/*', 'virtual:svg-icons-register'] }],
|
||||||
'import/order': [
|
'import/order': [
|
||||||
'error',
|
'error',
|
||||||
{
|
{
|
||||||
@ -55,11 +29,6 @@ module.exports = {
|
|||||||
group: 'external',
|
group: 'external',
|
||||||
position: 'before'
|
position: 'before'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
pattern: 'vuex',
|
|
||||||
group: 'external',
|
|
||||||
position: 'before'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
pattern: 'pinia',
|
pattern: 'pinia',
|
||||||
group: 'external',
|
group: 'external',
|
||||||
@ -151,76 +120,8 @@ module.exports = {
|
|||||||
position: 'before'
|
position: 'before'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
pathGroupsExcludedImportTypes: ['vue', 'vue-router', 'vuex', 'pinia', 'naive-ui']
|
pathGroupsExcludedImportTypes: ['vue', 'vue-router', 'pinia', 'naive-ui']
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
'import/no-unresolved': ['error', { ignore: ['uno.css', '~icons/*', 'virtual:svg-icons-register'] }],
|
}
|
||||||
'import/prefer-default-export': 'off',
|
|
||||||
'max-classes-per-file': 'off',
|
|
||||||
'no-param-reassign': [
|
|
||||||
'error',
|
|
||||||
{
|
|
||||||
props: true,
|
|
||||||
ignorePropertyModificationsFor: ['state', 'acc', 'e']
|
|
||||||
}
|
|
||||||
],
|
|
||||||
'no-shadow': 'off',
|
|
||||||
'no-unused-vars': 'off',
|
|
||||||
'no-use-before-define': 'off',
|
|
||||||
'vue/multi-word-component-names': [
|
|
||||||
'error',
|
|
||||||
{
|
|
||||||
ignores: ['index']
|
|
||||||
}
|
|
||||||
],
|
|
||||||
'@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports', disallowTypeAnnotations: false }],
|
|
||||||
'@typescript-eslint/no-empty-interface': [
|
|
||||||
'error',
|
|
||||||
{
|
|
||||||
allowSingleExtends: true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
'@typescript-eslint/no-explicit-any': 'off',
|
|
||||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
||||||
'@typescript-eslint/no-shadow': 'error',
|
|
||||||
'@typescript-eslint/no-unused-vars': [
|
|
||||||
'error',
|
|
||||||
{ vars: 'all', args: 'all', ignoreRestSiblings: false, varsIgnorePattern: '^_', argsIgnorePattern: '^_' }
|
|
||||||
],
|
|
||||||
'@typescript-eslint/no-use-before-define': ['error', { classes: true, functions: false, typedefs: false }]
|
|
||||||
},
|
|
||||||
settings: {
|
|
||||||
'import/resolver': {
|
|
||||||
alias: {
|
|
||||||
map: [
|
|
||||||
['~', '.'],
|
|
||||||
['@', './src']
|
|
||||||
],
|
|
||||||
extensions: ['.js', '.jsx', '.mjs', '.ts', '.tsx', 'mts', '.d.ts']
|
|
||||||
},
|
|
||||||
node: {
|
|
||||||
extensions: ['.js', '.jsx', '.mjs', '.ts', '.tsx', 'mts', '.d.ts']
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
overrides: [
|
|
||||||
{
|
|
||||||
files: ['*.vue'],
|
|
||||||
rules: {
|
|
||||||
'no-undef': 'off'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
files: ['*.html'],
|
|
||||||
rules: {
|
|
||||||
'vue/comment-directive': 'off'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
files: ['*.json'],
|
|
||||||
rules: {
|
|
||||||
'no-unused-expressions': 'off'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
};
|
||||||
|
47
.vscode/extensions.json
vendored
47
.vscode/extensions.json
vendored
@ -1,26 +1,25 @@
|
|||||||
{
|
{
|
||||||
"recommendations": [
|
"recommendations": [
|
||||||
"afzalsayed96.icones",
|
"afzalsayed96.icones",
|
||||||
"antfu.iconify",
|
"antfu.iconify",
|
||||||
"antfu.unocss",
|
"antfu.unocss",
|
||||||
"christian-kohler.path-intellisense",
|
"christian-kohler.path-intellisense",
|
||||||
"dbaeumer.vscode-eslint",
|
"dbaeumer.vscode-eslint",
|
||||||
"eamodio.gitlens",
|
"eamodio.gitlens",
|
||||||
"editorconfig.editorconfig",
|
"editorconfig.editorconfig",
|
||||||
"esbenp.prettier-vscode",
|
"esbenp.prettier-vscode",
|
||||||
"formulahendry.auto-complete-tag",
|
"formulahendry.auto-complete-tag",
|
||||||
"formulahendry.auto-close-tag",
|
"formulahendry.auto-close-tag",
|
||||||
"formulahendry.auto-rename-tag",
|
"formulahendry.auto-rename-tag",
|
||||||
"kisstkondoros.vscode-gutter-preview",
|
"kisstkondoros.vscode-gutter-preview",
|
||||||
"lokalise.i18n-ally",
|
"lokalise.i18n-ally",
|
||||||
"mhutchie.git-graph",
|
"mhutchie.git-graph",
|
||||||
"mikestead.dotenv",
|
"mikestead.dotenv",
|
||||||
"naumovs.color-highlight",
|
"naumovs.color-highlight",
|
||||||
"pkief.material-icon-theme",
|
"pkief.material-icon-theme",
|
||||||
"steoates.autoimport",
|
"steoates.autoimport",
|
||||||
"vue.volar",
|
"vue.volar",
|
||||||
"vue.vscode-typescript-vue-plugin",
|
"whtouche.vscode-js-console-utils",
|
||||||
"whtouche.vscode-js-console-utils",
|
"zhuangtongfa.material-theme"
|
||||||
"zhuangtongfa.material-theme"
|
]
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
159
.vscode/settings.json
vendored
159
.vscode/settings.json
vendored
@ -1,75 +1,88 @@
|
|||||||
{
|
{
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
"source.fixAll.eslint": true
|
"source.fixAll.eslint": true
|
||||||
},
|
},
|
||||||
"editor.fontLigatures": true,
|
"editor.fontLigatures": true,
|
||||||
"editor.formatOnSave": false,
|
"editor.formatOnSave": false,
|
||||||
"editor.guides.bracketPairs": "active",
|
"editor.guides.bracketPairs": "active",
|
||||||
"editor.quickSuggestions": {
|
"editor.quickSuggestions": {
|
||||||
"strings": true
|
"strings": true
|
||||||
},
|
},
|
||||||
"editor.tabSize": 2,
|
"editor.tabSize": 2,
|
||||||
"eslint.alwaysShowStatus": true,
|
"eslint.alwaysShowStatus": true,
|
||||||
"eslint.validate": ["javascript", "javascriptreact", "vue", "typescript", "typescriptreact", "html", "json", "jsonc"],
|
"eslint.validate": [
|
||||||
"files.associations": {
|
"javascript",
|
||||||
"*.env.*": "dotenv"
|
"javascriptreact",
|
||||||
},
|
"typescript",
|
||||||
"files.eol": "\n",
|
"typescriptreact",
|
||||||
"git.enableSmartCommit": true,
|
"vue",
|
||||||
"gutterpreview.paths": {
|
"html",
|
||||||
"@": "/src",
|
"json",
|
||||||
"~@": "/src"
|
"jsonc",
|
||||||
},
|
"json5",
|
||||||
"material-icon-theme.activeIconPack": "angular",
|
"yaml",
|
||||||
"material-icon-theme.files.associations": {},
|
"yml",
|
||||||
"material-icon-theme.folders.associations": {
|
"markdown"
|
||||||
"enum": "typescript",
|
],
|
||||||
"enums": "typescript",
|
"files.associations": {
|
||||||
"store": "context",
|
"*.env.*": "dotenv"
|
||||||
"stores": "context",
|
},
|
||||||
"composable": "hook",
|
"files.eol": "\n",
|
||||||
"composables": "hook",
|
"git.enableSmartCommit": true,
|
||||||
"directive": "tools",
|
"gutterpreview.paths": {
|
||||||
"directives": "tools",
|
"@": "/src",
|
||||||
"business": "core",
|
"~@": "/src"
|
||||||
"request": "api",
|
},
|
||||||
"adapter": "middleware"
|
"material-icon-theme.activeIconPack": "angular",
|
||||||
},
|
"material-icon-theme.files.associations": {},
|
||||||
"path-intellisense.mappings": {
|
"material-icon-theme.folders.associations": {
|
||||||
"@": "${workspaceFolder}/src",
|
"enum": "typescript",
|
||||||
"~@": "${workspaceFolder}/src",
|
"enums": "typescript",
|
||||||
},
|
"store": "context",
|
||||||
"terminal.integrated.cursorStyle": "line",
|
"stores": "context",
|
||||||
"terminal.integrated.fontSize": 14,
|
"composable": "hook",
|
||||||
"terminal.integrated.fontWeight": 500,
|
"composables": "hook",
|
||||||
"terminal.integrated.tabs.enabled": true,
|
"directive": "tools",
|
||||||
"workbench.iconTheme": "material-icon-theme",
|
"directives": "tools",
|
||||||
"workbench.colorTheme": "One Dark Pro",
|
"business": "core",
|
||||||
"[html]": {
|
"request": "api",
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"adapter": "middleware"
|
||||||
},
|
},
|
||||||
"[json]": {
|
"path-intellisense.mappings": {
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"@": "${workspaceFolder}/src",
|
||||||
},
|
"~@": "${workspaceFolder}/src"
|
||||||
"[jsonc]": {
|
},
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"terminal.integrated.cursorStyle": "line",
|
||||||
},
|
"terminal.integrated.fontSize": 14,
|
||||||
"[javascript]": {
|
"terminal.integrated.fontWeight": 500,
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"terminal.integrated.tabs.enabled": true,
|
||||||
},
|
"workbench.iconTheme": "material-icon-theme",
|
||||||
"[javascriptreact]": {
|
"workbench.colorTheme": "One Dark Pro",
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"[html]": {
|
||||||
},
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
"[markdown]": {
|
},
|
||||||
"editor.defaultFormatter": "yzhang.markdown-all-in-one"
|
"[json]": {
|
||||||
},
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
"[typescript]": {
|
},
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"[jsonc]": {
|
||||||
},
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
"[typescriptreact]": {
|
},
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"[javascript]": {
|
||||||
},
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
"[vue]": {
|
},
|
||||||
"editor.defaultFormatter": "Vue.volar"
|
"[javascriptreact]": {
|
||||||
}
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[markdown]": {
|
||||||
|
"editor.defaultFormatter": "yzhang.markdown-all-in-one"
|
||||||
|
},
|
||||||
|
"[typescript]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[typescriptreact]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[vue]": {
|
||||||
|
"editor.defaultFormatter": "Vue.volar"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
66
README.md
66
README.md
@ -7,16 +7,16 @@
|
|||||||
|
|
||||||
## 简介
|
## 简介
|
||||||
|
|
||||||
[Soybean Admin](https://github.com/honghuangdc/soybean-admin) 是一个基于 Vue3、Vite3、TypeScript、NaiveUI、Pinia和UnoCSS 的清新优雅的中后台模版,它使用了最新的前端技术栈,内置丰富的主题配置,有着极高的代码规范,基于mock实现的动态权限路由,开箱即用的中后台前端解决方案,也可用于学习参考。
|
[Soybean Admin](https://github.com/honghuangdc/soybean-admin) 是一个基于 Vue3、Vite3、TypeScript、NaiveUI、Pinia 和 UnoCSS 的清新优雅的中后台模版,它使用了最新的前端技术栈,内置丰富的主题配置,有着极高的代码规范,基于 mock 实现的动态权限路由,开箱即用的中后台前端解决方案,也可用于学习参考。
|
||||||
|
|
||||||
## 特性
|
## 特性
|
||||||
|
|
||||||
- **最新技术栈**:使用 Vue3/Vite3 等前端前沿技术开发, 使用高效率的npm包管理器pnpm
|
- **最新技术栈**:使用 Vue3/Vite3 等前端前沿技术开发, 使用高效率的 npm 包管理器 pnpm
|
||||||
- **TypeScript**:应用程序级 JavaScript 的语言
|
- **TypeScript**:应用程序级 JavaScript 的语言
|
||||||
- **主题**:丰富可配置的主题、暗黑模式,基于原子css框架 - UnoCSS的动态主题颜色
|
- **主题**:丰富可配置的主题、暗黑模式,基于原子 css 框架 - UnoCSS 的动态主题颜色
|
||||||
- **代码规范**:丰富的规范插件及极高的代码规范
|
- **代码规范**:丰富的规范插件及极高的代码规范
|
||||||
- **权限路由**:简易的路由配置、基于mock的动态路由能快速实现后端动态路由
|
- **权限路由**:简易的路由配置、基于 mock 的动态路由能快速实现后端动态路由
|
||||||
- **请求函数**:基于axios的完善的请求函数封装,提供Promise和hooks两种请求函数,加入请求结果数据转换的适配器
|
- **请求函数**:基于 axios 的完善的请求函数封装,提供 Promise 和 hooks 两种请求函数,加入请求结果数据转换的适配器
|
||||||
|
|
||||||
## 预览
|
## 预览
|
||||||
|
|
||||||
@ -29,18 +29,16 @@
|
|||||||
## 代码仓库
|
## 代码仓库
|
||||||
|
|
||||||
- [github](https://github.com/honghuangdc/soybean-admin)
|
- [github](https://github.com/honghuangdc/soybean-admin)
|
||||||
|
|
||||||
- [gitee](https://gitee.com/honghuangdc/soybean-admin)
|
- [gitee](https://gitee.com/honghuangdc/soybean-admin)
|
||||||
|
|
||||||
## 更新日志
|
## 更新日志
|
||||||
|
|
||||||
[CHANGELOG](./CHANGELOG.md)
|
[CHANGELOG](./CHANGELOG.md)
|
||||||
|
|
||||||
## 后端服务
|
## 后端服务
|
||||||
|
|
||||||
- [soybean-admin-java(开发中)](https://github.com/honghuangdc/soybean-admin-java)
|
- [soybean-admin-java(开发中)](https://github.com/honghuangdc/soybean-admin-java)
|
||||||
|
|
||||||
- [soybean-admin-go(开发中)](https://github.com/honghuangdc/soybean-admin-go)
|
- [soybean-admin-go(开发中)](https://github.com/honghuangdc/soybean-admin-go)
|
||||||
|
|
||||||
- [soybean-admin-nestjs(开发中)](https://github.com/honghuangdc/soybean-admin-nestjs)
|
- [soybean-admin-nestjs(开发中)](https://github.com/honghuangdc/soybean-admin-nestjs)
|
||||||
|
|
||||||
## 项目示例图
|
## 项目示例图
|
||||||
@ -67,38 +65,32 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 开发计划
|
## 开发计划
|
||||||
|
|
||||||
- [x] 引入ECharts替换AntV G2Plot
|
- [x] 引入 ECharts 替换 AntV G2Plot
|
||||||
- [x] 图表示例:ECharts、AntV G2
|
- [x] 图表示例:ECharts、AntV G2
|
||||||
- [x] 多页签:支持query、hash等参数,同一页面支持多个Tab
|
- [x] 多页签:支持 query、hash 等参数,同一页面支持多个 Tab
|
||||||
- [x] 缓存主题配置
|
- [x] 缓存主题配置
|
||||||
- [ ] v0.9.7表单、表格示例(ing...)
|
- [ ] v0.9.7 表单、表格示例(ing...)
|
||||||
- [ ] v0.9.8可修改的KeepAlive的页面缓存和全局Tab组件store重构
|
- [ ] v0.9.8 可修改的 KeepAlive 的页面缓存和全局 Tab 组件 store 重构
|
||||||
- [ ] v0.9.9全局Iframe组件
|
- [ ] v0.9.9 全局 Iframe 组件
|
||||||
- [ ] v1.0示例页面完善
|
- [ ] v1.0 示例页面完善
|
||||||
- [ ] v1.0版本文档
|
- [ ] v1.0 版本文档
|
||||||
- [ ] 精简版(新分支thin)
|
- [ ] 精简版(新分支 thin)
|
||||||
- [ ] element-plus版本
|
- [ ] element-plus 版本
|
||||||
- [ ] i18n国际化
|
- [ ] i18n 国际化
|
||||||
- [ ] 其他UI版本
|
- [ ] 其他 UI 版本
|
||||||
- [ ] soybean-admin cli工具(选择不同UI)
|
- [ ] soybean-admin cli 工具(选择不同 UI)
|
||||||
- [ ] soybean-admin 后台服务java版: [soybean-admin-java](https://github.com/honghuangdc/soybean-admin-java)
|
- [ ] soybean-admin 后台服务 java 版: [soybean-admin-java](https://github.com/honghuangdc/soybean-admin-java)
|
||||||
- [ ] soybean-admin 后台服务go版: [soybean-admin-go](https://github.com/honghuangdc/soybean-admin-go)
|
- [ ] soybean-admin 后台服务 go 版: [soybean-admin-go](https://github.com/honghuangdc/soybean-admin-go)
|
||||||
- [ ] soybean-admin 后台服务nodejs版: [soybean-admin-nestjs](https://github.com/honghuangdc/soybean-admin-nestjs)
|
- [ ] soybean-admin 后台服务 nodejs 版: [soybean-admin-nestjs](https://github.com/honghuangdc/soybean-admin-nestjs)
|
||||||
- [ ] 前端可视化创建路由页面
|
- [ ] 前端可视化创建路由页面
|
||||||
|
|
||||||
## 安装使用
|
## 安装使用
|
||||||
|
|
||||||
- 环境配置
|
- 环境配置
|
||||||
|
|
||||||
**本地环境需要安装 pnpm 7.x 、Node.js 14.18+ 和 Git**
|
**本地环境需要安装 pnpm 7.x 、Node.js 14.18+ 和 Git**
|
||||||
|
|
||||||
|
|
||||||
- 克隆代码
|
- 克隆代码
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -129,9 +121,9 @@ pnpm build
|
|||||||
|
|
||||||
## Git 贡献提交规范
|
## Git 贡献提交规范
|
||||||
|
|
||||||
项目已经内置angular提交规范,通过git cz 代替git commit 命令即可。
|
项目已经内置 angular 提交规范,通过 git cz 代替 git commit 命令即可。
|
||||||
|
|
||||||
git cz命令需要全局安装 commitizen
|
git cz 命令需要全局安装 commitizen
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pnpm i -g commitizen
|
pnpm i -g commitizen
|
||||||
@ -144,8 +136,8 @@ pnpm i -g commitizen
|
|||||||
支持现代浏览器, 不支持 IE
|
支持现代浏览器, 不支持 IE
|
||||||
|
|
||||||
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png" alt="IE" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)IE | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt=" Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)Safari |
|
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png" alt="IE" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)IE | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt=" Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)Safari |
|
||||||
| :-: | :-: | :-: | :-: | :-: |
|
| :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|
||||||
| not support | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
|
| not support | last 2 versions | last 2 versions | last 2 versions | last 2 versions |
|
||||||
|
|
||||||
## 开源作者
|
## 开源作者
|
||||||
|
|
||||||
@ -153,22 +145,22 @@ pnpm i -g commitizen
|
|||||||
|
|
||||||
## 交流
|
## 交流
|
||||||
|
|
||||||
`Soybean Admin` 是完全开源免费的项目,在帮助开发者更方便地进行中大型管理系统开发,同时也提供微信和QQ交流群,使用问题欢迎在群内提问。
|
`Soybean Admin` 是完全开源免费的项目,在帮助开发者更方便地进行中大型管理系统开发,同时也提供微信和 QQ 交流群,使用问题欢迎在群内提问。
|
||||||
|
|
||||||
- 微信交流群(添加本人微信拉进群),欢迎来技术交流,业务咨询。
|
- 微信交流群(添加本人微信拉进群),欢迎来技术交流,业务咨询。
|
||||||
|
|
||||||
<div style="text-align:left">
|
<div style="text-align:left">
|
||||||
<img src="https://s2.loli.net/2022/05/16/3YGBgXnVPJdslk8.jpg" style="width:200px" />
|
<img src="https://s2.loli.net/2022/05/16/3YGBgXnVPJdslk8.jpg" style="width:200px" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
- QQ交流群 `711301266`
|
- QQ 交流群 `711301266`
|
||||||
|
|
||||||
<div style="text-align:left">
|
<div style="text-align:left">
|
||||||
<img src="https://i.loli.net/2021/11/24/1J6REWXiHomU2kM.jpg" style="width:200px" />
|
<img src="https://i.loli.net/2021/11/24/1J6REWXiHomU2kM.jpg" style="width:200px" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
## 捐赠
|
## 捐赠
|
||||||
如果你觉得这个项目对你有帮助,可以请Soybean喝杯饮料表示支持,Soybean开源的动力离不开各位的支持和鼓励。
|
|
||||||
|
如果你觉得这个项目对你有帮助,可以请 Soybean 喝杯饮料表示支持,Soybean 开源的动力离不开各位的支持和鼓励。
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import type { MockMethod } from 'vite-plugin-mock';
|
import type { MockMethod } from 'vite-plugin-mock';
|
||||||
import { userModel, routeModel } from '../model';
|
import { routeModel, userModel } from '../model';
|
||||||
|
|
||||||
const apis: MockMethod[] = [
|
const apis: MockMethod[] = [
|
||||||
{
|
{
|
||||||
|
83
package.json
83
package.json
@ -1,11 +1,39 @@
|
|||||||
{
|
{
|
||||||
"name": "soybean-admin",
|
"name": "soybean-admin",
|
||||||
"version": "0.9.6",
|
"version": "0.9.6",
|
||||||
|
"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",
|
||||||
"email": "honghuangdc@gmail.com",
|
"email": "honghuangdc@gmail.com",
|
||||||
"url": "https://github.com/honghuangdc"
|
"url": "https://github.com/honghuangdc"
|
||||||
},
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"homepage": "https://github.com/honghuangdc/soybean-admin",
|
||||||
|
"repository": {
|
||||||
|
"url": "https://github.com/honghuangdc/soybean-admin.git"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/honghuangdc/soybean-admin/issues"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"Vue",
|
||||||
|
"Vue3",
|
||||||
|
"admin",
|
||||||
|
"admin-template",
|
||||||
|
"vue-admin",
|
||||||
|
"vue-admin-template",
|
||||||
|
"Vite3",
|
||||||
|
"Vite",
|
||||||
|
"vite-admin",
|
||||||
|
"TypeScript",
|
||||||
|
"TS",
|
||||||
|
"NaiveUI",
|
||||||
|
"naive-ui",
|
||||||
|
"naive-admin",
|
||||||
|
"NaiveUI-Admin",
|
||||||
|
"naive-ui-admin",
|
||||||
|
"UnoCSS"
|
||||||
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "cross-env VITE_SERVICE_ENV=dev vite",
|
"dev": "cross-env VITE_SERVICE_ENV=dev vite",
|
||||||
"dev:test": "cross-env VITE_SERVICE_ENV=test vite",
|
"dev:test": "cross-env VITE_SERVICE_ENV=test vite",
|
||||||
@ -16,20 +44,12 @@
|
|||||||
"build:vercel": "cross-env VITE_HASH_ROUTE=Y VITE_VERCEL=Y vite build",
|
"build:vercel": "cross-env VITE_HASH_ROUTE=Y VITE_VERCEL=Y vite build",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"typecheck": "vue-tsc --noEmit --skipLibCheck",
|
"typecheck": "vue-tsc --noEmit --skipLibCheck",
|
||||||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts,.json --fix",
|
"lint": "eslint . --fix",
|
||||||
"prepare": "husky install",
|
"prepare": "husky install",
|
||||||
"postinstall": "patch-package",
|
"postinstall": "patch-package",
|
||||||
"release": "standard-version",
|
"release": "standard-version",
|
||||||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md"
|
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md"
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
|
||||||
"*.{vue,js,jsx,ts,tsx,json}": "eslint --fix"
|
|
||||||
},
|
|
||||||
"config": {
|
|
||||||
"commitizen": {
|
|
||||||
"path": "./node_modules/cz-customizable"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@antv/data-set": "^0.11.8",
|
"@antv/data-set": "^0.11.8",
|
||||||
"@antv/g2": "^4.2.5",
|
"@antv/g2": "^4.2.5",
|
||||||
@ -64,28 +84,20 @@
|
|||||||
"@iconify/json": "^2.1.87",
|
"@iconify/json": "^2.1.87",
|
||||||
"@iconify/vue": "^3.2.1",
|
"@iconify/vue": "^3.2.1",
|
||||||
"@milahu/patch-package": "^6.4.14",
|
"@milahu/patch-package": "^6.4.14",
|
||||||
|
"@soybeanjs/eslint-config": "^0.2.4",
|
||||||
"@types/bmapgl": "^0.0.5",
|
"@types/bmapgl": "^0.0.5",
|
||||||
"@types/crypto-js": "^4.1.1",
|
"@types/crypto-js": "^4.1.1",
|
||||||
"@types/node": "^18.6.4",
|
"@types/node": "^18.6.4",
|
||||||
"@types/qs": "^6.9.7",
|
"@types/qs": "^6.9.7",
|
||||||
"@types/ua-parser-js": "^0.7.36",
|
"@types/ua-parser-js": "^0.7.36",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.32.0",
|
|
||||||
"@typescript-eslint/parser": "^5.32.0",
|
|
||||||
"@vitejs/plugin-vue": "^3.0.1",
|
"@vitejs/plugin-vue": "^3.0.1",
|
||||||
"@vitejs/plugin-vue-jsx": "^2.0.0",
|
"@vitejs/plugin-vue-jsx": "^2.0.0",
|
||||||
"@vue/eslint-config-prettier": "^7.0.0",
|
|
||||||
"@vue/eslint-config-typescript": "^11.0.0",
|
|
||||||
"commitizen": "^4.2.5",
|
"commitizen": "^4.2.5",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"cz-conventional-changelog": "^3.3.0",
|
"cz-conventional-changelog": "^3.3.0",
|
||||||
"cz-customizable": "^6.9.1",
|
"cz-customizable": "^6.9.1",
|
||||||
"eslint": "^8.21.0",
|
"eslint": "^8.21.0",
|
||||||
"eslint-config-airbnb-base": "^15.0.0",
|
|
||||||
"eslint-config-prettier": "^8.5.0",
|
|
||||||
"eslint-import-resolver-alias": "^1.1.2",
|
"eslint-import-resolver-alias": "^1.1.2",
|
||||||
"eslint-plugin-import": "^2.26.0",
|
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
|
||||||
"eslint-plugin-vue": "9.3.0",
|
|
||||||
"husky": "^8.0.1",
|
"husky": "^8.0.1",
|
||||||
"lint-staged": "^13.0.3",
|
"lint-staged": "^13.0.3",
|
||||||
"mockjs": "^1.1.0",
|
"mockjs": "^1.1.0",
|
||||||
@ -104,35 +116,14 @@
|
|||||||
"vite-plugin-html": "^3.2.0",
|
"vite-plugin-html": "^3.2.0",
|
||||||
"vite-plugin-mock": "^2.9.6",
|
"vite-plugin-mock": "^2.9.6",
|
||||||
"vite-plugin-svg-icons": "^2.0.1",
|
"vite-plugin-svg-icons": "^2.0.1",
|
||||||
"vue-eslint-parser": "^9.0.3",
|
|
||||||
"vue-tsc": "^0.39.5"
|
"vue-tsc": "^0.39.5"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/honghuangdc/soybean-admin",
|
"lint-staged": {
|
||||||
"description": "A fresh and elegant admin template, based on Vue3、Vite3、TypeScript、NaiveUI and UnoCSS. 一个基于Vue3、Vite3、TypeScript、NaiveUI and UnoCSS的清新优雅的中后台模版。",
|
"*.{vue,js,jsx,ts,tsx,json}": "eslint --fix"
|
||||||
"keywords": [
|
|
||||||
"Vue",
|
|
||||||
"Vue3",
|
|
||||||
"admin",
|
|
||||||
"admin-template",
|
|
||||||
"vue-admin",
|
|
||||||
"vue-admin-template",
|
|
||||||
"Vite3",
|
|
||||||
"Vite",
|
|
||||||
"vite-admin",
|
|
||||||
"TypeScript",
|
|
||||||
"TS",
|
|
||||||
"NaiveUI",
|
|
||||||
"naive-ui",
|
|
||||||
"naive-admin",
|
|
||||||
"NaiveUI-Admin",
|
|
||||||
"naive-ui-admin",
|
|
||||||
"UnoCSS"
|
|
||||||
],
|
|
||||||
"repository": {
|
|
||||||
"url": "https://github.com/honghuangdc/soybean-admin.git"
|
|
||||||
},
|
},
|
||||||
"bugs": {
|
"config": {
|
||||||
"url": "https://github.com/honghuangdc/soybean-admin/issues"
|
"commitizen": {
|
||||||
},
|
"path": "./node_modules/cz-customizable"
|
||||||
"license": "MIT"
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { zhCN, dateZhCN } from 'naive-ui';
|
import { dateZhCN, zhCN } from 'naive-ui';
|
||||||
import { useThemeStore, subscribeStore } from '@/store';
|
import { subscribeStore, useThemeStore } from '@/store';
|
||||||
import { useGlobalEvents } from '@/composables';
|
import { useGlobalEvents } from '@/composables';
|
||||||
|
|
||||||
const theme = useThemeStore();
|
const theme = useThemeStore();
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, watch, nextTick, onUnmounted } from 'vue';
|
import { computed, nextTick, onUnmounted, watch } from 'vue';
|
||||||
import { NETWORK_ERROR_MSG } from '@/config';
|
import { NETWORK_ERROR_MSG } from '@/config';
|
||||||
import { useBoolean } from '@/hooks';
|
import { useBoolean } from '@/hooks';
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { defineComponent, h } from 'vue';
|
import { defineComponent, h } from 'vue';
|
||||||
import { useLoadingBar, useDialog, useMessage, useNotification } from 'naive-ui';
|
import { useDialog, useLoadingBar, useMessage, useNotification } from 'naive-ui';
|
||||||
|
|
||||||
defineOptions({ name: 'NaiveProvider' });
|
defineOptions({ name: 'NaiveProvider' });
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed, watch, onMounted } from 'vue';
|
import { computed, onMounted, ref, watch } from 'vue';
|
||||||
import { useElementSize } from '@vueuse/core';
|
import { useElementSize } from '@vueuse/core';
|
||||||
import BScroll from '@better-scroll/core';
|
import BScroll from '@better-scroll/core';
|
||||||
import type { Options } from '@better-scroll/core';
|
import type { Options } from '@better-scroll/core';
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
<span>{{ value }}</span>
|
<span>{{ value }}</span>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, computed, onMounted, watch, watchEffect } from 'vue';
|
import { computed, onMounted, ref, watch, watchEffect } from 'vue';
|
||||||
import { useTransition, TransitionPresets } from '@vueuse/core';
|
import { TransitionPresets, useTransition } from '@vueuse/core';
|
||||||
import { isNumber } from '@/utils';
|
import { isNumber } from '@/utils';
|
||||||
|
|
||||||
defineOptions({ name: 'CountTo' });
|
defineOptions({ name: 'CountTo' });
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, computed } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
import { Icon } from '@iconify/vue';
|
import { Icon } from '@iconify/vue';
|
||||||
import { useThemeStore } from '@/store';
|
import { useThemeStore } from '@/store';
|
||||||
|
|
||||||
|
@ -1,32 +1,32 @@
|
|||||||
import { ref, watch, nextTick, onUnmounted } from 'vue';
|
import { nextTick, onUnmounted, ref, watch } from 'vue';
|
||||||
import type { Ref, ComputedRef } from 'vue';
|
import type { ComputedRef, Ref } from 'vue';
|
||||||
import * as echarts from 'echarts/core';
|
import * as echarts from 'echarts/core';
|
||||||
import { BarChart, LineChart, PieChart, ScatterChart, PictorialBarChart, RadarChart, GaugeChart } from 'echarts/charts';
|
import { BarChart, GaugeChart, LineChart, PictorialBarChart, PieChart, RadarChart, ScatterChart } from 'echarts/charts';
|
||||||
import type {
|
import type {
|
||||||
BarSeriesOption,
|
BarSeriesOption,
|
||||||
|
GaugeSeriesOption,
|
||||||
LineSeriesOption,
|
LineSeriesOption,
|
||||||
PieSeriesOption,
|
|
||||||
ScatterSeriesOption,
|
|
||||||
PictorialBarSeriesOption,
|
PictorialBarSeriesOption,
|
||||||
|
PieSeriesOption,
|
||||||
RadarSeriesOption,
|
RadarSeriesOption,
|
||||||
GaugeSeriesOption
|
ScatterSeriesOption
|
||||||
} from 'echarts/charts';
|
} from 'echarts/charts';
|
||||||
import {
|
import {
|
||||||
TitleComponent,
|
|
||||||
LegendComponent,
|
|
||||||
TooltipComponent,
|
|
||||||
GridComponent,
|
|
||||||
DatasetComponent,
|
DatasetComponent,
|
||||||
TransformComponent,
|
GridComponent,
|
||||||
ToolboxComponent
|
LegendComponent,
|
||||||
|
TitleComponent,
|
||||||
|
ToolboxComponent,
|
||||||
|
TooltipComponent,
|
||||||
|
TransformComponent
|
||||||
} from 'echarts/components';
|
} from 'echarts/components';
|
||||||
import type {
|
import type {
|
||||||
TitleComponentOption,
|
DatasetComponentOption,
|
||||||
LegendComponentOption,
|
|
||||||
TooltipComponentOption,
|
|
||||||
GridComponentOption,
|
GridComponentOption,
|
||||||
|
LegendComponentOption,
|
||||||
|
TitleComponentOption,
|
||||||
ToolboxComponentOption,
|
ToolboxComponentOption,
|
||||||
DatasetComponentOption
|
TooltipComponentOption
|
||||||
} from 'echarts/components';
|
} from 'echarts/components';
|
||||||
import { LabelLayout, UniversalTransition } from 'echarts/features';
|
import { LabelLayout, UniversalTransition } from 'echarts/features';
|
||||||
import { CanvasRenderer } from 'echarts/renderers';
|
import { CanvasRenderer } from 'echarts/renderers';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useEventListener } from '@vueuse/core';
|
import { useEventListener } from '@vueuse/core';
|
||||||
import { useThemeStore, useTabStore } from '@/store';
|
import { useTabStore, useThemeStore } from '@/store';
|
||||||
|
|
||||||
/** 全局事件 */
|
/** 全局事件 */
|
||||||
export function useGlobalEvents() {
|
export function useGlobalEvents() {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { useBreakpoints, breakpointsTailwind } from '@vueuse/core';
|
import { breakpointsTailwind, useBreakpoints } from '@vueuse/core';
|
||||||
import { useAppStore, useThemeStore } from '@/store';
|
import { useAppStore, useThemeStore } from '@/store';
|
||||||
|
|
||||||
type LayoutMode = 'vertical' | 'horizontal';
|
type LayoutMode = 'vertical' | 'horizontal';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { ref, computed } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
import { useBoolean } from '../common';
|
import { useBoolean } from '../common';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -7,7 +7,7 @@ import { useBoolean } from '../common';
|
|||||||
*/
|
*/
|
||||||
export default function useCountDown(second: number) {
|
export default function useCountDown(second: number) {
|
||||||
if (second <= 0 && second % 1 !== 0) {
|
if (second <= 0 && second % 1 !== 0) {
|
||||||
throw Error('倒计时的时间应该为一个正整数!');
|
throw new Error('倒计时的时间应该为一个正整数!');
|
||||||
}
|
}
|
||||||
const { bool: isComplete, setTrue, setFalse } = useBoolean(false);
|
const { bool: isComplete, setTrue, setFalse } = useBoolean(false);
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { ref, onMounted } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 绘制图形验证码
|
* 绘制图形验证码
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { provide, inject } from 'vue';
|
import { inject, provide } from 'vue';
|
||||||
import type { InjectionKey } from 'vue';
|
import type { InjectionKey } from 'vue';
|
||||||
|
|
||||||
/** 创建共享上下文状态 */
|
/** 创建共享上下文状态 */
|
||||||
|
@ -38,13 +38,13 @@ import { useAppStore, useThemeStore } from '@/store';
|
|||||||
import { useBasicLayout } from '@/composables';
|
import { useBasicLayout } from '@/composables';
|
||||||
import { useBoolean } from '@/hooks';
|
import { useBoolean } from '@/hooks';
|
||||||
import {
|
import {
|
||||||
SettingDrawer,
|
GlobalBackTop,
|
||||||
GlobalHeader,
|
|
||||||
GlobalTab,
|
|
||||||
GlobalSider,
|
|
||||||
GlobalContent,
|
GlobalContent,
|
||||||
GlobalFooter,
|
GlobalFooter,
|
||||||
GlobalBackTop
|
GlobalHeader,
|
||||||
|
GlobalSider,
|
||||||
|
GlobalTab,
|
||||||
|
SettingDrawer
|
||||||
} from '../common';
|
} from '../common';
|
||||||
|
|
||||||
defineOptions({ name: 'BasicLayout' });
|
defineOptions({ name: 'BasicLayout' });
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useAppStore, useThemeStore, useRouteStore } from '@/store';
|
import { useAppStore, useRouteStore, useThemeStore } from '@/store';
|
||||||
|
|
||||||
defineOptions({ name: 'GlobalContent' });
|
defineOptions({ name: 'GlobalContent' });
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { routePath } from '@/router';
|
import { routePath } from '@/router';
|
||||||
import { useThemeStore, useRouteStore } from '@/store';
|
import { useRouteStore, useThemeStore } from '@/store';
|
||||||
import { useRouterPush } from '@/composables';
|
import { useRouterPush } from '@/composables';
|
||||||
import { getBreadcrumbByRouteKey } from '@/utils';
|
import { getBreadcrumbByRouteKey } from '@/utils';
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, computed } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
import { useThemeStore } from '@/store';
|
import { useThemeStore } from '@/store';
|
||||||
import { useBoolean } from '@/hooks';
|
import { useBoolean } from '@/hooks';
|
||||||
import MessageList from './MessageList.vue';
|
import MessageList from './MessageList.vue';
|
||||||
|
@ -24,15 +24,15 @@ import { useBasicLayout } from '@/composables';
|
|||||||
import GlobalLogo from '../GlobalLogo/index.vue';
|
import GlobalLogo from '../GlobalLogo/index.vue';
|
||||||
import GlobalSearch from '../GlobalSearch/index.vue';
|
import GlobalSearch from '../GlobalSearch/index.vue';
|
||||||
import {
|
import {
|
||||||
MenuCollapse,
|
FullScreen,
|
||||||
|
GithubSite,
|
||||||
GlobalBreadcrumb,
|
GlobalBreadcrumb,
|
||||||
HeaderMenu,
|
HeaderMenu,
|
||||||
GithubSite,
|
MenuCollapse,
|
||||||
FullScreen,
|
SettingButton,
|
||||||
ThemeMode,
|
|
||||||
UserAvatar,
|
|
||||||
SystemMessage,
|
SystemMessage,
|
||||||
SettingButton
|
ThemeMode,
|
||||||
|
UserAvatar
|
||||||
} from './components';
|
} from './components';
|
||||||
|
|
||||||
defineOptions({ name: 'GlobalHeader' });
|
defineOptions({ name: 'GlobalHeader' });
|
||||||
|
@ -24,9 +24,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, shallowRef, computed, watch, nextTick } from 'vue';
|
import { computed, nextTick, ref, shallowRef, watch } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { useDebounceFn, onKeyStroke } from '@vueuse/core';
|
import { onKeyStroke, useDebounceFn } from '@vueuse/core';
|
||||||
import { useRouteStore } from '@/store';
|
import { useRouteStore } from '@/store';
|
||||||
import SearchResult from './SearchResult.vue';
|
import SearchResult from './SearchResult.vue';
|
||||||
import SearchFooter from './SearchFooter.vue';
|
import SearchFooter from './SearchFooter.vue';
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed, watch } from 'vue';
|
import { computed, ref, watch } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import type { MenuOption } from 'naive-ui';
|
import type { MenuOption } from 'naive-ui';
|
||||||
import { useAppStore, useThemeStore } from '@/store';
|
import { useAppStore, useThemeStore } from '@/store';
|
||||||
|
@ -23,11 +23,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref, watch } from 'vue';
|
import { computed, ref, watch } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useAppStore, useThemeStore, useRouteStore } from '@/store';
|
import { useAppStore, useRouteStore, useThemeStore } from '@/store';
|
||||||
import { useRouterPush } from '@/composables';
|
import { useRouterPush } from '@/composables';
|
||||||
import { useBoolean } from '@/hooks';
|
import { useBoolean } from '@/hooks';
|
||||||
import { GlobalLogo } from '@/layouts/common';
|
import { GlobalLogo } from '@/layouts/common';
|
||||||
import { MixMenuDetail, MixMenuDrawer, MixMenuCollapse } from './components';
|
import { MixMenuCollapse, MixMenuDetail, MixMenuDrawer } from './components';
|
||||||
|
|
||||||
defineOptions({ name: 'VerticalMixSider' });
|
defineOptions({ name: 'VerticalMixSider' });
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
:collapsed="app.siderCollapse"
|
:collapsed="app.siderCollapse"
|
||||||
:collapsed-width="theme.sider.collapsedWidth"
|
:collapsed-width="theme.sider.collapsedWidth"
|
||||||
:collapsed-icon-size="22"
|
:collapsed-icon-size="22"
|
||||||
:options="routeStore.menus"
|
:options="menus"
|
||||||
:expanded-keys="expandedKeys"
|
:expanded-keys="expandedKeys"
|
||||||
:indent="18"
|
:indent="18"
|
||||||
:inverted="theme.sider.inverted"
|
:inverted="theme.sider.inverted"
|
||||||
@ -19,7 +19,7 @@
|
|||||||
import { computed, ref, watch } from 'vue';
|
import { computed, ref, watch } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import type { MenuOption } from 'naive-ui';
|
import type { MenuOption } from 'naive-ui';
|
||||||
import { useAppStore, useThemeStore, useRouteStore } from '@/store';
|
import { useAppStore, useRouteStore, useThemeStore } from '@/store';
|
||||||
import { useRouterPush } from '@/composables';
|
import { useRouterPush } from '@/composables';
|
||||||
import { getActiveKeyPathsOfMenus } from '@/utils';
|
import { getActiveKeyPathsOfMenus } from '@/utils';
|
||||||
|
|
||||||
@ -31,6 +31,8 @@ const theme = useThemeStore();
|
|||||||
const routeStore = useRouteStore();
|
const routeStore = useRouteStore();
|
||||||
const { routerPush } = useRouterPush();
|
const { routerPush } = useRouterPush();
|
||||||
|
|
||||||
|
const menus = computed(() => routeStore.menus as GlobalMenuOption[]);
|
||||||
|
|
||||||
const activeKey = computed(() => (route.meta?.activeMenu ? route.meta.activeMenu : route.name) as string);
|
const activeKey = computed(() => (route.meta?.activeMenu ? route.meta.activeMenu : route.name) as string);
|
||||||
const expandedKeys = ref<string[]>([]);
|
const expandedKeys = ref<string[]>([]);
|
||||||
|
|
||||||
@ -46,7 +48,7 @@ function handleUpdateExpandedKeys(keys: string[]) {
|
|||||||
watch(
|
watch(
|
||||||
() => route.name,
|
() => route.name,
|
||||||
() => {
|
() => {
|
||||||
expandedKeys.value = getActiveKeyPathsOfMenus(activeKey.value, routeStore.menus);
|
expandedKeys.value = getActiveKeyPathsOfMenus(activeKey.value, menus.value);
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { useThemeStore } from '@/store';
|
import { useThemeStore } from '@/store';
|
||||||
import { VerticalSider, VerticalMixSider } from './components';
|
import { VerticalMixSider, VerticalSider } from './components';
|
||||||
|
|
||||||
defineOptions({ name: 'GlobalSider' });
|
defineOptions({ name: 'GlobalSider' });
|
||||||
|
|
||||||
|
@ -26,10 +26,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, computed, nextTick, watch } from 'vue';
|
import { computed, nextTick, reactive, ref, watch } from 'vue';
|
||||||
import { ChromeTab, ButtonTab } from '@soybeanjs/vue-admin-tab';
|
import { ButtonTab, ChromeTab } from '@soybeanjs/vue-admin-tab';
|
||||||
import { Icon } from '@iconify/vue';
|
import { Icon } from '@iconify/vue';
|
||||||
import { useThemeStore, useTabStore } from '@/store';
|
import { useTabStore, useThemeStore } from '@/store';
|
||||||
import { ContextMenu } from './components';
|
import { ContextMenu } from './components';
|
||||||
|
|
||||||
defineOptions({ name: 'TabDetail' });
|
defineOptions({ name: 'TabDetail' });
|
||||||
|
@ -13,9 +13,9 @@
|
|||||||
import { ref, watch } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useElementBounding } from '@vueuse/core';
|
import { useElementBounding } from '@vueuse/core';
|
||||||
import { useThemeStore, useTabStore } from '@/store';
|
import { useTabStore, useThemeStore } from '@/store';
|
||||||
import { useDeviceInfo } from '@/composables';
|
import { useDeviceInfo } from '@/composables';
|
||||||
import { TabDetail, ReloadButton } from './components';
|
import { ReloadButton, TabDetail } from './components';
|
||||||
|
|
||||||
defineOptions({ name: 'GlobalTab' });
|
defineOptions({ name: 'GlobalTab' });
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch, onMounted, onUnmounted } from 'vue';
|
import { onMounted, onUnmounted, ref, watch } from 'vue';
|
||||||
import Clipboard from 'clipboard';
|
import Clipboard from 'clipboard';
|
||||||
import { useThemeStore } from '@/store';
|
import { useThemeStore } from '@/store';
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useAppStore } from '@/store';
|
import { useAppStore } from '@/store';
|
||||||
import { DrawerButton, DarkMode, LayoutMode, ThemeColorSelect, PageFunc, PageView, ThemeConfig } from './components';
|
import { DarkMode, DrawerButton, LayoutMode, PageFunc, PageView, ThemeColorSelect, ThemeConfig } from './components';
|
||||||
|
|
||||||
defineOptions({ name: 'SettingDrawer' });
|
defineOptions({ name: 'SettingDrawer' });
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
import { setupAssets } from './plugins';
|
import App from './App.vue';
|
||||||
import { setupStore } from './store';
|
|
||||||
import { setupDirectives } from './directives';
|
import { setupDirectives } from './directives';
|
||||||
import { setupRouter } from './router';
|
import { setupRouter } from './router';
|
||||||
import App from './App.vue';
|
import { setupAssets } from './plugins';
|
||||||
|
import { setupStore } from './store';
|
||||||
|
|
||||||
async function setupApp() {
|
async function setupApp() {
|
||||||
// import assets: js、css
|
// import assets: js、css
|
||||||
|
@ -6,6 +6,4 @@ import 'virtual:svg-icons-register';
|
|||||||
import '../styles/css/global.css';
|
import '../styles/css/global.css';
|
||||||
|
|
||||||
/** import static assets: css, js , font and so on. - [引入静态资源,css、js和字体文件等] */
|
/** import static assets: css, js , font and so on. - [引入静态资源,css、js和字体文件等] */
|
||||||
export default function setupAssets() {
|
export default function setupAssets() {}
|
||||||
//
|
|
||||||
}
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { RouteLocationNormalized, NavigationGuardNext } from 'vue-router';
|
import type { NavigationGuardNext, RouteLocationNormalized } from 'vue-router';
|
||||||
import { routeName } from '@/router';
|
import { routeName } from '@/router';
|
||||||
import { useRouteStore } from '@/store';
|
import { useRouteStore } from '@/store';
|
||||||
import { getToken } from '@/utils';
|
import { getToken } from '@/utils';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { RouteLocationNormalized, NavigationGuardNext } from 'vue-router';
|
import type { NavigationGuardNext, RouteLocationNormalized } from 'vue-router';
|
||||||
import { routeName } from '@/router';
|
import { routeName } from '@/router';
|
||||||
import { useAuthStore } from '@/store';
|
import { useAuthStore } from '@/store';
|
||||||
import { exeStrategyActions, getToken } from '@/utils';
|
import { exeStrategyActions, getToken } from '@/utils';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import type { App } from 'vue';
|
import type { App } from 'vue';
|
||||||
import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router';
|
import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router';
|
||||||
import { transformAuthRoutesToVueRoutes, transformRouteNameToRoutePath } from '@/utils';
|
import { transformAuthRoutesToVueRoutes, transformRouteNameToRoutePath } from '@/utils';
|
||||||
import { constantRoutes } from './routes';
|
import { constantRoutes } from './routes';
|
||||||
import { scrollBehavior } from './helpers';
|
import { scrollBehavior } from './helpers';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { adapter } from '@/utils';
|
import { adapter } from '@/utils';
|
||||||
import { request, mockRequest } from '../request';
|
import { mockRequest, request } from '../request';
|
||||||
import { adapterOfFetchDataWithAdapter } from './demo.adapter';
|
import { adapterOfFetchDataWithAdapter } from './demo.adapter';
|
||||||
|
|
||||||
/** 带有适配器的请求示例 */
|
/** 带有适配器的请求示例 */
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import type { AxiosRequestConfig } from 'axios';
|
import type { AxiosRequestConfig } from 'axios';
|
||||||
import { useAuthStore } from '@/store';
|
import { useAuthStore } from '@/store';
|
||||||
import { getRefreshToken, setToken, setRefreshToken } from '@/utils';
|
import { getRefreshToken, setRefreshToken, setToken } from '@/utils';
|
||||||
import { fetchUpdateToken } from '../api';
|
import { fetchUpdateToken } from '../api';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import type { AxiosRequestConfig, AxiosInstance, AxiosError } from 'axios';
|
import type { AxiosError, AxiosInstance, AxiosRequestConfig } from 'axios';
|
||||||
import { REFRESH_TOKEN_CODE } from '@/config';
|
import { REFRESH_TOKEN_CODE } from '@/config';
|
||||||
import {
|
import {
|
||||||
getToken,
|
getToken,
|
||||||
transformRequestData,
|
|
||||||
handleAxiosError,
|
handleAxiosError,
|
||||||
handleResponseError,
|
|
||||||
handleBackendError,
|
handleBackendError,
|
||||||
handleServiceResult
|
handleResponseError,
|
||||||
|
handleServiceResult,
|
||||||
|
transformRequestData
|
||||||
} from '@/utils';
|
} from '@/utils';
|
||||||
import { handleRefreshToken } from './helpers';
|
import { handleRefreshToken } from './helpers';
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import type { Ref } from 'vue';
|
import type { Ref } from 'vue';
|
||||||
import type { AxiosInstance, AxiosRequestConfig } from 'axios';
|
import type { AxiosInstance, AxiosRequestConfig } from 'axios';
|
||||||
import { useLoading, useBoolean } from '@/hooks';
|
import { useBoolean, useLoading } from '@/hooks';
|
||||||
import CustomAxiosInstance from './instance';
|
import CustomAxiosInstance from './instance';
|
||||||
|
|
||||||
type RequestMethod = 'get' | 'post' | 'put' | 'delete';
|
type RequestMethod = 'get' | 'post' | 'put' | 'delete';
|
||||||
@ -89,12 +89,12 @@ export function createRequest(axiosConfig: AxiosRequestConfig, backendConfig?: S
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
type RequestResultHook<T = any> = {
|
interface RequestResultHook<T = any> {
|
||||||
data: Ref<T | null>;
|
data: Ref<T | null>;
|
||||||
error: Ref<Service.RequestError | null>;
|
error: Ref<Service.RequestError | null>;
|
||||||
loading: Ref<boolean>;
|
loading: Ref<boolean>;
|
||||||
network: Ref<boolean>;
|
network: Ref<boolean>;
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建hooks请求
|
* 创建hooks请求
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { EnumThemeLayoutMode, EnumThemeTabMode, EnumThemeHorizontalMenuPosition, EnumThemeAnimateMode } from '@/enum';
|
import { EnumThemeAnimateMode, EnumThemeHorizontalMenuPosition, EnumThemeLayoutMode, EnumThemeTabMode } from '@/enum';
|
||||||
import jsonSetting from './theme.json';
|
import jsonSetting from './theme.json';
|
||||||
|
|
||||||
const themeColorList = [
|
const themeColorList = [
|
||||||
|
@ -3,7 +3,7 @@ import { defineStore } from 'pinia';
|
|||||||
import { router } from '@/router';
|
import { router } from '@/router';
|
||||||
import { fetchLogin, fetchUserInfo } from '@/service';
|
import { fetchLogin, fetchUserInfo } from '@/service';
|
||||||
import { useRouterPush } from '@/composables';
|
import { useRouterPush } from '@/composables';
|
||||||
import { getUserInfo, getToken, setUserInfo, setToken, setRefreshToken, clearAuthStorage } from '@/utils';
|
import { clearAuthStorage, getToken, getUserInfo, setRefreshToken, setToken, setUserInfo } from '@/utils';
|
||||||
import { useTabStore } from '../tab';
|
import { useTabStore } from '../tab';
|
||||||
import { useRouteStore } from '../route';
|
import { useRouteStore } from '../route';
|
||||||
|
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { router, ROOT_ROUTE, constantRoutes, routes as staticRoutes } from '@/router';
|
import { ROOT_ROUTE, constantRoutes, router, routes as staticRoutes } from '@/router';
|
||||||
import { fetchUserRoutes } from '@/service';
|
import { fetchUserRoutes } from '@/service';
|
||||||
import {
|
import {
|
||||||
|
filterAuthRoutesByUserPermission,
|
||||||
|
getCacheRoutes,
|
||||||
|
getConstantRouteNames,
|
||||||
getUserInfo,
|
getUserInfo,
|
||||||
transformAuthRouteToMenu,
|
transformAuthRouteToMenu,
|
||||||
transformAuthRoutesToVueRoutes,
|
|
||||||
transformAuthRouteToVueRoute,
|
transformAuthRouteToVueRoute,
|
||||||
transformAuthRoutesToSearchMenus,
|
transformAuthRoutesToSearchMenus,
|
||||||
getCacheRoutes,
|
transformAuthRoutesToVueRoutes,
|
||||||
filterAuthRoutesByUserPermission,
|
|
||||||
transformRoutePathToRouteName,
|
|
||||||
transformRouteNameToRoutePath,
|
transformRouteNameToRoutePath,
|
||||||
getConstantRouteNames
|
transformRoutePathToRouteName
|
||||||
} from '@/utils';
|
} from '@/utils';
|
||||||
import { useAuthStore } from '../auth';
|
import { useAuthStore } from '../auth';
|
||||||
import { useTabStore } from '../tab';
|
import { useTabStore } from '../tab';
|
||||||
@ -66,7 +66,7 @@ export const useRouteStore = defineStore('route-store', {
|
|||||||
* @param routes - 权限路由
|
* @param routes - 权限路由
|
||||||
*/
|
*/
|
||||||
handleAuthRoutes(routes: AuthRoute.Route[]) {
|
handleAuthRoutes(routes: AuthRoute.Route[]) {
|
||||||
this.menus = transformAuthRouteToMenu(routes);
|
(this.menus as GlobalMenuOption[]) = transformAuthRouteToMenu(routes);
|
||||||
this.searchMenus = transformAuthRoutesToSearchMenus(routes);
|
this.searchMenus = transformAuthRoutesToSearchMenus(routes);
|
||||||
|
|
||||||
const vueRoutes = transformAuthRoutesToVueRoutes(routes);
|
const vueRoutes = transformAuthRoutesToVueRoutes(routes);
|
||||||
@ -80,7 +80,7 @@ export const useRouteStore = defineStore('route-store', {
|
|||||||
/** 动态路由模式下:更新根路由的重定向 */
|
/** 动态路由模式下:更新根路由的重定向 */
|
||||||
handleUpdateRootRedirect(routeKey: AuthRoute.RouteKey) {
|
handleUpdateRootRedirect(routeKey: AuthRoute.RouteKey) {
|
||||||
if (routeKey === 'root' || routeKey === 'not-found-page') {
|
if (routeKey === 'root' || routeKey === 'not-found-page') {
|
||||||
throw Error('routeKey的值不能为root或者not-found-page');
|
throw new Error('routeKey的值不能为root或者not-found-page');
|
||||||
}
|
}
|
||||||
const rootRoute: AuthRoute.Route = { ...ROOT_ROUTE, redirect: transformRouteNameToRoutePath(routeKey) };
|
const rootRoute: AuthRoute.Route = { ...ROOT_ROUTE, redirect: transformRouteNameToRoutePath(routeKey) };
|
||||||
const rootRouteName: AuthRoute.RouteKey = 'root';
|
const rootRouteName: AuthRoute.RouteKey = 'root';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import type { RouteRecordNormalized, RouteLocationNormalizedLoaded } from 'vue-router';
|
import type { RouteLocationNormalizedLoaded, RouteRecordNormalized } from 'vue-router';
|
||||||
import { EnumStorageKey } from '@/enum';
|
import { EnumStorageKey } from '@/enum';
|
||||||
import { setLocal, getLocal } from '@/utils';
|
import { getLocal, setLocal } from '@/utils';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据vue路由获取tab路由
|
* 根据vue路由获取tab路由
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
import type { Router, RouteLocationNormalizedLoaded } from 'vue-router';
|
import type { RouteLocationNormalizedLoaded, Router } from 'vue-router';
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { useRouterPush } from '@/composables';
|
import { useRouterPush } from '@/composables';
|
||||||
import { useThemeStore } from '../theme';
|
import { useThemeStore } from '../theme';
|
||||||
import {
|
import {
|
||||||
getTabRouteByVueRoute,
|
clearTabRoutes,
|
||||||
isInTabRoutes,
|
|
||||||
getIndexInTabRoutes,
|
getIndexInTabRoutes,
|
||||||
getIndexInTabRoutesByRouteName,
|
getIndexInTabRoutesByRouteName,
|
||||||
setTabRoutes,
|
getTabRouteByVueRoute,
|
||||||
getTabRoutes,
|
getTabRoutes,
|
||||||
clearTabRoutes
|
isInTabRoutes,
|
||||||
|
setTabRoutes
|
||||||
} from './helpers';
|
} from './helpers';
|
||||||
|
|
||||||
interface TabState {
|
interface TabState {
|
||||||
|
@ -2,7 +2,7 @@ import type { GlobalThemeOverrides } from 'naive-ui';
|
|||||||
import { cloneDeep } from 'lodash-es';
|
import { cloneDeep } from 'lodash-es';
|
||||||
import { themeSetting } from '@/settings';
|
import { themeSetting } from '@/settings';
|
||||||
import { EnumStorageKey } from '@/enum';
|
import { EnumStorageKey } from '@/enum';
|
||||||
import { getThemeColor, getColorPalette, addColorAlpha, setLocal, getLocal, removeLocal } from '@/utils';
|
import { addColorAlpha, getColorPalette, getLocal, getThemeColor, removeLocal, setLocal } from '@/utils';
|
||||||
|
|
||||||
/** 初始化主题配置 */
|
/** 初始化主题配置 */
|
||||||
export function initThemeSettings() {
|
export function initThemeSettings() {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { darkTheme } from 'naive-ui';
|
import { darkTheme } from 'naive-ui';
|
||||||
import { initThemeSettings, getNaiveThemeOverrides, setThemeSettings, clearThemeSettings } from './helpers';
|
import { clearThemeSettings, getNaiveThemeOverrides, initThemeSettings, setThemeSettings } from './helpers';
|
||||||
|
|
||||||
type ThemeState = Theme.Setting;
|
type ThemeState = Theme.Setting;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { watch, onUnmounted } from 'vue';
|
import { onUnmounted, watch } from 'vue';
|
||||||
import { useOsTheme } from 'naive-ui';
|
import { useOsTheme } from 'naive-ui';
|
||||||
import type { GlobalThemeOverrides } from 'naive-ui';
|
import type { GlobalThemeOverrides } from 'naive-ui';
|
||||||
import { useElementSize } from '@vueuse/core';
|
import { useElementSize } from '@vueuse/core';
|
||||||
|
4
src/typings/route.d.ts
vendored
4
src/typings/route.d.ts
vendored
@ -79,7 +79,7 @@ declare namespace AuthRoute {
|
|||||||
type RouteComponent = 'basic' | 'blank' | 'multi' | 'self';
|
type RouteComponent = 'basic' | 'blank' | 'multi' | 'self';
|
||||||
|
|
||||||
/** 路由描述 */
|
/** 路由描述 */
|
||||||
type RouteMeta = {
|
interface RouteMeta {
|
||||||
/** 路由标题(可用来作document.title或者菜单的名称) */
|
/** 路由标题(可用来作document.title或者菜单的名称) */
|
||||||
title: string;
|
title: string;
|
||||||
/** 路由的动态路径(需要动态路径的页面需要将path添加进范型参数) */
|
/** 路由的动态路径(需要动态路径的页面需要将path添加进范型参数) */
|
||||||
@ -111,7 +111,7 @@ declare namespace AuthRoute {
|
|||||||
activeMenu?: RouteKey;
|
activeMenu?: RouteKey;
|
||||||
/** 表示是否是多级路由的中间级路由(用于转换路由数据时筛选多级路由的标识,定义路由时不用填写) */
|
/** 表示是否是多级路由的中间级路由(用于转换路由数据时筛选多级路由的标识,定义路由时不用填写) */
|
||||||
multi?: boolean;
|
multi?: boolean;
|
||||||
};
|
}
|
||||||
|
|
||||||
/** 单个路由的类型结构(动态路由模式:后端返回此类型结构的路由) */
|
/** 单个路由的类型结构(动态路由模式:后端返回此类型结构的路由) */
|
||||||
interface Route {
|
interface Route {
|
||||||
|
2
src/typings/system.d.ts
vendored
2
src/typings/system.d.ts
vendored
@ -265,7 +265,7 @@ interface GlobalHeaderProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 菜单项配置 */
|
/** 菜单项配置 */
|
||||||
type GlobalMenuOption = {
|
type GlobalMenuOption = import('naive-ui').MenuOption & {
|
||||||
key: string;
|
key: string;
|
||||||
label: string;
|
label: string;
|
||||||
routeName: string;
|
routeName: string;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { EnumStorageKey } from '@/enum';
|
import { EnumStorageKey } from '@/enum';
|
||||||
import { setLocal, getLocal, removeLocal } from '../storage';
|
import { getLocal, removeLocal, setLocal } from '../storage';
|
||||||
|
|
||||||
/** 设置token */
|
/** 设置token */
|
||||||
export function setToken(token: string) {
|
export function setToken(token: string) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import type { Ref } from 'vue';
|
import type { Ref } from 'vue';
|
||||||
import type { FormItemRule } from 'naive-ui';
|
import type { FormItemRule } from 'naive-ui';
|
||||||
import { REGEXP_PHONE, REGEXP_PWD, REGEXP_CODE_SIX, REGEXP_EMAIL } from '@/config';
|
import { REGEXP_CODE_SIX, REGEXP_EMAIL, REGEXP_PHONE, REGEXP_PWD } from '@/config';
|
||||||
|
|
||||||
/** 表单规则 */
|
/** 表单规则 */
|
||||||
interface CustomFormRules {
|
interface CustomFormRules {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { iconifyRender, customIconRender } from '../common';
|
import { customIconRender, iconifyRender } from '../common';
|
||||||
|
|
||||||
/** 路由不转换菜单 */
|
/** 路由不转换菜单 */
|
||||||
function hideInMenu(route: AuthRoute.Route) {
|
function hideInMenu(route: AuthRoute.Route) {
|
||||||
@ -74,7 +74,7 @@ function getActiveKeyPathsOfMenu(activeKey: string, menu: GlobalMenuOption) {
|
|||||||
keys.push(menu.routeName);
|
keys.push(menu.routeName);
|
||||||
}
|
}
|
||||||
if (menu.children) {
|
if (menu.children) {
|
||||||
keys.push(...menu.children.map(item => getActiveKeyPathsOfMenu(activeKey, item)).flat(1));
|
keys.push(...menu.children.map(item => getActiveKeyPathsOfMenu(activeKey, item as GlobalMenuOption)).flat(1));
|
||||||
}
|
}
|
||||||
return keys;
|
return keys;
|
||||||
}
|
}
|
||||||
|
@ -2,11 +2,11 @@ import type { AxiosError, AxiosResponse } from 'axios';
|
|||||||
import {
|
import {
|
||||||
DEFAULT_REQUEST_ERROR_CODE,
|
DEFAULT_REQUEST_ERROR_CODE,
|
||||||
DEFAULT_REQUEST_ERROR_MSG,
|
DEFAULT_REQUEST_ERROR_MSG,
|
||||||
|
ERROR_STATUS,
|
||||||
NETWORK_ERROR_CODE,
|
NETWORK_ERROR_CODE,
|
||||||
NETWORK_ERROR_MSG,
|
NETWORK_ERROR_MSG,
|
||||||
REQUEST_TIMEOUT_CODE,
|
REQUEST_TIMEOUT_CODE,
|
||||||
REQUEST_TIMEOUT_MSG,
|
REQUEST_TIMEOUT_MSG
|
||||||
ERROR_STATUS
|
|
||||||
} from '@/config';
|
} from '@/config';
|
||||||
import { exeStrategyActions } from '../common';
|
import { exeStrategyActions } from '../common';
|
||||||
import { showErrorMsg } from './msg';
|
import { showErrorMsg } from './msg';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { NO_ERROR_MSG_CODE, ERROR_MSG_DURATION } from '@/config';
|
import { ERROR_MSG_DURATION, NO_ERROR_MSG_CODE } from '@/config';
|
||||||
|
|
||||||
/** 错误消息栈,防止同一错误同时出现 */
|
/** 错误消息栈,防止同一错误同时出现 */
|
||||||
const errorMsgStack = new Map<string | number, string>([]);
|
const errorMsgStack = new Map<string | number, string>([]);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { encrypto, decrypto } from '../crypto';
|
import { decrypto, encrypto } from '../crypto';
|
||||||
|
|
||||||
interface StorageData {
|
interface StorageData {
|
||||||
value: unknown;
|
value: unknown;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { encrypto, decrypto } from '../crypto';
|
import { decrypto, encrypto } from '../crypto';
|
||||||
|
|
||||||
export function setSession(key: string, value: unknown) {
|
export function setSession(key: string, value: unknown) {
|
||||||
const json = encrypto(value);
|
const json = encrypto(value);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ProjectIntroduction, ProjectInfo, ProDependency, DevDependency } from './components';
|
import { DevDependency, ProDependency, ProjectInfo, ProjectIntroduction } from './components';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import type { DataTableColumn } from 'naive-ui';
|
import type { DataTableColumn } from 'naive-ui';
|
||||||
import { useLoadingEmpty } from '@/hooks';
|
import { useLoadingEmpty } from '@/hooks';
|
||||||
import { getRandomInteger } from '@/utils';
|
import { getRandomInteger } from '@/utils';
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useEcharts, type ECOption } from '@/composables';
|
import { type ECOption, useEcharts } from '@/composables';
|
||||||
|
|
||||||
defineOptions({ name: 'DashboardAnalysisTopCard' });
|
defineOptions({ name: 'DashboardAnalysisTopCard' });
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { TopChart, DataCard, BottomPart } from './components';
|
import { BottomPart, DataCard, TopChart } from './components';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { TechnologyCard, ShortcutsCard } from './components';
|
import { ShortcutsCard, TechnologyCard } from './components';
|
||||||
|
|
||||||
defineOptions({ name: 'DashboardWorkbenchMain' });
|
defineOptions({ name: 'DashboardWorkbenchMain' });
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive, computed, watch } from 'vue';
|
import { computed, reactive, watch } from 'vue';
|
||||||
|
|
||||||
defineOptions({ name: 'TableActionModal' });
|
defineOptions({ name: 'TableActionModal' });
|
||||||
|
|
||||||
|
@ -26,11 +26,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="tsx">
|
<script setup lang="tsx">
|
||||||
import { ref, reactive } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
import { NSwitch, NTag, NSpace, NPopconfirm, NButton } from 'naive-ui';
|
import { NButton, NPopconfirm, NSpace, NSwitch, NTag } from 'naive-ui';
|
||||||
import type { DataTableColumns, PaginationProps } from 'naive-ui';
|
import type { DataTableColumns, PaginationProps } from 'naive-ui';
|
||||||
import { fetchUserManagementList } from '@/service';
|
import { fetchUserManagementList } from '@/service';
|
||||||
import { useLoading, useBoolean } from '@/hooks';
|
import { useBoolean, useLoading } from '@/hooks';
|
||||||
import { TableActionModal } from './components';
|
import { TableActionModal } from './components';
|
||||||
|
|
||||||
const { loading, startLoading, endLoading } = useLoading(false);
|
const { loading, startLoading, endLoading } = useLoading(false);
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import DataSet from '@antv/data-set';
|
import DataSet from '@antv/data-set';
|
||||||
import { Chart } from '@antv/g2';
|
import { Chart } from '@antv/g2';
|
||||||
|
|
||||||
|
@ -25,9 +25,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onUnmounted } from 'vue';
|
import { onUnmounted, ref } from 'vue';
|
||||||
import { graphic } from 'echarts';
|
import { graphic } from 'echarts';
|
||||||
import { useEcharts, type ECOption } from '@/composables';
|
import { type ECOption, useEcharts } from '@/composables';
|
||||||
|
|
||||||
const pieOptions = ref<ECOption>({
|
const pieOptions = ref<ECOption>({
|
||||||
legend: {},
|
legend: {},
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch, onMounted, onUnmounted } from 'vue';
|
import { onMounted, onUnmounted, ref, watch } from 'vue';
|
||||||
import Vditor from 'vditor';
|
import Vditor from 'vditor';
|
||||||
import 'vditor/dist/index.css';
|
import 'vditor/dist/index.css';
|
||||||
import { useThemeStore } from '@/store';
|
import { useThemeStore } from '@/store';
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import WangEditor from 'wangeditor';
|
import WangEditor from 'wangeditor';
|
||||||
|
|
||||||
const editor = ref<WangEditor>();
|
const editor = ref<WangEditor>();
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import { useScriptTag } from '@vueuse/core';
|
import { useScriptTag } from '@vueuse/core';
|
||||||
import { BAIDU_MAP_SDK_URL } from '@/config';
|
import { BAIDU_MAP_SDK_URL } from '@/config';
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import { useScriptTag } from '@vueuse/core';
|
import { useScriptTag } from '@vueuse/core';
|
||||||
import { GAODE_MAP_SDK_URL } from '@/config';
|
import { GAODE_MAP_SDK_URL } from '@/config';
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import { useScriptTag } from '@vueuse/core';
|
import { useScriptTag } from '@vueuse/core';
|
||||||
import { TENCENT_MAP_SDK_URL } from '@/config';
|
import { TENCENT_MAP_SDK_URL } from '@/config';
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { Component } from 'vue';
|
import type { Component } from 'vue';
|
||||||
import { GaodeMap, TencentMap, BaiduMap } from './components';
|
import { BaiduMap, GaodeMap, TencentMap } from './components';
|
||||||
|
|
||||||
interface Map {
|
interface Map {
|
||||||
id: string;
|
id: string;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, onUnmounted } from 'vue';
|
import { onMounted, onUnmounted, ref } from 'vue';
|
||||||
import Player from 'xgplayer';
|
import Player from 'xgplayer';
|
||||||
|
|
||||||
const domRef = ref<HTMLElement>();
|
const domRef = ref<HTMLElement>();
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import { getColorPalette } from '@/utils';
|
import { getColorPalette } from '@/utils';
|
||||||
import { CornerTop, CornerBottom } from './components';
|
import { CornerBottom, CornerTop } from './components';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
/** 主题颜色 */
|
/** 主题颜色 */
|
||||||
|
@ -34,7 +34,7 @@ import { EnumLoginModule } from '@/enum';
|
|||||||
import { useThemeStore } from '@/store';
|
import { useThemeStore } from '@/store';
|
||||||
import { useAppInfo } from '@/composables';
|
import { useAppInfo } from '@/composables';
|
||||||
import { getColorPalette, mixColor } from '@/utils';
|
import { getColorPalette, mixColor } from '@/utils';
|
||||||
import { LoginBg, PwdLogin, CodeLogin, Register, ResetPwd, BindWechat } from './components';
|
import { BindWechat, CodeLogin, LoginBg, PwdLogin, Register, ResetPwd } from './components';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
/** 登录模块分类 */
|
/** 登录模块分类 */
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { defineConfig, loadEnv } from 'vite';
|
import { defineConfig, loadEnv } from 'vite';
|
||||||
import { getRootPath, getSrcPath, viteDefine, setupVitePlugins, createViteProxy } from './build';
|
import { createViteProxy, getRootPath, getSrcPath, setupVitePlugins, viteDefine } from './build';
|
||||||
import { getServiceEnvConfig } from './.env-config';
|
import { getServiceEnvConfig } from './.env-config';
|
||||||
|
|
||||||
export default defineConfig(configEnv => {
|
export default defineConfig(configEnv => {
|
||||||
|
Loading…
Reference in New Issue
Block a user