refactor(projects): 代码优化

This commit is contained in:
Soybean 2022-05-09 20:46:27 +08:00
parent 92b8406444
commit 3590b65e22
11 changed files with 189 additions and 168 deletions

View File

@ -52,6 +52,7 @@ Soybean Admin 是一个基于 Vue3、Vite、TypeScript、Naive UI 的免费中
- [x] 引入ECharts替换AntV G2Plot
- [ ] 多页签同一页面支持多个Tab(应用场景不同query参数的详情页面在不同tab展示)
- [ ] 缓存主题配置
- [ ] 最近功能的有关文档更新
- [ ] 性能优化(优化递归函数)
- [ ] 精简版(新分支thin)

View File

@ -34,7 +34,7 @@
"clipboard": "^2.0.11",
"colord": "^2.9.2",
"crypto-js": "^4.1.1",
"dayjs": "^1.11.1",
"dayjs": "^1.11.2",
"echarts": "^5.3.2",
"form-data": "^4.0.0",
"lodash-es": "^4.17.21",
@ -54,7 +54,7 @@
"@amap/amap-jsapi-types": "^0.0.8",
"@commitlint/cli": "^16.2.4",
"@commitlint/config-conventional": "^16.2.4",
"@iconify/json": "^2.1.37",
"@iconify/json": "^2.1.39",
"@iconify/vue": "^3.2.1",
"@types/bmapgl": "^0.0.5",
"@types/crypto-js": "^4.1.1",
@ -71,13 +71,13 @@
"cross-env": "^7.0.3",
"cz-conventional-changelog": "^3.3.0",
"cz-customizable": "^6.3.0",
"eslint": "^8.14.0",
"eslint": "^8.15.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-vue": "^8.7.1",
"husky": "^7.0.4",
"husky": "^8.0.0",
"lint-staged": "^12.4.1",
"mockjs": "^1.1.0",
"patch-package": "^6.4.7",
@ -87,7 +87,7 @@
"sass": "^1.51.0",
"standard-version": "^9.3.2",
"typescript": "^4.6.4",
"unocss": "^0.32.13",
"unocss": "^0.33.2",
"unplugin-icons": "^0.14.3",
"unplugin-vue-components": "0.19.3",
"unplugin-vue-define-options": "^0.6.1",

View File

@ -5,7 +5,7 @@ specifiers:
'@better-scroll/core': ^2.4.2
'@commitlint/cli': ^16.2.4
'@commitlint/config-conventional': ^16.2.4
'@iconify/json': ^2.1.37
'@iconify/json': ^2.1.39
'@iconify/vue': ^3.2.1
'@soybeanjs/vue-admin-layout': ^1.0.3
'@soybeanjs/vue-admin-tab': ^1.0.1
@ -29,16 +29,16 @@ specifiers:
crypto-js: ^4.1.1
cz-conventional-changelog: ^3.3.0
cz-customizable: ^6.3.0
dayjs: ^1.11.1
dayjs: ^1.11.2
echarts: ^5.3.2
eslint: ^8.14.0
eslint: ^8.15.0
eslint-config-airbnb-base: ^15.0.0
eslint-config-prettier: ^8.5.0
eslint-plugin-import: ^2.26.0
eslint-plugin-prettier: ^4.0.0
eslint-plugin-vue: ^8.7.1
form-data: ^4.0.0
husky: ^7.0.4
husky: ^8.0.0
lint-staged: ^12.4.1
lodash-es: ^4.17.21
mockjs: ^1.1.0
@ -55,7 +55,7 @@ specifiers:
swiper: ^8.1.4
typescript: ^4.6.4
ua-parser-js: ^1.0.2
unocss: ^0.32.13
unocss: ^0.33.2
unplugin-icons: ^0.14.3
unplugin-vue-components: 0.19.3
unplugin-vue-define-options: ^0.6.1
@ -80,7 +80,7 @@ dependencies:
clipboard: 2.0.11
colord: 2.9.2
crypto-js: 4.1.1
dayjs: 1.11.1
dayjs: 1.11.2
echarts: 5.3.2
form-data: 4.0.0
lodash-es: 4.17.21
@ -100,30 +100,30 @@ devDependencies:
'@amap/amap-jsapi-types': 0.0.8
'@commitlint/cli': 16.2.4
'@commitlint/config-conventional': 16.2.4
'@iconify/json': 2.1.37
'@iconify/json': 2.1.39
'@iconify/vue': 3.2.1_vue@3.2.33
'@types/bmapgl': 0.0.5
'@types/crypto-js': 4.1.1
'@types/node': 17.0.31
'@types/qs': 6.9.7
'@types/ua-parser-js': 0.7.36
'@typescript-eslint/eslint-plugin': 5.22.0_5b52bb1e77494a9627aef8db6adb10bc
'@typescript-eslint/parser': 5.22.0_eslint@8.14.0+typescript@4.6.4
'@typescript-eslint/eslint-plugin': 5.22.0_9817cbad956b8aa5d1e3d9ec99e4a1e4
'@typescript-eslint/parser': 5.22.0_eslint@8.15.0+typescript@4.6.4
'@vitejs/plugin-vue': 2.3.2_vite@2.9.8+vue@3.2.33
'@vitejs/plugin-vue-jsx': 1.3.10
'@vue/eslint-config-prettier': 7.0.0_eslint@8.14.0+prettier@2.6.2
'@vue/eslint-config-typescript': 10.0.0_c5a7e3b7020994a60f6e2d5bfb76c653
'@vue/eslint-config-prettier': 7.0.0_eslint@8.15.0+prettier@2.6.2
'@vue/eslint-config-typescript': 10.0.0_7f105dc3ebd31cec885fdbbd30d5cc4c
commitizen: 4.2.4
cross-env: 7.0.3
cz-conventional-changelog: 3.3.0
cz-customizable: 6.3.0
eslint: 8.14.0
eslint-config-airbnb-base: 15.0.0_662e1b2e8ef3f6aa5d22c3f7cd670612
eslint-config-prettier: 8.5.0_eslint@8.14.0
eslint-plugin-import: 2.26.0_eslint@8.14.0
eslint-plugin-prettier: 4.0.0_665eb419c9d7860ca0c224f7f6dcdace
eslint-plugin-vue: 8.7.1_eslint@8.14.0
husky: 7.0.4
eslint: 8.15.0
eslint-config-airbnb-base: 15.0.0_3587bf9a15dd535ddd6f5fd34d80da85
eslint-config-prettier: 8.5.0_eslint@8.15.0
eslint-plugin-import: 2.26.0_eslint@8.15.0
eslint-plugin-prettier: 4.0.0_440b30a60bbe5bb6e3ad0057150b2782
eslint-plugin-vue: 8.7.1_eslint@8.15.0
husky: 8.0.0
lint-staged: 12.4.1
mockjs: 1.1.0
patch-package: 6.4.7
@ -133,7 +133,7 @@ devDependencies:
sass: 1.51.0
standard-version: 9.3.2
typescript: 4.6.4
unocss: 0.32.13_vite@2.9.8
unocss: 0.33.2_vite@2.9.8
unplugin-icons: 0.14.3_vite@2.9.8
unplugin-vue-components: 0.19.3_vite@2.9.8+vue@3.2.33
unplugin-vue-define-options: 0.6.1_vite@2.9.8+vue@3.2.33
@ -669,13 +669,13 @@ packages:
/@emotion/hash/0.8.0:
resolution: {integrity: sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow==}
/@eslint/eslintrc/1.2.2:
resolution: {integrity: sha512-lTVWHs7O2hjBFZunXTZYnYqtB9GakA1lnxIf+gKq2nY5gxkkNi/lQvveW6t8gFdOHTg6nG50Xs95PrLqVpcaLg==}
/@eslint/eslintrc/1.2.3:
resolution: {integrity: sha512-uGo44hIwoLGNyduRpjdEpovcbMdd+Nv7amtmJxnKmI8xj6yd5LncmSwDa5NgX/41lIFJtkjD6YdVfgEzPfJ5UA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dependencies:
ajv: 6.12.6
debug: 4.3.4
espree: 9.3.1
espree: 9.3.2
globals: 13.13.0
ignore: 5.2.0
import-fresh: 3.3.0
@ -706,8 +706,8 @@ packages:
engines: {node: '>=6.9.0'}
dev: true
/@iconify/json/2.1.37:
resolution: {integrity: sha512-/uSKjCTFd1T3Z5GRTU3WNe/+QNPiiBBeiObI40GYWSc/dPlI8dahh+QihMmDIkape2FdRVvStB4ZXaS8rzWq6g==}
/@iconify/json/2.1.39:
resolution: {integrity: sha512-iz5ZpJJ8e6s9H+6ZS+JJ8PSZOblDTsT6XFAnzF+kDavuixmWGsS+RJab2Vg4FGXogrrPqlcUmeV2fMgM9gSvKA==}
dependencies:
'@iconify/types': 1.1.0
pathe: 0.2.0
@ -944,7 +944,7 @@ packages:
resolution: {integrity: sha512-N1rW+njavs70y2cApeIw1vLMYXRwfBy+7trgavGuuTfOd7j1Yh7QTRc/yqsPl6ncokt72ZXuxEU0PiCp9bSwNQ==}
dev: true
/@typescript-eslint/eslint-plugin/5.22.0_5b52bb1e77494a9627aef8db6adb10bc:
/@typescript-eslint/eslint-plugin/5.22.0_9817cbad956b8aa5d1e3d9ec99e4a1e4:
resolution: {integrity: sha512-YCiy5PUzpAeOPGQ7VSGDEY2NeYUV1B0swde2e0HzokRsHBYjSdF6DZ51OuRZxVPHx0032lXGLvOMls91D8FXlg==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
@ -955,12 +955,12 @@ packages:
typescript:
optional: true
dependencies:
'@typescript-eslint/parser': 5.22.0_eslint@8.14.0+typescript@4.6.4
'@typescript-eslint/parser': 5.22.0_eslint@8.15.0+typescript@4.6.4
'@typescript-eslint/scope-manager': 5.22.0
'@typescript-eslint/type-utils': 5.22.0_eslint@8.14.0+typescript@4.6.4
'@typescript-eslint/utils': 5.22.0_eslint@8.14.0+typescript@4.6.4
'@typescript-eslint/type-utils': 5.22.0_eslint@8.15.0+typescript@4.6.4
'@typescript-eslint/utils': 5.22.0_eslint@8.15.0+typescript@4.6.4
debug: 4.3.4
eslint: 8.14.0
eslint: 8.15.0
functional-red-black-tree: 1.0.1
ignore: 5.2.0
regexpp: 3.2.0
@ -971,7 +971,7 @@ packages:
- supports-color
dev: true
/@typescript-eslint/parser/5.22.0_eslint@8.14.0+typescript@4.6.4:
/@typescript-eslint/parser/5.22.0_eslint@8.15.0+typescript@4.6.4:
resolution: {integrity: sha512-piwC4krUpRDqPaPbFaycN70KCP87+PC5WZmrWs+DlVOxxmF+zI6b6hETv7Quy4s9wbkV16ikMeZgXsvzwI3icQ==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
@ -985,7 +985,7 @@ packages:
'@typescript-eslint/types': 5.22.0
'@typescript-eslint/typescript-estree': 5.22.0_typescript@4.6.4
debug: 4.3.4
eslint: 8.14.0
eslint: 8.15.0
typescript: 4.6.4
transitivePeerDependencies:
- supports-color
@ -999,7 +999,7 @@ packages:
'@typescript-eslint/visitor-keys': 5.22.0
dev: true
/@typescript-eslint/type-utils/5.22.0_eslint@8.14.0+typescript@4.6.4:
/@typescript-eslint/type-utils/5.22.0_eslint@8.15.0+typescript@4.6.4:
resolution: {integrity: sha512-iqfLZIsZhK2OEJ4cQ01xOq3NaCuG5FQRKyHicA3xhZxMgaxQazLUHbH/B2k9y5i7l3+o+B5ND9Mf1AWETeMISA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
@ -1009,9 +1009,9 @@ packages:
typescript:
optional: true
dependencies:
'@typescript-eslint/utils': 5.22.0_eslint@8.14.0+typescript@4.6.4
'@typescript-eslint/utils': 5.22.0_eslint@8.15.0+typescript@4.6.4
debug: 4.3.4
eslint: 8.14.0
eslint: 8.15.0
tsutils: 3.21.0_typescript@4.6.4
typescript: 4.6.4
transitivePeerDependencies:
@ -1044,7 +1044,7 @@ packages:
- supports-color
dev: true
/@typescript-eslint/utils/5.22.0_eslint@8.14.0+typescript@4.6.4:
/@typescript-eslint/utils/5.22.0_eslint@8.15.0+typescript@4.6.4:
resolution: {integrity: sha512-HodsGb037iobrWSUMS7QH6Hl1kppikjA1ELiJlNSTYf/UdMEwzgj0WIp+lBNb6WZ3zTwb0tEz51j0Wee3iJ3wQ==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
@ -1054,9 +1054,9 @@ packages:
'@typescript-eslint/scope-manager': 5.22.0
'@typescript-eslint/types': 5.22.0
'@typescript-eslint/typescript-estree': 5.22.0_typescript@4.6.4
eslint: 8.14.0
eslint: 8.15.0
eslint-scope: 5.1.1
eslint-utils: 3.0.0_eslint@8.14.0
eslint-utils: 3.0.0_eslint@8.15.0
transitivePeerDependencies:
- supports-color
- typescript
@ -1070,127 +1070,133 @@ packages:
eslint-visitor-keys: 3.3.0
dev: true
/@unocss/cli/0.32.13:
resolution: {integrity: sha512-GhHA/1ghu8rtZjtR8raLsMn7VXnQLFS4Bb5R1bIEyvh8ofLPTdsf2eG5R2vLtNcyLWJpT+04u1MwdgQIExZ57A==}
/@unocss/cli/0.33.2:
resolution: {integrity: sha512-X64DpwvPnHHjTROm+6fZb/HoMl4SYzaVjNg/XxmGxrbBbh18tbY6rAcjQF6O7TGPVn07ZuSTEGUsH4PsCaOxXg==}
engines: {node: '>=14'}
hasBin: true
dependencies:
'@unocss/config': 0.32.13
'@unocss/core': 0.32.13
'@unocss/preset-uno': 0.32.13
'@unocss/config': 0.33.2
'@unocss/core': 0.33.2
'@unocss/preset-uno': 0.33.2
cac: 6.7.12
chokidar: 3.5.3
colorette: 2.0.16
consola: 2.15.3
fast-glob: 3.2.11
pathe: 0.2.0
pathe: 0.3.0
perfect-debounce: 0.1.3
dev: true
/@unocss/config/0.32.13:
resolution: {integrity: sha512-hLvbyH/J0JbpeYO9hWpsQ/+VBs1yNi9SBdafV98EDB6Xi91gHALEwzqtQ9aEdxABCJaaQ5k85t8R8Dp2k+sYVw==}
/@unocss/config/0.33.2:
resolution: {integrity: sha512-0IntORr7pTYVngdHUS1RUtRFKBJ/wuOy/i9/s2gGYA+Dmh9odZHzB1ExpMckrnGZEjzq6VYX69bDtwSgvl4cyQ==}
engines: {node: '>=14'}
dependencies:
'@unocss/core': 0.32.13
unconfig: 0.3.3
'@unocss/core': 0.33.2
unconfig: 0.3.4
dev: true
/@unocss/core/0.32.13:
resolution: {integrity: sha512-kAQQBO+3wWApkEG25miG32icCh53PNgDH0EJmbtkc7MRfSVRmH6ibj2YGgLV6nDOkRhfb39aJyIAOJXgEAe/9g==}
/@unocss/core/0.33.2:
resolution: {integrity: sha512-o6x1SyO9gUHMhXagUNekZ0Bj/GOg1a2QSorFBg1NoR36GHuX+Uz9UJqzHPx5QS7g2jbJdeR01zG9pwVw0R5Tlg==}
dev: true
/@unocss/inspector/0.32.13:
resolution: {integrity: sha512-sKwKUQAuFtkRGJVdSmJ/sEybMEmJVAMUQes3mIbJbXxiIzd/Yfnab3Jk9Sf4a9xY+lOGb/NIXH6adfPO8fFiug==}
/@unocss/inspector/0.33.2:
resolution: {integrity: sha512-3/DwcEvnrnIMDL0pCSAkFQoEDR64H/U+WP78vczF1gwBYXGp+feBSBCKvUy7EjU1SWzFh6FW821oSjhyyM8P8A==}
dependencies:
gzip-size: 6.0.0
sirv: 2.0.2
dev: true
/@unocss/preset-attributify/0.32.13:
resolution: {integrity: sha512-vrrg54HrrVV6nXQ+eLAZ3Df21yxzXq40Kqc6lF5yRJpZIFxArDFRiFJkJkWFeU+INuItsv5oqGr9wDN0prgkfw==}
/@unocss/preset-attributify/0.33.2:
resolution: {integrity: sha512-07SAPb/ehSDoigk80ivyGQcY0QqIonN99v8uZCZR4GtYaSJ8jHjL17TlXoWYMbbB26qdc0XxwWyajD2bQw1NaQ==}
dependencies:
'@unocss/core': 0.32.13
'@unocss/core': 0.33.2
dev: true
/@unocss/preset-icons/0.32.13:
resolution: {integrity: sha512-usYuonV/gM1rZKyLqBHM9O9wg+1NVCz+N6nhNj8HUjzDbDnEcn+Np1LfE6ZX5rEmzlprlpdCc4zTMwdY+Leo5g==}
/@unocss/preset-icons/0.33.2:
resolution: {integrity: sha512-KU5TFR1teW3FEtronf3ihVFK68UU+9h62umSxoxJtn9W7wsX/NXzysl2UN6usbWLcg6TjCpZAyPtuap1/29XSg==}
dependencies:
'@iconify/utils': 1.0.32
'@unocss/core': 0.32.13
'@unocss/core': 0.33.2
transitivePeerDependencies:
- supports-color
dev: true
/@unocss/preset-mini/0.32.13:
resolution: {integrity: sha512-sRr/QQ0OqI1e9v8AVnwVJIlwuWQrzYN8D2Of1e9T7+44AFZxOZEKy7O8VYHjZY5w0CWzYWkGRrshkZUXPwpOhA==}
/@unocss/preset-mini/0.33.2:
resolution: {integrity: sha512-Fa+BD5kGo3YQ87A67GzkLhxLzyL5LGyHTlnGsktMQOpcLVpiQKnWAjleCfDN3joSUcX/j7Yny+ruOR1XEFvrrQ==}
dependencies:
'@unocss/core': 0.32.13
'@unocss/core': 0.33.2
dev: true
/@unocss/preset-typography/0.32.13:
resolution: {integrity: sha512-NzR+DAzX25JBR71i/zai21NebEHFXitHsaGvDCKpsQ/bwLQ6bLNKSAjT1y2dDzF9FSn5T0mk48fSMVgX+7EKFg==}
/@unocss/preset-typography/0.33.2:
resolution: {integrity: sha512-ArR/a3K4yEcUkJN6woHw6ClCHUBsKK0wcpZDJkcIOyJJI/a8NkNmJdH7uNAn1SnX4nyOIkdD2WTF3kU4f+mhVA==}
dependencies:
'@unocss/core': 0.32.13
'@unocss/core': 0.33.2
dev: true
/@unocss/preset-uno/0.32.13:
resolution: {integrity: sha512-lJuI2hU4nwLkaCUzKoMHNvxVG2MXA9zpZxg48npsTu20LV+8zvKPo3PqssaY6+DgJkKd6tNMX0pLvGhDxWtxWQ==}
/@unocss/preset-uno/0.33.2:
resolution: {integrity: sha512-iFmYzGXicf8ny4lg5wGK9pGFmDbih2qWYZnNFS1PWwWe4a1rNJUO2ZKi0XesSvdTNNyrxzvWv+39rikGhlDwyw==}
dependencies:
'@unocss/core': 0.32.13
'@unocss/preset-mini': 0.32.13
'@unocss/preset-wind': 0.32.13
'@unocss/core': 0.33.2
'@unocss/preset-mini': 0.33.2
'@unocss/preset-wind': 0.33.2
dev: true
/@unocss/preset-web-fonts/0.32.13:
resolution: {integrity: sha512-6vGO8ciFDxUULH4Qo9EdzDdpDpb46VDaImAMz5c52hOiazYMiDg+hHgCLbHDHX4TCPxgCeEmnr/yPA62zN/MOw==}
/@unocss/preset-web-fonts/0.33.2:
resolution: {integrity: sha512-PxMhZiM5WpqXpSSUlJ+46au+te/ZJ77dpyv3HJ0leiMxUx3UWkUKOlNWyBUPWO61EpxlXisLEmdhEU/xyZ318g==}
dependencies:
'@unocss/core': 0.32.13
'@unocss/core': 0.33.2
ohmyfetch: 0.4.16
dev: true
/@unocss/preset-wind/0.32.13:
resolution: {integrity: sha512-/T9Y0rMAQj00a3Al38R04XAoEYz/2uBhsmIs5tLq2N+Gzxs0AxoTPyMViIGxpLrh0kxEBPw102dAoeDzZhZHAw==}
/@unocss/preset-wind/0.33.2:
resolution: {integrity: sha512-ecuUaDMxOgflMDXSG+hBZ0C9R8tb36nVmyxctEd6oBBG8Trabd8wuZhlTvq59mEfcDcMtK77lgAfDlJxX+/GSQ==}
dependencies:
'@unocss/core': 0.32.13
'@unocss/preset-mini': 0.32.13
'@unocss/core': 0.33.2
'@unocss/preset-mini': 0.33.2
dev: true
/@unocss/reset/0.31.17:
resolution: {integrity: sha512-g3+bqtM6LetSEJ5NYhi2P4vdP8yVLUQLbNZUdMtggcmHXTY08ISWaJKWmnHptrO13rtRoQ+l9gFc4Y7kRpD7NA==}
dev: false
/@unocss/reset/0.32.13:
resolution: {integrity: sha512-jnufRcqKvJapTQ5HIMWrV35ipxdV3KW1Gv1yIIk63nI071c4p9zKbsWktY7UcCYU47hbE2lJuHc0ShbDrwQ6rQ==}
/@unocss/reset/0.33.2:
resolution: {integrity: sha512-ArrkGVr8OEfCHZ5p3IiCi2sv5qXRJZ45zzhCr6vuwP+7+RbgMiyDKhV5oYqIGu7oxFesgXxeD+nRe/v4tKL33g==}
dev: true
/@unocss/scope/0.32.13:
resolution: {integrity: sha512-yBPjFNTVuct0pQ8Rhcsc2SMJsysqSxOViAAKdodNveXLrmhtXCoUfy2f/UjBVQf8ffBIyKZJs0YKsJFAsOP7Kg==}
/@unocss/scope/0.33.2:
resolution: {integrity: sha512-Pt267ptQwvdefq16dJxxCKTsWEiIdSfUfYv1KLsr7BQB/AFiiJLuRNn1rjUCrdYrLlA7riav9zdVk85x/u0PAg==}
dev: true
/@unocss/transformer-directives/0.32.13:
resolution: {integrity: sha512-dGyyX/BaeX7M+2SY4TYWUHMNoy9TEv631PxQQmo/W9NxQEF9oem7blcojps7xrW0NdI+wYsgCVyr1Op4vMPlZA==}
/@unocss/transformer-compile-class/0.33.2:
resolution: {integrity: sha512-m9whHhhiv93yWyE+Dl5+tBHDItZ+ndiAicNqDYhu1mGsqi4nsPM6xJbbDibiXJWU2W4X+ZA6xhy3GvPkHut+tA==}
dependencies:
'@unocss/core': 0.32.13
'@unocss/core': 0.33.2
dev: true
/@unocss/transformer-directives/0.33.2:
resolution: {integrity: sha512-nv1Fxh5iIJPkS7APVZ8EJqjehKXOh5RVX8E1zIFNe0DPrU4xpzrWD8JT0uJJdkBa4eZakB+ElpErej0yc4mhgg==}
dependencies:
'@unocss/core': 0.33.2
css-tree: 2.1.0
dev: true
/@unocss/transformer-variant-group/0.32.13:
resolution: {integrity: sha512-ylXieTitiwfjofwXvGc7IxulH9uand0AcDZqxDTtco5Ri4NlTZDw4F85nAir+QB6eaiptzUOm8VoYkVUUGl2Mw==}
/@unocss/transformer-variant-group/0.33.2:
resolution: {integrity: sha512-1fk9mYxpnTl6ieLZ3dZ451u0JpVaGy/EzA5CUYQrbXZJKeGcQQzu61okHQOTVAaOXWFkqhiVXbCMSPNGy7HMHA==}
dependencies:
'@unocss/core': 0.32.13
'@unocss/core': 0.33.2
dev: true
/@unocss/vite/0.32.13_vite@2.9.8:
resolution: {integrity: sha512-KKK0zQHPLv2Z5TrprXIwEDxa40sPnaaOsEKLRWy+Ud37LhqNe9qx3ch3lOWZwUuTOxDsvjiojjre5Wso90FwTQ==}
/@unocss/vite/0.33.2_vite@2.9.8:
resolution: {integrity: sha512-oRt1ejtUEHwGMKXfuXy9BiETkeV27J8miOKrlt+tlg/pm2y0h8113C12J0m15FS3cJhls4eBZs5umPr4J+shDw==}
peerDependencies:
vite: ^2.9.0
dependencies:
'@rollup/pluginutils': 4.2.1
'@unocss/config': 0.32.13
'@unocss/core': 0.32.13
'@unocss/inspector': 0.32.13
'@unocss/scope': 0.32.13
'@unocss/transformer-directives': 0.32.13
'@unocss/config': 0.33.2
'@unocss/core': 0.33.2
'@unocss/inspector': 0.33.2
'@unocss/scope': 0.33.2
'@unocss/transformer-directives': 0.33.2
magic-string: 0.26.1
vite: 2.9.8_sass@1.51.0
dev: true
@ -1309,30 +1315,30 @@ packages:
resolution: {integrity: sha512-IiA0SvDrJEgXvVxjNkHPFfDx6SXw0b/TUkqMcDZWNg9fnCAHbTpoo59YfJ9QLFkwa3raau5vSlRVzMSLDnfdtQ==}
dev: false
/@vue/eslint-config-prettier/7.0.0_eslint@8.14.0+prettier@2.6.2:
/@vue/eslint-config-prettier/7.0.0_eslint@8.15.0+prettier@2.6.2:
resolution: {integrity: sha512-/CTc6ML3Wta1tCe1gUeO0EYnVXfo3nJXsIhZ8WJr3sov+cGASr6yuiibJTL6lmIBm7GobopToOuB3B6AWyV0Iw==}
peerDependencies:
eslint: '>= 7.28.0'
prettier: '>= 2.0.0'
dependencies:
eslint: 8.14.0
eslint-config-prettier: 8.5.0_eslint@8.14.0
eslint-plugin-prettier: 4.0.0_665eb419c9d7860ca0c224f7f6dcdace
eslint: 8.15.0
eslint-config-prettier: 8.5.0_eslint@8.15.0
eslint-plugin-prettier: 4.0.0_440b30a60bbe5bb6e3ad0057150b2782
prettier: 2.6.2
dev: true
/@vue/eslint-config-typescript/10.0.0_c5a7e3b7020994a60f6e2d5bfb76c653:
/@vue/eslint-config-typescript/10.0.0_7f105dc3ebd31cec885fdbbd30d5cc4c:
resolution: {integrity: sha512-F94cL8ug3FaYXlCfU5/wiGjk1qeadmoBpRGAOBq+qre3Smdupa59dd6ZJrsfRODpsMPyTG7330juMDsUvpZ3Rw==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
eslint: ^6.2.0 || ^7.0.0 || ^8.0.0
eslint-plugin-vue: ^8.0.1
dependencies:
'@typescript-eslint/eslint-plugin': 5.22.0_5b52bb1e77494a9627aef8db6adb10bc
'@typescript-eslint/parser': 5.22.0_eslint@8.14.0+typescript@4.6.4
eslint: 8.14.0
eslint-plugin-vue: 8.7.1_eslint@8.14.0
vue-eslint-parser: 8.3.0_eslint@8.14.0
'@typescript-eslint/eslint-plugin': 5.22.0_9817cbad956b8aa5d1e3d9ec99e4a1e4
'@typescript-eslint/parser': 5.22.0_eslint@8.15.0+typescript@4.6.4
eslint: 8.15.0
eslint-plugin-vue: 8.7.1_eslint@8.15.0
vue-eslint-parser: 8.3.0_eslint@8.15.0
transitivePeerDependencies:
- supports-color
- typescript
@ -2305,8 +2311,8 @@ packages:
resolution: {integrity: sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==}
dev: true
/dayjs/1.11.1:
resolution: {integrity: sha512-ER7EjqVAMkRRsxNCC5YqJ9d9VQYuWdGt7aiH2qA5R5wt8ZmWaP2dLUSIK6y/kVzLMlmh1Tvu5xUf4M/wdGJ5KA==}
/dayjs/1.11.2:
resolution: {integrity: sha512-F4LXf1OeU9hrSYRPTTj/6FbO4HTjPKXvEIC1P2kcnFurViINCVk3ZV0xAS3XVx9MkMsXbbqlK6hjseaYbgKEHw==}
dev: false
/debug/2.6.9:
@ -2883,7 +2889,7 @@ packages:
engines: {node: '>=10'}
dev: true
/eslint-config-airbnb-base/15.0.0_662e1b2e8ef3f6aa5d22c3f7cd670612:
/eslint-config-airbnb-base/15.0.0_3587bf9a15dd535ddd6f5fd34d80da85:
resolution: {integrity: sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig==}
engines: {node: ^10.12.0 || >=12.0.0}
peerDependencies:
@ -2891,20 +2897,20 @@ packages:
eslint-plugin-import: ^2.25.2
dependencies:
confusing-browser-globals: 1.0.11
eslint: 8.14.0
eslint-plugin-import: 2.26.0_eslint@8.14.0
eslint: 8.15.0
eslint-plugin-import: 2.26.0_eslint@8.15.0
object.assign: 4.1.2
object.entries: 1.1.5
semver: 6.3.0
dev: true
/eslint-config-prettier/8.5.0_eslint@8.14.0:
/eslint-config-prettier/8.5.0_eslint@8.15.0:
resolution: {integrity: sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==}
hasBin: true
peerDependencies:
eslint: '>=7.0.0'
dependencies:
eslint: 8.14.0
eslint: 8.15.0
dev: true
/eslint-import-resolver-node/0.3.6:
@ -2922,7 +2928,7 @@ packages:
find-up: 2.1.0
dev: true
/eslint-plugin-import/2.26.0_eslint@8.14.0:
/eslint-plugin-import/2.26.0_eslint@8.15.0:
resolution: {integrity: sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==}
engines: {node: '>=4'}
peerDependencies:
@ -2932,7 +2938,7 @@ packages:
array.prototype.flat: 1.3.0
debug: 2.6.9
doctrine: 2.1.0
eslint: 8.14.0
eslint: 8.15.0
eslint-import-resolver-node: 0.3.6
eslint-module-utils: 2.7.3
has: 1.0.3
@ -2944,7 +2950,7 @@ packages:
tsconfig-paths: 3.14.1
dev: true
/eslint-plugin-prettier/4.0.0_665eb419c9d7860ca0c224f7f6dcdace:
/eslint-plugin-prettier/4.0.0_440b30a60bbe5bb6e3ad0057150b2782:
resolution: {integrity: sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==}
engines: {node: '>=6.0.0'}
peerDependencies:
@ -2955,25 +2961,25 @@ packages:
eslint-config-prettier:
optional: true
dependencies:
eslint: 8.14.0
eslint-config-prettier: 8.5.0_eslint@8.14.0
eslint: 8.15.0
eslint-config-prettier: 8.5.0_eslint@8.15.0
prettier: 2.6.2
prettier-linter-helpers: 1.0.0
dev: true
/eslint-plugin-vue/8.7.1_eslint@8.14.0:
/eslint-plugin-vue/8.7.1_eslint@8.15.0:
resolution: {integrity: sha512-28sbtm4l4cOzoO1LtzQPxfxhQABararUb1JtqusQqObJpWX2e/gmVyeYVfepizPFne0Q5cILkYGiBoV36L12Wg==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
eslint: ^6.2.0 || ^7.0.0 || ^8.0.0
dependencies:
eslint: 8.14.0
eslint-utils: 3.0.0_eslint@8.14.0
eslint: 8.15.0
eslint-utils: 3.0.0_eslint@8.15.0
natural-compare: 1.4.0
nth-check: 2.0.1
postcss-selector-parser: 6.0.10
semver: 7.3.7
vue-eslint-parser: 8.3.0_eslint@8.14.0
vue-eslint-parser: 8.3.0_eslint@8.15.0
transitivePeerDependencies:
- supports-color
dev: true
@ -2994,13 +3000,13 @@ packages:
estraverse: 5.3.0
dev: true
/eslint-utils/3.0.0_eslint@8.14.0:
/eslint-utils/3.0.0_eslint@8.15.0:
resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==}
engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0}
peerDependencies:
eslint: '>=5'
dependencies:
eslint: 8.14.0
eslint: 8.15.0
eslint-visitor-keys: 2.1.0
dev: true
@ -3014,12 +3020,12 @@ packages:
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dev: true
/eslint/8.14.0:
resolution: {integrity: sha512-3/CE4aJX7LNEiE3i6FeodHmI/38GZtWCsAtsymScmzYapx8q1nVVb+eLcLSzATmCPXw5pT4TqVs1E0OmxAd9tw==}
/eslint/8.15.0:
resolution: {integrity: sha512-GG5USZ1jhCu8HJkzGgeK8/+RGnHaNYZGrGDzUtigK3BsGESW/rs2az23XqE0WVwDxy1VRvvjSSGu5nB0Bu+6SA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
hasBin: true
dependencies:
'@eslint/eslintrc': 1.2.2
'@eslint/eslintrc': 1.2.3
'@humanwhocodes/config-array': 0.9.5
ajv: 6.12.6
chalk: 4.1.2
@ -3028,9 +3034,9 @@ packages:
doctrine: 3.0.0
escape-string-regexp: 4.0.0
eslint-scope: 7.1.1
eslint-utils: 3.0.0_eslint@8.14.0
eslint-utils: 3.0.0_eslint@8.15.0
eslint-visitor-keys: 3.3.0
espree: 9.3.1
espree: 9.3.2
esquery: 1.4.0
esutils: 2.0.3
fast-deep-equal: 3.1.3
@ -3067,6 +3073,15 @@ packages:
eslint-visitor-keys: 3.3.0
dev: true
/espree/9.3.2:
resolution: {integrity: sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dependencies:
acorn: 8.7.1
acorn-jsx: 5.3.2_acorn@8.7.1
eslint-visitor-keys: 3.3.0
dev: true
/esprima/1.2.5:
resolution: {integrity: sha512-S9VbPDU0adFErpDai3qDkjq8+G05ONtKzcyNrPKg/ZKa+tf879nX2KexNU95b31UoTJjRLInNBHHHjFPoCd7lQ==}
engines: {node: '>=0.4.0'}
@ -3714,9 +3729,9 @@ packages:
engines: {node: '>=10.17.0'}
dev: true
/husky/7.0.4:
resolution: {integrity: sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==}
engines: {node: '>=12'}
/husky/8.0.0:
resolution: {integrity: sha512-4qbE/5dzNDNxFEkX9MNRPKl5+omTXQzdILCUWiqG/lWIAioiM5vln265/l6I2Zx8gpW8l1ukZwGQeCFbBZ6+6w==}
engines: {node: '>=14'}
hasBin: true
dev: true
@ -4838,6 +4853,10 @@ packages:
resolution: {integrity: sha512-sTitTPYnn23esFR3RlqYBWn4c45WGeLcsKzQiUpXJAyfcWkolvlYpV8FLo7JishK946oQwMFUCHXQ9AjGPKExw==}
dev: true
/pathe/0.3.0:
resolution: {integrity: sha512-3vUjp552BJzCw9vqKsO5sttHkbYqqsZtH0x1PNtItgqx8BXEXzoY1SYRKcL6BTyVh4lGJGLj0tM42elUDMvcYA==}
dev: true
/perfect-debounce/0.1.3:
resolution: {integrity: sha512-NOT9AcKiDGpnV/HBhI22Str++XWcErO/bALvHCuhv33owZW/CjH8KAFLZDCmu3727sihe0wTxpDhyGc6M8qacQ==}
dev: true
@ -5809,8 +5828,8 @@ packages:
which-boxed-primitive: 1.0.2
dev: true
/unconfig/0.3.3:
resolution: {integrity: sha512-BavyYUbMTk5s7jypXdcS5ZkoqFAzzVt1AT7T9xFjNDCizqdb0YI6yRYRCGBeNp8tK7xnLl2vo7enG+2GxN0+2Q==}
/unconfig/0.3.4:
resolution: {integrity: sha512-cf39F1brwQuLSuMLTYXOdWJH0O1CJee6a4QW1nYtO7SoBUfVvQCvEel6ssTNXtPfi17kop1ADmVtmC49NlFkIQ==}
dependencies:
'@antfu/utils': 0.5.1
defu: 6.0.0
@ -5843,23 +5862,24 @@ packages:
engines: {node: '>= 10.0.0'}
dev: true
/unocss/0.32.13_vite@2.9.8:
resolution: {integrity: sha512-b+H7QIdXb9sR3TImYm7ob2QIxkDfBqZP2eT5eJuv1tQ5+TYYSxHsyeiRNGCpCBcjJoe7cmw27gEl7o+nrBHWJA==}
/unocss/0.33.2_vite@2.9.8:
resolution: {integrity: sha512-ISGmthl9kNPujda/Yt25irdV9s9F3hr8MWpd/NE7Kv/qkZJC3/FvO/l/9d5ggkbgsAuGQrsfuaQnxT2p4k9Yug==}
engines: {node: '>=14'}
dependencies:
'@unocss/cli': 0.32.13
'@unocss/core': 0.32.13
'@unocss/preset-attributify': 0.32.13
'@unocss/preset-icons': 0.32.13
'@unocss/preset-mini': 0.32.13
'@unocss/preset-typography': 0.32.13
'@unocss/preset-uno': 0.32.13
'@unocss/preset-web-fonts': 0.32.13
'@unocss/preset-wind': 0.32.13
'@unocss/reset': 0.32.13
'@unocss/transformer-directives': 0.32.13
'@unocss/transformer-variant-group': 0.32.13
'@unocss/vite': 0.32.13_vite@2.9.8
'@unocss/cli': 0.33.2
'@unocss/core': 0.33.2
'@unocss/preset-attributify': 0.33.2
'@unocss/preset-icons': 0.33.2
'@unocss/preset-mini': 0.33.2
'@unocss/preset-typography': 0.33.2
'@unocss/preset-uno': 0.33.2
'@unocss/preset-web-fonts': 0.33.2
'@unocss/preset-wind': 0.33.2
'@unocss/reset': 0.33.2
'@unocss/transformer-compile-class': 0.33.2
'@unocss/transformer-directives': 0.33.2
'@unocss/transformer-variant-group': 0.33.2
'@unocss/vite': 0.33.2_vite@2.9.8
transitivePeerDependencies:
- supports-color
- vite
@ -6133,14 +6153,14 @@ packages:
vue: 3.2.33
dev: false
/vue-eslint-parser/8.3.0_eslint@8.14.0:
/vue-eslint-parser/8.3.0_eslint@8.15.0:
resolution: {integrity: sha512-dzHGG3+sYwSf6zFBa0Gi9ZDshD7+ad14DGOdTLjruRVgZXe2J+DcZ9iUhyR48z5g1PqRa20yt3Njna/veLJL/g==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
eslint: '>=6.0.0'
dependencies:
debug: 4.3.4
eslint: 8.14.0
eslint: 8.15.0
eslint-scope: 7.1.1
eslint-visitor-keys: 3.3.0
espree: 9.3.1

View File

@ -14,7 +14,6 @@
</template>
<script setup lang="ts">
import { RouterView } from 'vue-router';
import { useAppStore, useThemeStore, useRouteStore } from '@/store';
interface Props {

View File

@ -8,7 +8,6 @@
</template>
<script setup lang="ts">
import { RouterLink } from 'vue-router';
import { routePath } from '@/router';
import { useAppInfo } from '@/composables';

View File

@ -67,7 +67,8 @@ export const useAuthStore = defineStore('auth-store', {
setUserInfo(data);
// 更新状态
Object.assign(this, { userInfo: data, token });
this.userInfo = data;
this.token = token;
// 跳转登录后的地址
toLoginRedirect();

View File

@ -69,7 +69,8 @@ export const useTabStore = defineStore('tab-store', {
*/
addTab(route: RouteLocationNormalizedLoaded) {
if (!isInTabRoutes(this.tabs, route.path)) {
this.tabs.push(getTabRouteByVueRoute(route));
const tab = getTabRouteByVueRoute(route);
this.tabs.push(tab);
}
},
/**

View File

@ -70,7 +70,7 @@ declare namespace AuthRoute {
type RouteMeta = {
/** 路由标题(可用来作document.title或者菜单的名称) */
title: string;
/** 路由的动态路径 */
/** 路由的动态路径(需要动态路径的页面需要将path添加进范型参数) */
dynamicPath?: PathToDynamicPath<'/login'>;
/** 作为单级路由的父级路由布局组件 */
singleLayout?: Extract<RouteComponent, 'basic' | 'blank'>;
@ -85,7 +85,7 @@ declare namespace AuthRoute {
keepAlive?: boolean;
/** 菜单和面包屑对应的图标 */
icon?: string;
/** 是否在菜单中隐藏 */
/** 是否在菜单中隐藏(一些列表、表格的详情页面需要通过参数跳转,所以不能显示在菜单中) */
hide?: boolean;
/** 外链链接 */
href?: string;
@ -140,9 +140,9 @@ declare namespace AuthRoute {
/** 路由path转换动态路径 */
type PathToDynamicPath<Path extends RoutePath> =
| `${Path}/:module`
| `${Path}/:module(${string})`
| `${Path}/:module(${string})?`;
| `${Path}/:${string}`
| `${Path}/:${string}(${string})`
| `${Path}/:${string}(${string})?`;
/** 获取一级路由(包括有子路由的一级路由) */
type GetSingleRouteKey<Key extends RouteKey> = Key extends `${infer _Left}${RouteSplitMark}${infer _Right}`

View File

@ -13,12 +13,13 @@ export function filterAuthRoutesByUserPermission(routes: AuthRoute.Route[], perm
* @param permission -
*/
function filterAuthRouteByUserPermission(route: AuthRoute.Route, permission: Auth.RoleType): AuthRoute.Route[] {
const filterRoute = { ...route };
const hasPermission =
!route.meta.permissions || permission === 'super' || route.meta.permissions.includes(permission);
if (route.children) {
const filterChildren = route.children.map(item => filterAuthRouteByUserPermission(item, permission)).flat(1);
Object.assign(route, { children: filterChildren });
if (filterRoute.children) {
const filterChildren = filterRoute.children.map(item => filterAuthRouteByUserPermission(item, permission)).flat(1);
Object.assign(filterRoute, { children: filterChildren });
}
return hasPermission ? [route] : [];
return hasPermission ? [filterRoute] : [];
}

View File

@ -12,7 +12,6 @@
</template>
<script lang="ts" setup>
import { RouterLink } from 'vue-router';
import { routeName } from '@/router';
type ExceptionType = '403' | '404' | '500';

View File

@ -1,8 +1,8 @@
import { defineConfig, presetMini } from 'unocss';
import { defineConfig, presetUno } from 'unocss';
export default defineConfig({
exclude: ['node_modules', '.git', './stats.html'],
presets: [presetMini({ dark: 'class' })],
presets: [presetUno({ dark: 'class' })],
shortcuts: {
'wh-full': 'w-full h-full',
'flex-center': 'flex justify-center items-center',