Compare commits

..

8 Commits

Author SHA1 Message Date
Soybean
32a7cc408e chore(release): 0.1.3 2022-01-24 00:01:51 +08:00
Soybean
651e58dcb6 refactor(projects): 细节完善 2022-01-24 00:00:59 +08:00
Soybean
b61b0ce25f fix(projects): 修复路由守卫的动态路由逻辑 2022-01-22 16:16:07 +08:00
Soybean
21bab1f7c3 fix(projects): 修复未登录时会调用获取用户路由的接口 2022-01-22 14:05:19 +08:00
Soybean
4f9d544d43 refactor(projects): 请求构造函数适配不同后端接口的数据结构 2022-01-22 03:25:41 +08:00
Soybean
db75c91400 chore(release): 0.1.2 2022-01-22 01:53:21 +08:00
Soybean
37092974d3 feat(projects): 添加缓存主题色 2022-01-22 01:46:56 +08:00
Soybean
1d63a83822 feat(projects): 添加页面缓存、记录在tab中的缓存页面的滚动条位置 2022-01-22 00:01:34 +08:00
68 changed files with 1648 additions and 435 deletions

View File

@@ -1,12 +1,13 @@
/** 请求环境配置 */
type ServiceEnv = {
[key in Service.HttpEnv]: {
type ServiceEnv = Record<
Service.HttpEnv,
{
/** 请求环境 */
env: Service.HttpEnv;
/** 请求地址 */
url: string;
};
};
}
>;
/** 请求的环境 */
export const serviceEnv: ServiceEnv = {

View File

@@ -155,7 +155,7 @@ module.exports = {
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-inferrable-types': 0,
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unused-vars': ['warn', { ignoreRestSiblings: true }],
'@typescript-eslint/no-unused-vars': ['warn', { ignoreRestSiblings: true, varsIgnorePattern: 'Ignored' }],
'@typescript-eslint/no-use-before-define': ['error', { classes: true, functions: false, typedefs: false }],
'@typescript-eslint/no-var-requires': 'off'
}

View File

@@ -2,6 +2,22 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
### [0.1.3](https://github.com/honghuangdc/soybean-admin/compare/v0.1.2...v0.1.3) (2022-01-23)
### Bug Fixes
* **projects:** 修复未登录时会调用获取用户路由的接口 ([21bab1f](https://github.com/honghuangdc/soybean-admin/commit/21bab1f7c30611fe59dc91c7a73050ccb49a4658))
* **projects:** 修复路由守卫的动态路由逻辑 ([b61b0ce](https://github.com/honghuangdc/soybean-admin/commit/b61b0ce25fdcbaf29ca64cbcc467e12faa947625))
### [0.1.2](https://github.com/honghuangdc/soybean-admin/compare/v0.1.1...v0.1.2) (2022-01-21)
### Features
* **projects:** 添加缓存主题色 ([3709297](https://github.com/honghuangdc/soybean-admin/commit/37092974d37b2e661d4cbf9d27c89b5e99119cd7))
* **projects:** 添加页面缓存、记录在tab中的缓存页面的滚动条位置 ([1d63a83](https://github.com/honghuangdc/soybean-admin/commit/1d63a838226df4f48e7f2a15b5a05d4b496d3c69))
### [0.1.1](https://github.com/honghuangdc/soybean-admin/compare/v0.0.5...v0.1.1) (2022-01-20)

View File

@@ -10,7 +10,7 @@ const apis: MockMethod[] = [
{
url: '/mock/getSmsCode',
method: 'post',
response: (): Service.BackendServiceResult<boolean> => {
response: (): Service.MockServiceResult<boolean> => {
return {
code: 200,
message: 'ok',
@@ -22,7 +22,7 @@ const apis: MockMethod[] = [
{
url: '/mock/loginByPwd',
method: 'post',
response: (): Service.BackendServiceResult<ApiAuth.Token> => {
response: (): Service.MockServiceResult<ApiAuth.Token> => {
return {
code: 200,
message: 'ok',
@@ -34,7 +34,7 @@ const apis: MockMethod[] = [
{
url: '/mock/loginByCode',
method: 'post',
response: (): Service.BackendServiceResult<ApiAuth.Token> => {
response: (): Service.MockServiceResult<ApiAuth.Token> => {
return {
code: 200,
message: 'ok',
@@ -46,7 +46,7 @@ const apis: MockMethod[] = [
{
url: '/mock/getUserInfo',
method: 'get',
response: (): Service.BackendServiceResult<ApiAuth.UserInfo> => {
response: (): Service.MockServiceResult<ApiAuth.UserInfo> => {
return {
code: 200,
message: 'ok',
@@ -62,7 +62,7 @@ const apis: MockMethod[] = [
{
url: '/mock/testToken',
method: 'post',
response: (option: any): Service.BackendServiceResult<true | null> => {
response: (option: any): Service.MockServiceResult<true | null> => {
if (option.headers?.authorization !== token.token) {
return {
code: 66666,
@@ -80,7 +80,7 @@ const apis: MockMethod[] = [
{
url: '/mock/updateToken',
method: 'post',
response: (): Service.BackendServiceResult<string> => {
response: (): Service.MockServiceResult<string> => {
return {
code: 200,
message: 'ok',

View File

@@ -11,7 +11,8 @@ const routes: AuthRoute.Route[] = [
path: '/dashboard/analysis',
component: 'self',
meta: {
title: '分析页'
title: '分析页',
requiresAuth: true
}
},
{
@@ -20,13 +21,13 @@ const routes: AuthRoute.Route[] = [
component: 'self',
meta: {
title: '工作台',
requiresAuth: true,
permissions: ['super', 'admin']
}
}
],
meta: {
title: '仪表盘',
requiresAuth: true,
icon: 'carbon:dashboard',
order: 1
}
@@ -41,7 +42,8 @@ const routes: AuthRoute.Route[] = [
path: '/document/vue',
component: 'self',
meta: {
title: 'vue文档'
title: 'vue文档',
requiresAuth: true
}
},
{
@@ -49,7 +51,8 @@ const routes: AuthRoute.Route[] = [
path: '/document/vue-new',
component: 'self',
meta: {
title: 'vue文档(新版)'
title: 'vue文档(新版)',
requiresAuth: true
}
},
{
@@ -57,7 +60,8 @@ const routes: AuthRoute.Route[] = [
path: '/document/vite',
component: 'self',
meta: {
title: 'vite文档'
title: 'vite文档',
requiresAuth: true
}
},
{
@@ -65,7 +69,8 @@ const routes: AuthRoute.Route[] = [
path: '/document/naive',
component: 'self',
meta: {
title: 'naive文档'
title: 'naive文档',
requiresAuth: true
}
},
{
@@ -73,6 +78,7 @@ const routes: AuthRoute.Route[] = [
path: '/document/project',
meta: {
title: '项目文档(外链)',
requiresAuth: true,
href: 'https://docs.soybean.pro/'
}
}
@@ -84,15 +90,42 @@ const routes: AuthRoute.Route[] = [
}
},
{
name: 'about',
path: '/about',
component: 'self',
name: 'component',
path: '/component',
component: 'basic',
children: [
{
name: 'component_button',
path: '/component/button',
component: 'self',
meta: {
title: '按钮',
requiresAuth: true
}
},
{
name: 'component_card',
path: '/component/card',
component: 'self',
meta: {
title: '卡片',
requiresAuth: true
}
},
{
name: 'component_table',
path: '/component/table',
component: 'self',
meta: {
title: '表格',
requiresAuth: true
}
}
],
meta: {
title: '关于',
singleLayout: 'basic',
permissions: ['super', 'admin', 'test'],
icon: 'fluent:book-information-24-regular',
order: 7
title: '组件示例',
icon: 'fluent:app-store-24-regular',
order: 4
}
},
{
@@ -105,7 +138,8 @@ const routes: AuthRoute.Route[] = [
path: '/exception/403',
component: 'self',
meta: {
title: '异常页403'
title: '异常页403',
requiresAuth: true
}
},
{
@@ -113,7 +147,8 @@ const routes: AuthRoute.Route[] = [
path: '/exception/404',
component: 'self',
meta: {
title: '异常页404'
title: '异常页404',
requiresAuth: true
}
},
{
@@ -121,7 +156,8 @@ const routes: AuthRoute.Route[] = [
path: '/exception/500',
component: 'self',
meta: {
title: '异常页500'
title: '异常页500',
requiresAuth: true
}
}
],
@@ -146,7 +182,8 @@ const routes: AuthRoute.Route[] = [
path: '/multi-menu/first/second',
component: 'self',
meta: {
title: '二级菜单'
title: '二级菜单',
requiresAuth: true
}
},
{
@@ -159,7 +196,8 @@ const routes: AuthRoute.Route[] = [
path: '/multi-menu/first/second-new/third',
component: 'self',
meta: {
title: '三级菜单'
title: '三级菜单',
requiresAuth: true
}
}
],
@@ -178,6 +216,19 @@ const routes: AuthRoute.Route[] = [
icon: 'carbon:menu',
order: 6
}
},
{
name: 'about',
path: '/about',
component: 'self',
meta: {
title: '关于',
requiresAuth: true,
singleLayout: 'basic',
permissions: ['super', 'admin', 'test'],
icon: 'fluent:book-information-24-regular',
order: 7
}
}
];
@@ -198,7 +249,7 @@ const apis: MockMethod[] = [
{
url: '/mock/getUserRoutes',
method: 'post',
response: (): Service.BackendServiceResult => {
response: (): Service.MockServiceResult => {
return {
code: 200,
message: 'ok',

View File

@@ -1,6 +1,6 @@
{
"name": "soybean-admin-thin",
"version": "0.1.1",
"version": "0.1.3",
"scripts": {
"dev": "cross-env VITE_HTTP_ENV=test vite",
"dev:prod": "cross-env VITE_HTTP_ENV=prod vite",
@@ -26,7 +26,7 @@
"dependencies": {
"@antv/g2plot": "^2.4.7",
"@better-scroll/core": "^2.4.2",
"@vueuse/core": "^7.5.3",
"@vueuse/core": "^7.5.4",
"axios": "^0.25.0",
"clipboard": "^2.0.8",
"colord": "^2.9.2",
@@ -41,16 +41,16 @@
"vue-router": "^4.0.12"
},
"devDependencies": {
"@commitlint/cli": "^16.0.3",
"@commitlint/cli": "^16.1.0",
"@commitlint/config-conventional": "^16.0.0",
"@iconify/json": "^1.1.458",
"@iconify/json": "^1.1.459",
"@iconify/vue": "^3.1.2",
"@types/crypto-js": "^4.1.0",
"@types/node": "^17.0.10",
"@types/qs": "^6.9.7",
"@typescript-eslint/eslint-plugin": "^5.10.0",
"@typescript-eslint/parser": "^5.10.0",
"@vitejs/plugin-vue": "^2.0.1",
"@vitejs/plugin-vue": "^2.1.0",
"@vue/eslint-config-prettier": "^7.0.0",
"@vue/eslint-config-typescript": "^10.0.0",
"commitizen": "^4.2.4",
@@ -64,21 +64,21 @@
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-vue": "^8.3.0",
"husky": "^7.0.4",
"lint-staged": "^12.2.1",
"lint-staged": "^12.3.1",
"mockjs": "^1.1.0",
"patch-package": "^6.4.7",
"postinstall-postinstall": "^2.1.0",
"prettier": "^2.5.1",
"rollup-plugin-visualizer": "^5.5.4",
"sass": "^1.49.0",
"typescript": "^4.5.4",
"typescript": "^4.5.5",
"unplugin-icons": "^0.13.0",
"unplugin-vue-components": "^0.17.13",
"unplugin-vue-components": "^0.17.14",
"vite": "^2.7.13",
"vite-plugin-html": "^2.1.2",
"vite-plugin-mock": "^2.9.6",
"vite-plugin-windicss": "^1.6.3",
"vue-tsc": "^0.30.6",
"vue-tsc": "^0.31.1",
"vueuc": "^0.4.23",
"windicss": "^3.4.3"
}

421
pnpm-lock.yaml generated
View File

@@ -3,19 +3,19 @@ lockfileVersion: 5.3
specifiers:
'@antv/g2plot': ^2.4.7
'@better-scroll/core': ^2.4.2
'@commitlint/cli': ^16.0.3
'@commitlint/cli': ^16.1.0
'@commitlint/config-conventional': ^16.0.0
'@iconify/json': ^1.1.458
'@iconify/json': ^1.1.459
'@iconify/vue': ^3.1.2
'@types/crypto-js': ^4.1.0
'@types/node': ^17.0.10
'@types/qs': ^6.9.7
'@typescript-eslint/eslint-plugin': ^5.10.0
'@typescript-eslint/parser': ^5.10.0
'@vitejs/plugin-vue': ^2.0.1
'@vitejs/plugin-vue': ^2.1.0
'@vue/eslint-config-prettier': ^7.0.0
'@vue/eslint-config-typescript': ^10.0.0
'@vueuse/core': ^7.5.3
'@vueuse/core': ^7.5.4
axios: ^0.25.0
clipboard: ^2.0.8
colord: ^2.9.2
@@ -33,7 +33,7 @@ specifiers:
eslint-plugin-vue: ^8.3.0
form-data: ^4.0.0
husky: ^7.0.4
lint-staged: ^12.2.1
lint-staged: ^12.3.1
lodash-es: ^4.17.21
mockjs: ^1.1.0
naive-ui: ^2.24.1
@@ -44,23 +44,23 @@ specifiers:
qs: ^6.10.3
rollup-plugin-visualizer: ^5.5.4
sass: ^1.49.0
typescript: ^4.5.4
typescript: ^4.5.5
unplugin-icons: ^0.13.0
unplugin-vue-components: ^0.17.13
unplugin-vue-components: ^0.17.14
vite: ^2.7.13
vite-plugin-html: ^2.1.2
vite-plugin-mock: ^2.9.6
vite-plugin-windicss: ^1.6.3
vue: ^3.2.26
vue-router: ^4.0.12
vue-tsc: ^0.30.6
vue-tsc: ^0.31.1
vueuc: ^0.4.23
windicss: ^3.4.3
dependencies:
'@antv/g2plot': registry.npmmirror.com/@antv/g2plot/2.4.7
'@better-scroll/core': registry.nlark.com/@better-scroll/core/2.4.2
'@vueuse/core': registry.npmmirror.com/@vueuse/core/7.5.3_vue@3.2.26
'@vueuse/core': registry.npmmirror.com/@vueuse/core/7.5.4_vue@3.2.26
axios: registry.npmmirror.com/axios/0.25.0
clipboard: registry.npmmirror.com/clipboard/2.0.8
colord: registry.npmmirror.com/colord/2.9.2
@@ -69,24 +69,24 @@ dependencies:
form-data: registry.nlark.com/form-data/4.0.0
lodash-es: registry.npmmirror.com/lodash-es/4.17.21
naive-ui: registry.npmmirror.com/naive-ui/2.24.1_vue@3.2.26
pinia: registry.npmmirror.com/pinia/2.0.9_typescript@4.5.4+vue@3.2.26
pinia: registry.npmmirror.com/pinia/2.0.9_typescript@4.5.5+vue@3.2.26
qs: registry.npmmirror.com/qs/6.10.3
vue: registry.npmmirror.com/vue/3.2.26
vue-router: registry.npmmirror.com/vue-router/4.0.12_vue@3.2.26
devDependencies:
'@commitlint/cli': registry.npmmirror.com/@commitlint/cli/16.0.3_@types+node@17.0.10
'@commitlint/cli': registry.npmmirror.com/@commitlint/cli/16.1.0_@types+node@17.0.10
'@commitlint/config-conventional': registry.npmmirror.com/@commitlint/config-conventional/16.0.0
'@iconify/json': registry.npmmirror.com/@iconify/json/1.1.458
'@iconify/json': registry.npmmirror.com/@iconify/json/1.1.459
'@iconify/vue': registry.npmmirror.com/@iconify/vue/3.1.2_vue@3.2.26
'@types/crypto-js': registry.npmmirror.com/@types/crypto-js/4.1.0
'@types/node': registry.npmmirror.com/@types/node/17.0.10
'@types/qs': registry.npmmirror.com/@types/qs/6.9.7
'@typescript-eslint/eslint-plugin': registry.npmmirror.com/@typescript-eslint/eslint-plugin/5.10.0_3b6b276e93ead7cf6063f183a5e18d1f
'@typescript-eslint/parser': registry.npmmirror.com/@typescript-eslint/parser/5.10.0_eslint@8.7.0+typescript@4.5.4
'@vitejs/plugin-vue': registry.npmmirror.com/@vitejs/plugin-vue/2.0.1_vite@2.7.13+vue@3.2.26
'@typescript-eslint/eslint-plugin': registry.npmmirror.com/@typescript-eslint/eslint-plugin/5.10.0_706fb07ce74b1db611f19a02ad2ce784
'@typescript-eslint/parser': registry.npmmirror.com/@typescript-eslint/parser/5.10.0_eslint@8.7.0+typescript@4.5.5
'@vitejs/plugin-vue': registry.npmmirror.com/@vitejs/plugin-vue/2.1.0_vite@2.7.13+vue@3.2.26
'@vue/eslint-config-prettier': registry.npmmirror.com/@vue/eslint-config-prettier/7.0.0_eslint@8.7.0+prettier@2.5.1
'@vue/eslint-config-typescript': registry.npmmirror.com/@vue/eslint-config-typescript/10.0.0_3bd88b78ccaf1b54747cae8c2dba8166
'@vue/eslint-config-typescript': registry.npmmirror.com/@vue/eslint-config-typescript/10.0.0_b5007341d5f2a2e7b479ac173dfc16cf
commitizen: registry.npmmirror.com/commitizen/4.2.4_@types+node@17.0.10
cross-env: registry.nlark.com/cross-env/7.0.3
cz-conventional-changelog: registry.nlark.com/cz-conventional-changelog/3.3.0_@types+node@17.0.10
@@ -98,21 +98,21 @@ devDependencies:
eslint-plugin-prettier: registry.npmmirror.com/eslint-plugin-prettier/4.0.0_4660519532e4c3b0a9e5bb6623cfedf6
eslint-plugin-vue: registry.npmmirror.com/eslint-plugin-vue/8.3.0_eslint@8.7.0
husky: registry.npmmirror.com/husky/7.0.4
lint-staged: registry.npmmirror.com/lint-staged/12.2.1
lint-staged: registry.npmmirror.com/lint-staged/12.3.1
mockjs: registry.npmmirror.com/mockjs/1.1.0
patch-package: registry.nlark.com/patch-package/6.4.7
postinstall-postinstall: registry.npmmirror.com/postinstall-postinstall/2.1.0
prettier: registry.npmmirror.com/prettier/2.5.1
rollup-plugin-visualizer: registry.npmmirror.com/rollup-plugin-visualizer/5.5.4
sass: registry.npmmirror.com/sass/1.49.0
typescript: registry.npmmirror.com/typescript/4.5.4
typescript: registry.npmmirror.com/typescript/4.5.5
unplugin-icons: registry.npmmirror.com/unplugin-icons/0.13.0_vite@2.7.13
unplugin-vue-components: registry.npmmirror.com/unplugin-vue-components/0.17.13_vite@2.7.13+vue@3.2.26
unplugin-vue-components: registry.npmmirror.com/unplugin-vue-components/0.17.14_vite@2.7.13+vue@3.2.26
vite: registry.npmmirror.com/vite/2.7.13_sass@1.49.0
vite-plugin-html: registry.npmmirror.com/vite-plugin-html/2.1.2_vite@2.7.13
vite-plugin-mock: registry.npmmirror.com/vite-plugin-mock/2.9.6_mockjs@1.1.0+vite@2.7.13
vite-plugin-windicss: registry.npmmirror.com/vite-plugin-windicss/1.6.3_vite@2.7.13
vue-tsc: registry.npmmirror.com/vue-tsc/0.30.6_typescript@4.5.4
vue-tsc: registry.npmmirror.com/vue-tsc/0.31.1_typescript@4.5.5
vueuc: registry.npmmirror.com/vueuc/0.4.23_vue@3.2.26
windicss: registry.npmmirror.com/windicss/3.4.3
@@ -698,7 +698,7 @@ packages:
longest: registry.nlark.com/longest/2.0.1
word-wrap: registry.nlark.com/word-wrap/1.2.3
optionalDependencies:
'@commitlint/load': registry.npmmirror.com/@commitlint/load/16.0.0_@types+node@17.0.10
'@commitlint/load': registry.npmmirror.com/@commitlint/load/16.1.0_@types+node@17.0.10
transitivePeerDependencies:
- '@swc/core'
- '@swc/wasm'
@@ -719,7 +719,7 @@ packages:
longest: registry.nlark.com/longest/2.0.1
word-wrap: registry.nlark.com/word-wrap/1.2.3
optionalDependencies:
'@commitlint/load': registry.npmmirror.com/@commitlint/load/16.0.0_@types+node@17.0.10
'@commitlint/load': registry.npmmirror.com/@commitlint/load/16.1.0_@types+node@17.0.10
transitivePeerDependencies:
- '@swc/core'
- '@swc/wasm'
@@ -875,12 +875,6 @@ packages:
esutils: registry.npmmirror.com/esutils/2.0.3
dev: true
registry.nlark.com/doctypes/1.1.0:
resolution: {integrity: sha1-6oCxBqh1OHdOijpKWv4pPeSJ4Kk=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/doctypes/download/doctypes-1.1.0.tgz}
name: doctypes
version: 1.1.0
dev: true
registry.nlark.com/dom-serializer/1.3.2:
resolution: {integrity: sha1-YgZDfTLO767HFhgDIwx6ILwbTZE=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/dom-serializer/download/dom-serializer-1.3.2.tgz}
name: dom-serializer
@@ -1033,7 +1027,7 @@ packages:
version: 0.3.6
dependencies:
debug: registry.npmmirror.com/debug/3.2.7
resolve: registry.npmmirror.com/resolve/1.20.0
resolve: registry.npmmirror.com/resolve/1.21.0
dev: true
registry.nlark.com/eslint-utils/3.0.0_eslint@8.7.0:
@@ -1132,11 +1126,11 @@ packages:
dev: true
registry.nlark.com/fastq/1.13.0:
resolution: {integrity: sha1-YWdg+Ip1Jr38WWt8q4wYk4w2uYw=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/fastq/download/fastq-1.13.0.tgz}
resolution: {integrity: sha1-YWdg+Ip1Jr38WWt8q4wYk4w2uYw=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/fastq/download/fastq-1.13.0.tgz?cache=0&sync_timestamp=1631616062226&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ffastq%2Fdownload%2Ffastq-1.13.0.tgz}
name: fastq
version: 1.13.0
dependencies:
reusify: registry.nlark.com/reusify/1.0.4
reusify: registry.npmmirror.com/reusify/1.0.4
dev: true
registry.nlark.com/fecha/4.2.1:
@@ -1803,7 +1797,7 @@ packages:
version: 1.0.0
dependencies:
is-promise: registry.nlark.com/is-promise/2.2.2
promise: registry.npmmirror.com/promise/7.3.1
promise: registry.nlark.com/promise/7.3.1
dev: true
registry.nlark.com/kind-of/3.2.2:
@@ -2055,7 +2049,7 @@ packages:
dev: true
registry.nlark.com/normalize-path/3.0.0:
resolution: {integrity: sha1-Dc1p/yOhybEf0JeDFmRKA4ghamU=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/normalize-path/download/normalize-path-3.0.0.tgz?cache=0&sync_timestamp=1631501916645&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fnormalize-path%2Fdownload%2Fnormalize-path-3.0.0.tgz}
resolution: {integrity: sha1-Dc1p/yOhybEf0JeDFmRKA4ghamU=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/normalize-path/download/normalize-path-3.0.0.tgz}
name: normalize-path
version: 3.0.0
engines: {node: '>=0.10.0'}
@@ -2339,6 +2333,14 @@ packages:
fast-diff: registry.nlark.com/fast-diff/1.2.0
dev: true
registry.nlark.com/promise/7.3.1:
resolution: {integrity: sha1-BktyYCsY+Q8pGSuLG8QY/9Hr078=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/promise/download/promise-7.3.1.tgz}
name: promise
version: 7.3.1
dependencies:
asap: registry.nlark.com/asap/2.0.6
dev: true
registry.nlark.com/pug-attrs/3.0.0:
resolution: {integrity: sha1-sQRR4DSBZeMfrRzCPr3dncc0fEE=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/pug-attrs/download/pug-attrs-3.0.0.tgz}
name: pug-attrs
@@ -2355,7 +2357,7 @@ packages:
version: 3.0.2
dependencies:
constantinople: registry.nlark.com/constantinople/4.0.1
doctypes: registry.nlark.com/doctypes/1.1.0
doctypes: registry.npmmirror.com/doctypes/1.1.0
js-stringify: registry.nlark.com/js-stringify/1.0.2
pug-attrs: registry.nlark.com/pug-attrs/3.0.0
pug-error: registry.npmmirror.com/pug-error/2.0.0
@@ -2574,13 +2576,6 @@ packages:
signal-exit: registry.npmmirror.com/signal-exit/3.0.6
dev: true
registry.nlark.com/reusify/1.0.4:
resolution: {integrity: sha1-kNo4Kx4SbvwCFG6QhFqI2xKSXXY=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/reusify/download/reusify-1.0.4.tgz}
name: reusify
version: 1.0.4
engines: {iojs: '>=1.0.0', node: '>=0.10.0'}
dev: true
registry.nlark.com/rfdc/1.3.0:
resolution: {integrity: sha1-0LfEQasnINBdxM8m4ByJYx2doIs=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/rfdc/download/rfdc-1.3.0.tgz}
name: rfdc
@@ -2943,7 +2938,7 @@ packages:
engines: {node: '>=8'}
dev: true
registry.nlark.com/tsutils/3.21.0_typescript@4.5.4:
registry.nlark.com/tsutils/3.21.0_typescript@4.5.5:
resolution: {integrity: sha1-tIcX05TOpsHglpg+7Vjp1hcVtiM=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/tsutils/download/tsutils-3.21.0.tgz}
id: registry.nlark.com/tsutils/3.21.0
name: tsutils
@@ -2953,7 +2948,7 @@ packages:
typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta'
dependencies:
tslib: registry.npmmirror.com/tslib/1.14.1
typescript: registry.npmmirror.com/typescript/4.5.4
typescript: registry.npmmirror.com/typescript/4.5.5
dev: true
registry.nlark.com/type-check/0.4.0:
@@ -3054,6 +3049,12 @@ packages:
engines: {node: '>=0.10.0'}
dev: true
registry.nlark.com/vscode-nls/5.0.0:
resolution: {integrity: sha1-mfDaC9nqfNpE5WWnTFSx8rwleEA=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/vscode-nls/download/vscode-nls-5.0.0.tgz}
name: vscode-nls
version: 5.0.0
dev: true
registry.nlark.com/webpack-virtual-modules/0.4.3:
resolution: {integrity: sha1-zVl8bVHVpey0c+6hmDpY+ooX3tk=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/webpack-virtual-modules/download/webpack-virtual-modules-0.4.3.tgz}
name: webpack-virtual-modules
@@ -3124,7 +3125,7 @@ packages:
dev: false
registry.nlark.com/wrap-ansi/6.2.0:
resolution: {integrity: sha1-6Tk7oHEC5skaOyIUePAlfNKFblM=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/wrap-ansi/download/wrap-ansi-6.2.0.tgz?cache=0&sync_timestamp=1631584889456&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fwrap-ansi%2Fdownload%2Fwrap-ansi-6.2.0.tgz}
resolution: {integrity: sha1-6Tk7oHEC5skaOyIUePAlfNKFblM=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/wrap-ansi/download/wrap-ansi-6.2.0.tgz}
name: wrap-ansi
version: 6.2.0
engines: {node: '>=8'}
@@ -3135,7 +3136,7 @@ packages:
dev: true
registry.nlark.com/wrap-ansi/7.0.0:
resolution: {integrity: sha1-Z+FFz/UQpqaYS98RUpEdadLrnkM=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/wrap-ansi/download/wrap-ansi-7.0.0.tgz?cache=0&sync_timestamp=1631584889456&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fwrap-ansi%2Fdownload%2Fwrap-ansi-7.0.0.tgz}
resolution: {integrity: sha1-Z+FFz/UQpqaYS98RUpEdadLrnkM=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/wrap-ansi/download/wrap-ansi-7.0.0.tgz}
name: wrap-ansi
version: 7.0.0
engines: {node: '>=10'}
@@ -3428,17 +3429,17 @@ packages:
to-fast-properties: registry.nlark.com/to-fast-properties/2.0.0
dev: true
registry.npmmirror.com/@commitlint/cli/16.0.3_@types+node@17.0.10:
resolution: {integrity: sha512-SB1od4/1ek5SShNKjKgUdpqiVNulNVgCkjkV4Zz9zLKrxn3sPcgvXMQNh/wy0/T4WPUVgHrHGcxWYOYXxrGwpg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@commitlint/cli/download/@commitlint/cli-16.0.3.tgz}
id: registry.npmmirror.com/@commitlint/cli/16.0.3
registry.npmmirror.com/@commitlint/cli/16.1.0_@types+node@17.0.10:
resolution: {integrity: sha512-x5L1knvA3isRWBRVQx+Q6D45pA9139a2aZQYpxkljMG0dj4UHZkCnsYWpnGalxPxASI7nrI0KedKfS2YeQ55cQ==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@commitlint/cli/download/@commitlint/cli-16.1.0.tgz}
id: registry.npmmirror.com/@commitlint/cli/16.1.0
name: '@commitlint/cli'
version: 16.0.3
version: 16.1.0
engines: {node: '>=v12'}
hasBin: true
dependencies:
'@commitlint/format': registry.npmmirror.com/@commitlint/format/16.0.0
'@commitlint/lint': registry.npmmirror.com/@commitlint/lint/16.0.0
'@commitlint/load': registry.npmmirror.com/@commitlint/load/16.0.0_@types+node@17.0.10
'@commitlint/load': registry.npmmirror.com/@commitlint/load/16.1.0_@types+node@17.0.10
'@commitlint/read': registry.npmmirror.com/@commitlint/read/16.0.0
'@commitlint/types': registry.npmmirror.com/@commitlint/types/16.0.0
lodash: registry.npmmirror.com/lodash/4.17.21
@@ -3460,10 +3461,10 @@ packages:
conventional-changelog-conventionalcommits: registry.npmmirror.com/conventional-changelog-conventionalcommits/4.6.3
dev: true
registry.npmmirror.com/@commitlint/config-validator/16.0.0:
resolution: {integrity: sha512-i80DGlo1FeC5jZpuoNV9NIjQN/m2dDV3jYGWg+1Wr+KldptkUHXj+6GY1Akll66lJ3D8s6aUGi3comPLHPtWHg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@commitlint/config-validator/download/@commitlint/config-validator-16.0.0.tgz}
registry.npmmirror.com/@commitlint/config-validator/16.1.0:
resolution: {integrity: sha512-2cHeZPNTuf1JWbMqyA46MkExor5HMSgv8JrdmzEakUbJHUreh35/wN00FJf57qGs134exQW2thiSQ1IJUsVx2Q==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@commitlint/config-validator/download/@commitlint/config-validator-16.1.0.tgz}
name: '@commitlint/config-validator'
version: 16.0.0
version: 16.1.0
engines: {node: '>=v12'}
dependencies:
'@commitlint/types': registry.npmmirror.com/@commitlint/types/16.0.0
@@ -3519,23 +3520,23 @@ packages:
'@commitlint/types': registry.npmmirror.com/@commitlint/types/16.0.0
dev: true
registry.npmmirror.com/@commitlint/load/16.0.0_@types+node@17.0.10:
resolution: {integrity: sha512-7WhrGCkP6K/XfjBBguLkkI2XUdiiIyMGlNsSoSqgRNiD352EiffhFEApMy1/XOU+viwBBm/On0n5p0NC7e9/4A==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@commitlint/load/download/@commitlint/load-16.0.0.tgz}
id: registry.npmmirror.com/@commitlint/load/16.0.0
registry.npmmirror.com/@commitlint/load/16.1.0_@types+node@17.0.10:
resolution: {integrity: sha512-MtlEhKjP8jAF85jjX4mw8DUUwCxKsCgAc865hhpnwxjrfBcmGP7Up2AFE/M3ZMGDmSl1X1TMybQk/zohj8Cqdg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@commitlint/load/download/@commitlint/load-16.1.0.tgz}
id: registry.npmmirror.com/@commitlint/load/16.1.0
name: '@commitlint/load'
version: 16.0.0
version: 16.1.0
engines: {node: '>=v12'}
dependencies:
'@commitlint/config-validator': registry.npmmirror.com/@commitlint/config-validator/16.0.0
'@commitlint/config-validator': registry.npmmirror.com/@commitlint/config-validator/16.1.0
'@commitlint/execute-rule': registry.npmmirror.com/@commitlint/execute-rule/16.0.0
'@commitlint/resolve-extends': registry.npmmirror.com/@commitlint/resolve-extends/16.0.0
'@commitlint/resolve-extends': registry.npmmirror.com/@commitlint/resolve-extends/16.1.0
'@commitlint/types': registry.npmmirror.com/@commitlint/types/16.0.0
chalk: registry.npmmirror.com/chalk/4.1.2
cosmiconfig: registry.nlark.com/cosmiconfig/7.0.1
cosmiconfig-typescript-loader: registry.npmmirror.com/cosmiconfig-typescript-loader/1.0.2_82b55006877de54992e74492b614ace9
cosmiconfig-typescript-loader: registry.npmmirror.com/cosmiconfig-typescript-loader/1.0.2_9d6cd740eceb93d711351e2e9548d1bd
lodash: registry.npmmirror.com/lodash/4.17.21
resolve-from: registry.nlark.com/resolve-from/5.0.0
typescript: registry.npmmirror.com/typescript/4.5.4
typescript: registry.npmmirror.com/typescript/4.5.5
transitivePeerDependencies:
- '@swc/core'
- '@swc/wasm'
@@ -3572,13 +3573,13 @@ packages:
git-raw-commits: registry.npmmirror.com/git-raw-commits/2.0.11
dev: true
registry.npmmirror.com/@commitlint/resolve-extends/16.0.0:
resolution: {integrity: sha512-Z/w9MAQUcxeawpCLtjmkVNXAXOmB2nhW+LYmHEZcx9O6UTauF/1+uuZ2/r0MtzTe1qw2JD+1QHVhEWYHVPlkdA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@commitlint/resolve-extends/download/@commitlint/resolve-extends-16.0.0.tgz}
registry.npmmirror.com/@commitlint/resolve-extends/16.1.0:
resolution: {integrity: sha512-8182s6AFoUFX6+FT1PgQDt15nO2ogdR/EN8SYVAdhNXw1rLz8kT5saB/ICw567GuRAUgFTUMGCXy3ctMOXPEDg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@commitlint/resolve-extends/download/@commitlint/resolve-extends-16.1.0.tgz}
name: '@commitlint/resolve-extends'
version: 16.0.0
version: 16.1.0
engines: {node: '>=v12'}
dependencies:
'@commitlint/config-validator': registry.npmmirror.com/@commitlint/config-validator/16.0.0
'@commitlint/config-validator': registry.npmmirror.com/@commitlint/config-validator/16.1.0
'@commitlint/types': registry.npmmirror.com/@commitlint/types/16.0.0
import-fresh: registry.nlark.com/import-fresh/3.3.0
lodash: registry.npmmirror.com/lodash/4.17.21
@@ -3705,10 +3706,10 @@ packages:
version: 1.2.1
dev: true
registry.npmmirror.com/@iconify/json/1.1.458:
resolution: {integrity: sha512-ZAU4WGRIqCwvIj65Lxp2yMgZx7CjRRlgBcwOUL53qnQMAVC9x/mGYxwOALQBwx3WNqvYOSkcNMvmwhFbdsn+6w==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@iconify/json/download/@iconify/json-1.1.458.tgz}
registry.npmmirror.com/@iconify/json/1.1.459:
resolution: {integrity: sha512-ToupL/TZCWIx2OeISEnZUqGIsYzOcc9exHbzQV3rhGARxoao+fl5a6C/YG2St/tocOCcHExwuGnV0fO9wpdJMA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@iconify/json/download/@iconify/json-1.1.459.tgz}
name: '@iconify/json'
version: 1.1.458
version: 1.1.459
dev: true
registry.npmmirror.com/@iconify/types/1.0.12:
@@ -3926,7 +3927,7 @@ packages:
dependencies:
'@types/yargs-parser': registry.npmmirror.com/@types/yargs-parser/20.2.1
registry.npmmirror.com/@typescript-eslint/eslint-plugin/5.10.0_3b6b276e93ead7cf6063f183a5e18d1f:
registry.npmmirror.com/@typescript-eslint/eslint-plugin/5.10.0_706fb07ce74b1db611f19a02ad2ce784:
resolution: {integrity: sha512-XXVKnMsq2fuu9K2KsIxPUGqb6xAImz8MEChClbXmE3VbveFtBUU5bzM6IPVWqzyADIgdkS2Ws/6Xo7W2TeZWjQ==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@typescript-eslint/eslint-plugin/download/@typescript-eslint/eslint-plugin-5.10.0.tgz}
id: registry.npmmirror.com/@typescript-eslint/eslint-plugin/5.10.0
name: '@typescript-eslint/eslint-plugin'
@@ -3940,23 +3941,23 @@ packages:
typescript:
optional: true
dependencies:
'@typescript-eslint/parser': registry.npmmirror.com/@typescript-eslint/parser/5.10.0_eslint@8.7.0+typescript@4.5.4
'@typescript-eslint/parser': registry.npmmirror.com/@typescript-eslint/parser/5.10.0_eslint@8.7.0+typescript@4.5.5
'@typescript-eslint/scope-manager': registry.npmmirror.com/@typescript-eslint/scope-manager/5.10.0
'@typescript-eslint/type-utils': registry.npmmirror.com/@typescript-eslint/type-utils/5.10.0_eslint@8.7.0+typescript@4.5.4
'@typescript-eslint/utils': registry.npmmirror.com/@typescript-eslint/utils/5.10.0_eslint@8.7.0+typescript@4.5.4
'@typescript-eslint/type-utils': registry.npmmirror.com/@typescript-eslint/type-utils/5.10.0_eslint@8.7.0+typescript@4.5.5
'@typescript-eslint/utils': registry.npmmirror.com/@typescript-eslint/utils/5.10.0_eslint@8.7.0+typescript@4.5.5
debug: registry.npmmirror.com/debug/4.3.3
eslint: registry.npmmirror.com/eslint/8.7.0
functional-red-black-tree: registry.nlark.com/functional-red-black-tree/1.0.1
ignore: registry.npmmirror.com/ignore/5.2.0
regexpp: registry.nlark.com/regexpp/3.2.0
semver: registry.nlark.com/semver/7.3.5
tsutils: registry.nlark.com/tsutils/3.21.0_typescript@4.5.4
typescript: registry.npmmirror.com/typescript/4.5.4
tsutils: registry.nlark.com/tsutils/3.21.0_typescript@4.5.5
typescript: registry.npmmirror.com/typescript/4.5.5
transitivePeerDependencies:
- supports-color
dev: true
registry.npmmirror.com/@typescript-eslint/parser/5.10.0_eslint@8.7.0+typescript@4.5.4:
registry.npmmirror.com/@typescript-eslint/parser/5.10.0_eslint@8.7.0+typescript@4.5.5:
resolution: {integrity: sha512-pJB2CCeHWtwOAeIxv8CHVGJhI5FNyJAIpx5Pt72YkK3QfEzt6qAlXZuyaBmyfOdM62qU0rbxJzNToPTVeJGrQw==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@typescript-eslint/parser/download/@typescript-eslint/parser-5.10.0.tgz}
id: registry.npmmirror.com/@typescript-eslint/parser/5.10.0
name: '@typescript-eslint/parser'
@@ -3971,10 +3972,10 @@ packages:
dependencies:
'@typescript-eslint/scope-manager': registry.npmmirror.com/@typescript-eslint/scope-manager/5.10.0
'@typescript-eslint/types': registry.npmmirror.com/@typescript-eslint/types/5.10.0
'@typescript-eslint/typescript-estree': registry.npmmirror.com/@typescript-eslint/typescript-estree/5.10.0_typescript@4.5.4
'@typescript-eslint/typescript-estree': registry.npmmirror.com/@typescript-eslint/typescript-estree/5.10.0_typescript@4.5.5
debug: registry.npmmirror.com/debug/4.3.3
eslint: registry.npmmirror.com/eslint/8.7.0
typescript: registry.npmmirror.com/typescript/4.5.4
typescript: registry.npmmirror.com/typescript/4.5.5
transitivePeerDependencies:
- supports-color
dev: true
@@ -3989,7 +3990,7 @@ packages:
'@typescript-eslint/visitor-keys': registry.npmmirror.com/@typescript-eslint/visitor-keys/5.10.0
dev: true
registry.npmmirror.com/@typescript-eslint/type-utils/5.10.0_eslint@8.7.0+typescript@4.5.4:
registry.npmmirror.com/@typescript-eslint/type-utils/5.10.0_eslint@8.7.0+typescript@4.5.5:
resolution: {integrity: sha512-TzlyTmufJO5V886N+hTJBGIfnjQDQ32rJYxPaeiyWKdjsv2Ld5l8cbS7pxim4DeNs62fKzRSt8Q14Evs4JnZyQ==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@typescript-eslint/type-utils/download/@typescript-eslint/type-utils-5.10.0.tgz}
id: registry.npmmirror.com/@typescript-eslint/type-utils/5.10.0
name: '@typescript-eslint/type-utils'
@@ -4002,11 +4003,11 @@ packages:
typescript:
optional: true
dependencies:
'@typescript-eslint/utils': registry.npmmirror.com/@typescript-eslint/utils/5.10.0_eslint@8.7.0+typescript@4.5.4
'@typescript-eslint/utils': registry.npmmirror.com/@typescript-eslint/utils/5.10.0_eslint@8.7.0+typescript@4.5.5
debug: registry.npmmirror.com/debug/4.3.3
eslint: registry.npmmirror.com/eslint/8.7.0
tsutils: registry.nlark.com/tsutils/3.21.0_typescript@4.5.4
typescript: registry.npmmirror.com/typescript/4.5.4
tsutils: registry.nlark.com/tsutils/3.21.0_typescript@4.5.5
typescript: registry.npmmirror.com/typescript/4.5.5
transitivePeerDependencies:
- supports-color
dev: true
@@ -4018,7 +4019,7 @@ packages:
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dev: true
registry.npmmirror.com/@typescript-eslint/typescript-estree/5.10.0_typescript@4.5.4:
registry.npmmirror.com/@typescript-eslint/typescript-estree/5.10.0_typescript@4.5.5:
resolution: {integrity: sha512-x+7e5IqfwLwsxTdliHRtlIYkgdtYXzE0CkFeV6ytAqq431ZyxCFzNMNR5sr3WOlIG/ihVZr9K/y71VHTF/DUQA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@typescript-eslint/typescript-estree/download/@typescript-eslint/typescript-estree-5.10.0.tgz}
id: registry.npmmirror.com/@typescript-eslint/typescript-estree/5.10.0
name: '@typescript-eslint/typescript-estree'
@@ -4036,13 +4037,13 @@ packages:
globby: registry.npmmirror.com/globby/11.0.4
is-glob: registry.npmmirror.com/is-glob/4.0.3
semver: registry.nlark.com/semver/7.3.5
tsutils: registry.nlark.com/tsutils/3.21.0_typescript@4.5.4
typescript: registry.npmmirror.com/typescript/4.5.4
tsutils: registry.nlark.com/tsutils/3.21.0_typescript@4.5.5
typescript: registry.npmmirror.com/typescript/4.5.5
transitivePeerDependencies:
- supports-color
dev: true
registry.npmmirror.com/@typescript-eslint/utils/5.10.0_eslint@8.7.0+typescript@4.5.4:
registry.npmmirror.com/@typescript-eslint/utils/5.10.0_eslint@8.7.0+typescript@4.5.5:
resolution: {integrity: sha512-IGYwlt1CVcFoE2ueW4/ioEwybR60RAdGeiJX/iDAw0t5w0wK3S7QncDwpmsM70nKgGTuVchEWB8lwZwHqPAWRg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@typescript-eslint/utils/download/@typescript-eslint/utils-5.10.0.tgz}
id: registry.npmmirror.com/@typescript-eslint/utils/5.10.0
name: '@typescript-eslint/utils'
@@ -4054,7 +4055,7 @@ packages:
'@types/json-schema': registry.npmmirror.com/@types/json-schema/7.0.9
'@typescript-eslint/scope-manager': registry.npmmirror.com/@typescript-eslint/scope-manager/5.10.0
'@typescript-eslint/types': registry.npmmirror.com/@typescript-eslint/types/5.10.0
'@typescript-eslint/typescript-estree': registry.npmmirror.com/@typescript-eslint/typescript-estree/5.10.0_typescript@4.5.4
'@typescript-eslint/typescript-estree': registry.npmmirror.com/@typescript-eslint/typescript-estree/5.10.0_typescript@4.5.5
eslint: registry.npmmirror.com/eslint/8.7.0
eslint-scope: registry.npmmirror.com/eslint-scope/5.1.1
eslint-utils: registry.nlark.com/eslint-utils/3.0.0_eslint@8.7.0
@@ -4073,11 +4074,11 @@ packages:
eslint-visitor-keys: registry.npmmirror.com/eslint-visitor-keys/3.2.0
dev: true
registry.npmmirror.com/@vitejs/plugin-vue/2.0.1_vite@2.7.13+vue@3.2.26:
resolution: {integrity: sha512-wtdMnGVvys9K8tg+DxowU1ytTrdVveXr3LzdhaKakysgGXyrsfaeds2cDywtvujEASjWOwWL/OgWM+qoeM8Plg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@vitejs/plugin-vue/download/@vitejs/plugin-vue-2.0.1.tgz}
id: registry.npmmirror.com/@vitejs/plugin-vue/2.0.1
registry.npmmirror.com/@vitejs/plugin-vue/2.1.0_vite@2.7.13+vue@3.2.26:
resolution: {integrity: sha512-AZ78WxvFMYd8JmM/GBV6a6SGGTU0GgN/0/4T+FnMMsLzFEzTeAUwuraapy50ifHZsC+G5SvWs86bvaCPTneFlA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@vitejs/plugin-vue/download/@vitejs/plugin-vue-2.1.0.tgz}
id: registry.npmmirror.com/@vitejs/plugin-vue/2.1.0
name: '@vitejs/plugin-vue'
version: 2.0.1
version: 2.1.0
engines: {node: '>=12.0.0'}
peerDependencies:
vite: ^2.5.10
@@ -4087,19 +4088,19 @@ packages:
vue: registry.npmmirror.com/vue/3.2.26
dev: true
registry.npmmirror.com/@volar/code-gen/0.30.6:
resolution: {integrity: sha512-odkXN91QCS/KRKPk4eUQp7jkN0PuYLwDuJZwGiDDJrZWUCCSdEvSj7e+Cjk7Q7doX0G9WAF88BL7ozcjzrtiKw==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@volar/code-gen/download/@volar/code-gen-0.30.6.tgz}
registry.npmmirror.com/@volar/code-gen/0.31.1:
resolution: {integrity: sha512-HsUNJHBdq4vGxenYlREqtBNf1Gh5JV1GBkD703bcH8clauc7ADTkUrayfLAF2ulXP/U0l7dFL8C8bwqJ7PZbMw==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@volar/code-gen/download/@volar/code-gen-0.31.1.tgz}
name: '@volar/code-gen'
version: 0.30.6
version: 0.31.1
dependencies:
'@volar/shared': registry.npmmirror.com/@volar/shared/0.30.6
'@volar/source-map': registry.npmmirror.com/@volar/source-map/0.30.6
'@volar/shared': registry.npmmirror.com/@volar/shared/0.31.1
'@volar/source-map': registry.npmmirror.com/@volar/source-map/0.31.1
dev: true
registry.npmmirror.com/@volar/html2pug/0.30.6:
resolution: {integrity: sha512-mPRQCRa/Nse0bC1wxJ+K7q/Ou0Wg+220qL3nPI3mqwSn0KECOAPsZxaVHRFauY4MeBxO2sOzkOvFfQLk8whJ1g==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@volar/html2pug/download/@volar/html2pug-0.30.6.tgz}
registry.npmmirror.com/@volar/html2pug/0.31.1:
resolution: {integrity: sha512-m/lbsz9t+zXx9HsuLH17Z/5nNtefv5qxncL8rycR+GaypHQKF5kg+GqQNOURMQ8T8lq2D6fNsGQOcMXoo3IqWQ==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@volar/html2pug/download/@volar/html2pug-0.31.1.tgz}
name: '@volar/html2pug'
version: 0.30.6
version: 0.31.1
dependencies:
domelementtype: registry.nlark.com/domelementtype/2.2.0
domhandler: registry.npmmirror.com/domhandler/4.3.0
@@ -4107,10 +4108,10 @@ packages:
pug: registry.npmmirror.com/pug/3.0.2
dev: true
registry.npmmirror.com/@volar/shared/0.30.6:
resolution: {integrity: sha512-YJa7kl2HRkSZaETBPCVEm/ZVXPBpt1aAlCxNuj55GaCHhcabOVj2oCBZioJLiwAvSR0e6k6KjbJBcKTuKrP9bw==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@volar/shared/download/@volar/shared-0.30.6.tgz}
registry.npmmirror.com/@volar/shared/0.31.1:
resolution: {integrity: sha512-WbMiPOlXbpFinZnQ+/qsJQ7+YW6MFla2fLdD6Er5bLW5DEXI+GupLQ2gnia7F0w6QborMowfOIEXnrnMPPYGOA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@volar/shared/download/@volar/shared-0.31.1.tgz}
name: '@volar/shared'
version: 0.30.6
version: 0.31.1
dependencies:
upath: registry.nlark.com/upath/2.0.1
vscode-html-languageservice: registry.npmmirror.com/vscode-html-languageservice/4.2.1
@@ -4118,32 +4119,32 @@ packages:
vscode-uri: registry.npmmirror.com/vscode-uri/3.0.3
dev: true
registry.npmmirror.com/@volar/source-map/0.30.6:
resolution: {integrity: sha512-B0KLi0StdM3KsMLA+iK5pdE+mokukio7r0EkOMUAYZN/xn/kGWkKIdleJjLtgmtH2tw4kBz/5hP+KKEOlD3Etg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@volar/source-map/download/@volar/source-map-0.30.6.tgz}
registry.npmmirror.com/@volar/source-map/0.31.1:
resolution: {integrity: sha512-t+bUmxI5bkunBxX6UYpBX6+xnYYJhpciL3Hqv0dkHSaS63kJqY13OhV/utmQMjto3b3FAbYLSVqpt09FtdTPzg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@volar/source-map/download/@volar/source-map-0.31.1.tgz}
name: '@volar/source-map'
version: 0.30.6
version: 0.31.1
dependencies:
'@volar/shared': registry.npmmirror.com/@volar/shared/0.30.6
'@volar/shared': registry.npmmirror.com/@volar/shared/0.31.1
vscode-languageserver-textdocument: registry.npmmirror.com/vscode-languageserver-textdocument/1.0.3
dev: true
registry.npmmirror.com/@volar/transforms/0.30.6:
resolution: {integrity: sha512-jbVBXOBOeKc6Rb7dzyiq5b+FfYsXFWGFLLDZok5U+JoFujxoPfn5HwX9A3t+RW/NRwQkZxrdiPmW8b69B5nMKQ==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@volar/transforms/download/@volar/transforms-0.30.6.tgz}
registry.npmmirror.com/@volar/transforms/0.31.1:
resolution: {integrity: sha512-O9rrGwCTzzsVFe06WOKUx7f9rkPg396ugWkMX6O0M15EF1a3ykqH7QX1uxVhFS0NwvWDnIeJYe7NG1uf1BwR+w==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@volar/transforms/download/@volar/transforms-0.31.1.tgz}
name: '@volar/transforms'
version: 0.30.6
version: 0.31.1
dependencies:
'@volar/shared': registry.npmmirror.com/@volar/shared/0.30.6
'@volar/shared': registry.npmmirror.com/@volar/shared/0.31.1
vscode-languageserver-types: registry.npmmirror.com/vscode-languageserver-types/3.17.0-next.6
dev: true
registry.npmmirror.com/@volar/vue-code-gen/0.30.6:
resolution: {integrity: sha512-UGpbOuC5ZxT2GXvkq2IWUuca9IDJVaaywWparKW0SwPFOZaMM2ivHLOfQpiuPqDUKTZLGK3fQuBWuXSTl+GIbA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@volar/vue-code-gen/download/@volar/vue-code-gen-0.30.6.tgz}
registry.npmmirror.com/@volar/vue-code-gen/0.31.1:
resolution: {integrity: sha512-MBMqhE+Z7xt2MSeQQA4ld0qx894gr5eLFWkTORdNoCbK8+02oB3yrZVr3T+i9jprjiV6svXKBoyk0RZ6YsgNqw==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@volar/vue-code-gen/download/@volar/vue-code-gen-0.31.1.tgz}
name: '@volar/vue-code-gen'
version: 0.30.6
version: 0.31.1
dependencies:
'@volar/code-gen': registry.npmmirror.com/@volar/code-gen/0.30.6
'@volar/shared': registry.npmmirror.com/@volar/shared/0.30.6
'@volar/source-map': registry.npmmirror.com/@volar/source-map/0.30.6
'@volar/code-gen': registry.npmmirror.com/@volar/code-gen/0.31.1
'@volar/shared': registry.npmmirror.com/@volar/shared/0.31.1
'@volar/source-map': registry.npmmirror.com/@volar/source-map/0.31.1
'@vue/compiler-core': registry.npmmirror.com/@vue/compiler-core/3.2.27
'@vue/compiler-dom': registry.npmmirror.com/@vue/compiler-dom/3.2.27
'@vue/shared': registry.npmmirror.com/@vue/shared/3.2.27
@@ -4159,7 +4160,7 @@ packages:
jsonc-parser: registry.nlark.com/jsonc-parser/2.3.1
vscode-languageserver-textdocument: registry.npmmirror.com/vscode-languageserver-textdocument/1.0.3
vscode-languageserver-types: registry.npmmirror.com/vscode-languageserver-types/3.16.0
vscode-nls: registry.npmmirror.com/vscode-nls/5.0.0
vscode-nls: registry.nlark.com/vscode-nls/5.0.0
vscode-uri: registry.npmmirror.com/vscode-uri/2.1.2
dev: true
@@ -4250,7 +4251,7 @@ packages:
prettier: registry.npmmirror.com/prettier/2.5.1
dev: true
registry.npmmirror.com/@vue/eslint-config-typescript/10.0.0_3bd88b78ccaf1b54747cae8c2dba8166:
registry.npmmirror.com/@vue/eslint-config-typescript/10.0.0_b5007341d5f2a2e7b479ac173dfc16cf:
resolution: {integrity: sha512-F94cL8ug3FaYXlCfU5/wiGjk1qeadmoBpRGAOBq+qre3Smdupa59dd6ZJrsfRODpsMPyTG7330juMDsUvpZ3Rw==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@vue/eslint-config-typescript/download/@vue/eslint-config-typescript-10.0.0.tgz}
id: registry.npmmirror.com/@vue/eslint-config-typescript/10.0.0
name: '@vue/eslint-config-typescript'
@@ -4260,8 +4261,8 @@ packages:
eslint: ^6.2.0 || ^7.0.0 || ^8.0.0
eslint-plugin-vue: ^8.0.1
dependencies:
'@typescript-eslint/eslint-plugin': registry.npmmirror.com/@typescript-eslint/eslint-plugin/5.10.0_3b6b276e93ead7cf6063f183a5e18d1f
'@typescript-eslint/parser': registry.npmmirror.com/@typescript-eslint/parser/5.10.0_eslint@8.7.0+typescript@4.5.4
'@typescript-eslint/eslint-plugin': registry.npmmirror.com/@typescript-eslint/eslint-plugin/5.10.0_706fb07ce74b1db611f19a02ad2ce784
'@typescript-eslint/parser': registry.npmmirror.com/@typescript-eslint/parser/5.10.0_eslint@8.7.0+typescript@4.5.5
eslint: registry.npmmirror.com/eslint/8.7.0
eslint-plugin-vue: registry.npmmirror.com/eslint-plugin-vue/8.3.0_eslint@8.7.0
vue-eslint-parser: registry.npmmirror.com/vue-eslint-parser/8.0.1_eslint@8.7.0
@@ -4342,11 +4343,11 @@ packages:
version: 3.2.27
dev: true
registry.npmmirror.com/@vueuse/core/7.5.3_vue@3.2.26:
resolution: {integrity: sha512-D9j5ymHFMFRXQqCp0yZJkf/bvBGiz0MrKUa364p+L8dMyd5zyq2K1JmHyvoBd4xbTFRfmQ1h878u6YE5LCkDVQ==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@vueuse/core/download/@vueuse/core-7.5.3.tgz}
id: registry.npmmirror.com/@vueuse/core/7.5.3
registry.npmmirror.com/@vueuse/core/7.5.4_vue@3.2.26:
resolution: {integrity: sha512-PKmyHN2lZuttGgKmsoMMqiSojSYYKraszilP0gpQIGcLt2YoLABaG3VFjdPs2tY6DM+HG3o70HuzOMEQCY8fqQ==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@vueuse/core/download/@vueuse/core-7.5.4.tgz}
id: registry.npmmirror.com/@vueuse/core/7.5.4
name: '@vueuse/core'
version: 7.5.3
version: 7.5.4
peerDependencies:
'@vue/composition-api': ^1.1.0
vue: ^2.6.0 || ^3.2.0
@@ -4356,16 +4357,16 @@ packages:
vue:
optional: true
dependencies:
'@vueuse/shared': registry.npmmirror.com/@vueuse/shared/7.5.3_vue@3.2.26
'@vueuse/shared': registry.npmmirror.com/@vueuse/shared/7.5.4_vue@3.2.26
vue: registry.npmmirror.com/vue/3.2.26
vue-demi: registry.npmmirror.com/vue-demi/0.12.1_vue@3.2.26
dev: false
registry.npmmirror.com/@vueuse/shared/7.5.3_vue@3.2.26:
resolution: {integrity: sha512-BJ71cxHN5VByW1S58Gl85NFJaQu93F7Vs7K/MuAKsIIuHm9PBbkR5Vxkg9ko9cBdiKVt+FNoo13BhdbA+Vwycg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@vueuse/shared/download/@vueuse/shared-7.5.3.tgz}
id: registry.npmmirror.com/@vueuse/shared/7.5.3
registry.npmmirror.com/@vueuse/shared/7.5.4_vue@3.2.26:
resolution: {integrity: sha512-750RnGUEgg1+K4jGVkv7M5UOStAa/IjAInV6BugyBOvRYL2l1lcIDUi4V/qIKTlhd2oUAByCEnlqIpFD2a3tfw==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@vueuse/shared/download/@vueuse/shared-7.5.4.tgz}
id: registry.npmmirror.com/@vueuse/shared/7.5.4
name: '@vueuse/shared'
version: 7.5.3
version: 7.5.4
peerDependencies:
'@vue/composition-api': ^1.1.0
vue: ^2.6.0 || ^3.2.0
@@ -4696,7 +4697,7 @@ packages:
dev: false
registry.npmmirror.com/colorette/2.0.16:
resolution: {integrity: sha1-cTua+E/bAAE58EVGvUqT9ipQhdo=, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/colorette/download/colorette-2.0.16.tgz?cache=0&sync_timestamp=1633673609067&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fcolorette%2Fdownload%2Fcolorette-2.0.16.tgz}
resolution: {integrity: sha1-cTua+E/bAAE58EVGvUqT9ipQhdo=, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/colorette/download/colorette-2.0.16.tgz}
name: colorette
version: 2.0.16
dev: true
@@ -4797,7 +4798,7 @@ packages:
through2: registry.nlark.com/through2/4.0.2
dev: true
registry.npmmirror.com/cosmiconfig-typescript-loader/1.0.2_82b55006877de54992e74492b614ace9:
registry.npmmirror.com/cosmiconfig-typescript-loader/1.0.2_9d6cd740eceb93d711351e2e9548d1bd:
resolution: {integrity: sha512-27ZehvijYqAKVzta5xtZBS3PAliC8CmnWkGXN0vgxAZz7yqxpMjf3aG7flxF5rEiu8FAD7nZZXtOI+xUGn+bVg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/cosmiconfig-typescript-loader/download/cosmiconfig-typescript-loader-1.0.2.tgz}
id: registry.npmmirror.com/cosmiconfig-typescript-loader/1.0.2
name: cosmiconfig-typescript-loader
@@ -4809,8 +4810,8 @@ packages:
dependencies:
'@types/node': registry.npmmirror.com/@types/node/17.0.10
cosmiconfig: registry.nlark.com/cosmiconfig/7.0.1
ts-node: registry.npmmirror.com/ts-node/10.4.0_82b55006877de54992e74492b614ace9
typescript: registry.npmmirror.com/typescript/4.5.4
ts-node: registry.npmmirror.com/ts-node/10.4.0_9d6cd740eceb93d711351e2e9548d1bd
typescript: registry.npmmirror.com/typescript/4.5.5
transitivePeerDependencies:
- '@swc/core'
- '@swc/wasm'
@@ -4972,6 +4973,12 @@ packages:
version: 27.4.0
engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0}
registry.npmmirror.com/doctypes/1.1.0:
resolution: {integrity: sha1-6oCxBqh1OHdOijpKWv4pPeSJ4Kk=, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/doctypes/download/doctypes-1.1.0.tgz}
name: doctypes
version: 1.1.0
dev: true
registry.npmmirror.com/domhandler/4.3.0:
resolution: {integrity: sha512-fC0aXNQXqKSFTr2wDNZDhsEYjCiYsDWl3D01kwt25hm1YIPyDGHvvi3rw+PLqHAl/m71MaiF7d5zvBr0p5UB2g==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/domhandler/download/domhandler-4.3.0.tgz}
name: domhandler
@@ -5488,7 +5495,7 @@ packages:
version: 0.2.3
registry.npmmirror.com/execa/5.1.1:
resolution: {integrity: sha1-+ArZy/Qpj3vR1MlVXCHpN0HEEd0=, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/execa/download/execa-5.1.1.tgz}
resolution: {integrity: sha1-+ArZy/Qpj3vR1MlVXCHpN0HEEd0=, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/execa/download/execa-5.1.1.tgz?cache=0&sync_timestamp=1637147725485&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fexeca%2Fdownload%2Fexeca-5.1.1.tgz}
name: execa
version: 5.1.1
engines: {node: '>=10'}
@@ -5752,7 +5759,7 @@ packages:
dev: true
registry.npmmirror.com/htmlparser2/7.2.0:
resolution: {integrity: sha512-H7MImA4MS6cw7nbyURtLPO1Tms7C5H602LRETv95z1MxO/7CP7rDVROehUYeYBUYEON94NXXDEPmZuq+hX4sog==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/htmlparser2/download/htmlparser2-7.2.0.tgz?cache=0&sync_timestamp=1636641716463&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fhtmlparser2%2Fdownload%2Fhtmlparser2-7.2.0.tgz}
resolution: {integrity: sha512-H7MImA4MS6cw7nbyURtLPO1Tms7C5H602LRETv95z1MxO/7CP7rDVROehUYeYBUYEON94NXXDEPmZuq+hX4sog==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/htmlparser2/download/htmlparser2-7.2.0.tgz}
name: htmlparser2
version: 7.2.0
dependencies:
@@ -5942,10 +5949,10 @@ packages:
version: 1.2.4
dev: true
registry.npmmirror.com/lint-staged/12.2.1:
resolution: {integrity: sha512-VCVcA9C2Vt5HHxSR4EZVZFJcQRJH984CGBeY+cJ/xed4mBd+JidbM/xbKcCq5ASaygAV0iITtdsCTnID7h/1OQ==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/lint-staged/download/lint-staged-12.2.1.tgz}
registry.npmmirror.com/lint-staged/12.3.1:
resolution: {integrity: sha512-Ocht/eT+4/siWOZDJpNUKcKX2UeWW/pDbohJ4gRsrafAjBi79JK8kiNVk2ciIVNKdw0Q4ABptl2nr6uQAlRImw==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/lint-staged/download/lint-staged-12.3.1.tgz}
name: lint-staged
version: 12.2.1
version: 12.3.1
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
hasBin: true
dependencies:
@@ -5955,7 +5962,7 @@ packages:
debug: registry.npmmirror.com/debug/4.3.3_supports-color@9.2.1
execa: registry.npmmirror.com/execa/5.1.1
lilconfig: registry.npmmirror.com/lilconfig/2.0.4
listr2: registry.npmmirror.com/listr2/3.13.5
listr2: registry.npmmirror.com/listr2/4.0.1
micromatch: registry.nlark.com/micromatch/4.0.4
normalize-path: registry.nlark.com/normalize-path/3.0.0
object-inspect: registry.npmmirror.com/object-inspect/1.12.0
@@ -5966,11 +5973,11 @@ packages:
- enquirer
dev: true
registry.npmmirror.com/listr2/3.13.5:
resolution: {integrity: sha512-3n8heFQDSk+NcwBn3CgxEibZGaRzx+pC64n3YjpMD1qguV4nWus3Al+Oo3KooqFKTQEJ1v7MmnbnyyNspgx3NA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/listr2/download/listr2-3.13.5.tgz}
registry.npmmirror.com/listr2/4.0.1:
resolution: {integrity: sha512-D65Nl+zyYHL2jQBGmxtH/pU8koPZo5C8iCNE8EoB04RwPgQG1wuaKwVbeZv9LJpiH4Nxs0FCp+nNcG8OqpniiA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/listr2/download/listr2-4.0.1.tgz}
name: listr2
version: 3.13.5
engines: {node: '>=10.0.0'}
version: 4.0.1
engines: {node: '>=12'}
peerDependencies:
enquirer: '>= 2.3.0 < 3'
peerDependenciesMeta:
@@ -5982,7 +5989,7 @@ packages:
log-update: registry.npmmirror.com/log-update/4.0.0
p-map: registry.npmmirror.com/p-map/4.0.0
rfdc: registry.nlark.com/rfdc/1.3.0
rxjs: registry.npmmirror.com/rxjs/7.5.1
rxjs: registry.npmmirror.com/rxjs/7.5.2
through: registry.nlark.com/through/2.3.8
wrap-ansi: registry.nlark.com/wrap-ansi/7.0.0
dev: true
@@ -6015,7 +6022,7 @@ packages:
version: 4.17.21
registry.npmmirror.com/log-update/4.0.0:
resolution: {integrity: sha1-WJ7NNSRx8qHAxXAodUOmTf0g4KE=, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/log-update/download/log-update-4.0.0.tgz?cache=0&sync_timestamp=1634543461511&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Flog-update%2Fdownload%2Flog-update-4.0.0.tgz}
resolution: {integrity: sha1-WJ7NNSRx8qHAxXAodUOmTf0g4KE=, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/log-update/download/log-update-4.0.0.tgz}
name: log-update
version: 4.0.0
engines: {node: '>=10'}
@@ -6168,7 +6175,7 @@ packages:
version: 4.0.1
engines: {node: '>=8'}
dependencies:
path-key: registry.npmmirror.com/path-key/3.1.1
path-key: registry.nlark.com/path-key/3.1.1
dev: true
registry.npmmirror.com/object-inspect/1.11.1:
@@ -6226,7 +6233,7 @@ packages:
dev: true
registry.npmmirror.com/p-map/4.0.0:
resolution: {integrity: sha1-uy+Vpe2i7BaOySdOBqdHw+KQTSs=, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/p-map/download/p-map-4.0.0.tgz?cache=0&sync_timestamp=1635932063287&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fp-map%2Fdownload%2Fp-map-4.0.0.tgz}
resolution: {integrity: sha1-uy+Vpe2i7BaOySdOBqdHw+KQTSs=, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/p-map/download/p-map-4.0.0.tgz?cache=0&sync_timestamp=1635932711630&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fp-map%2Fdownload%2Fp-map-4.0.0.tgz}
name: p-map
version: 4.0.0
engines: {node: '>=10'}
@@ -6269,13 +6276,6 @@ packages:
lines-and-columns: registry.npmmirror.com/lines-and-columns/1.2.4
dev: true
registry.npmmirror.com/path-key/3.1.1:
resolution: {integrity: sha1-WB9q3mWMu6ZaDTOA3ndTKVBU83U=, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/path-key/download/path-key-3.1.1.tgz}
name: path-key
version: 3.1.1
engines: {node: '>=8'}
dev: true
registry.npmmirror.com/picocolors/1.0.0:
resolution: {integrity: sha1-y1vcdP8/UYkiNur3nWi8RFZKuBw=, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/picocolors/download/picocolors-1.0.0.tgz}
name: picocolors
@@ -6288,7 +6288,7 @@ packages:
engines: {node: '>=8.6'}
dev: true
registry.npmmirror.com/pinia/2.0.9_typescript@4.5.4+vue@3.2.26:
registry.npmmirror.com/pinia/2.0.9_typescript@4.5.5+vue@3.2.26:
resolution: {integrity: sha512-iuYdxLJKQ07YPyOHYH05wNG9eKWqkP/4y4GE8+RqEYtz5fwHgPA5kr6zQbg/DoEJGnR2XCm1w1vdt6ppzL9ATg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/pinia/download/pinia-2.0.9.tgz}
id: registry.npmmirror.com/pinia/2.0.9
name: pinia
@@ -6304,7 +6304,7 @@ packages:
optional: true
dependencies:
'@vue/devtools-api': registry.npmmirror.com/@vue/devtools-api/6.0.0-beta.21.1
typescript: registry.npmmirror.com/typescript/4.5.4
typescript: registry.npmmirror.com/typescript/4.5.5
vue: registry.npmmirror.com/vue/3.2.26
vue-demi: registry.npmmirror.com/vue-demi/0.12.1_vue@3.2.26
dev: false
@@ -6345,14 +6345,6 @@ packages:
ansi-styles: registry.npmmirror.com/ansi-styles/5.2.0
react-is: registry.npmmirror.com/react-is/17.0.2
registry.npmmirror.com/promise/7.3.1:
resolution: {integrity: sha1-BktyYCsY+Q8pGSuLG8QY/9Hr078=, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/promise/download/promise-7.3.1.tgz}
name: promise
version: 7.3.1
dependencies:
asap: registry.nlark.com/asap/2.0.6
dev: true
registry.npmmirror.com/pug-error/2.0.0:
resolution: {integrity: sha1-XGIXPLCcNN4qLOBPF7it/sdNjKU=, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/pug-error/download/pug-error-2.0.0.tgz}
name: pug-error
@@ -6450,6 +6442,13 @@ packages:
through: registry.nlark.com/through/2.3.8
dev: false
registry.npmmirror.com/reusify/1.0.4:
resolution: {integrity: sha1-kNo4Kx4SbvwCFG6QhFqI2xKSXXY=, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/reusify/download/reusify-1.0.4.tgz}
name: reusify
version: 1.0.4
engines: {iojs: '>=1.0.0', node: '>=0.10.0'}
dev: true
registry.npmmirror.com/rimraf/2.6.3:
resolution: {integrity: sha1-stEE/g2Psnz54KHNqCYt04M8bKs=, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/rimraf/download/rimraf-2.6.3.tgz}
name: rimraf
@@ -6528,10 +6527,10 @@ packages:
tslib: registry.npmmirror.com/tslib/1.14.1
dev: true
registry.npmmirror.com/rxjs/7.5.1:
resolution: {integrity: sha512-KExVEeZWxMZnZhUZtsJcFwz8IvPvgu4G2Z2QyqjZQzUGr32KDYuSxrEYO4w3tFFNbfLozcrKUTvTPi+E9ywJkQ==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/rxjs/download/rxjs-7.5.1.tgz}
registry.npmmirror.com/rxjs/7.5.2:
resolution: {integrity: sha512-PwDt186XaL3QN5qXj/H9DGyHhP3/RYYgZZwqBv9Tv8rsAaiwFH1IsJJlcgD37J7UW5a6O67qX0KWKS3/pu0m4w==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/rxjs/download/rxjs-7.5.2.tgz}
name: rxjs
version: 7.5.1
version: 7.5.2
dependencies:
tslib: registry.npmmirror.com/tslib/2.3.1
dev: true
@@ -6793,7 +6792,7 @@ packages:
version: 0.3.9
dev: false
registry.npmmirror.com/ts-node/10.4.0_82b55006877de54992e74492b614ace9:
registry.npmmirror.com/ts-node/10.4.0_9d6cd740eceb93d711351e2e9548d1bd:
resolution: {integrity: sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/ts-node/download/ts-node-10.4.0.tgz}
id: registry.npmmirror.com/ts-node/10.4.0
name: ts-node
@@ -6822,7 +6821,7 @@ packages:
create-require: registry.nlark.com/create-require/1.1.1
diff: registry.nlark.com/diff/4.0.2
make-error: registry.nlark.com/make-error/1.3.6
typescript: registry.npmmirror.com/typescript/4.5.4
typescript: registry.npmmirror.com/typescript/4.5.5
yn: registry.nlark.com/yn/3.1.1
dev: true
@@ -6882,10 +6881,10 @@ packages:
engines: {node: '>=8'}
dev: true
registry.npmmirror.com/typescript/4.5.4:
resolution: {integrity: sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/typescript/download/typescript-4.5.4.tgz}
registry.npmmirror.com/typescript/4.5.5:
resolution: {integrity: sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/typescript/download/typescript-4.5.5.tgz}
name: typescript
version: 4.5.4
version: 4.5.5
engines: {node: '>=4.2.0'}
hasBin: true
dev: true
@@ -6937,11 +6936,11 @@ packages:
- webpack
dev: true
registry.npmmirror.com/unplugin-vue-components/0.17.13_vite@2.7.13+vue@3.2.26:
resolution: {integrity: sha512-WII6hAW+HSvlXDx4t0LqcAvLg4ESsoBz1nuUDMPx6ZGuKBPjSRP4Wmnk559nZ6qpaOW41iY48cBeUpWSPjH7WA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/unplugin-vue-components/download/unplugin-vue-components-0.17.13.tgz}
id: registry.npmmirror.com/unplugin-vue-components/0.17.13
registry.npmmirror.com/unplugin-vue-components/0.17.14_vite@2.7.13+vue@3.2.26:
resolution: {integrity: sha512-PSJ2EwFTxFSVg/HhUDyoYa5/s6hWqdQzlbJLOIEr0bv4Qczp5YRpTlObld5cjgieFtgPtq2W21A77ucB/msgeg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/unplugin-vue-components/download/unplugin-vue-components-0.17.14.tgz}
id: registry.npmmirror.com/unplugin-vue-components/0.17.14
name: unplugin-vue-components
version: 0.17.13
version: 0.17.14
engines: {node: '>=14'}
peerDependencies:
'@babel/parser': ^7.15.8
@@ -7151,7 +7150,7 @@ packages:
dependencies:
vscode-languageserver-textdocument: registry.npmmirror.com/vscode-languageserver-textdocument/1.0.3
vscode-languageserver-types: registry.npmmirror.com/vscode-languageserver-types/3.16.0
vscode-nls: registry.npmmirror.com/vscode-nls/5.0.0
vscode-nls: registry.nlark.com/vscode-nls/5.0.0
vscode-uri: registry.npmmirror.com/vscode-uri/3.0.3
dev: true
@@ -7162,7 +7161,7 @@ packages:
dependencies:
vscode-languageserver-textdocument: registry.npmmirror.com/vscode-languageserver-textdocument/1.0.3
vscode-languageserver-types: registry.npmmirror.com/vscode-languageserver-types/3.16.0
vscode-nls: registry.npmmirror.com/vscode-nls/5.0.0
vscode-nls: registry.nlark.com/vscode-nls/5.0.0
vscode-uri: registry.npmmirror.com/vscode-uri/3.0.3
dev: true
@@ -7174,7 +7173,7 @@ packages:
jsonc-parser: registry.nlark.com/jsonc-parser/3.0.0
vscode-languageserver-textdocument: registry.npmmirror.com/vscode-languageserver-textdocument/1.0.3
vscode-languageserver-types: registry.npmmirror.com/vscode-languageserver-types/3.16.0
vscode-nls: registry.npmmirror.com/vscode-nls/5.0.0
vscode-nls: registry.nlark.com/vscode-nls/5.0.0
vscode-uri: registry.npmmirror.com/vscode-uri/3.0.3
dev: true
@@ -7212,38 +7211,32 @@ packages:
version: 3.17.0-next.6
dev: true
registry.npmmirror.com/vscode-nls/5.0.0:
resolution: {integrity: sha1-mfDaC9nqfNpE5WWnTFSx8rwleEA=, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/vscode-nls/download/vscode-nls-5.0.0.tgz}
name: vscode-nls
version: 5.0.0
dev: true
registry.npmmirror.com/vscode-pug-languageservice/0.30.6:
resolution: {integrity: sha512-oHXKmHaxLxVYDY6dOmxpm0YfilGgohIMEcE/ahK9O+0lvhgZ4xjEOdP27QcZs90fv92eOWf3CU9tgg4fR6e3+w==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/vscode-pug-languageservice/download/vscode-pug-languageservice-0.30.6.tgz}
registry.npmmirror.com/vscode-pug-languageservice/0.31.1:
resolution: {integrity: sha512-71aQbVF3RjE+dUbUA/DnL1oGaLXXIMEy5z4TkE/irO/qodMjfwVbW/bxMCBwrVrXmIObIMlsWYPD+S/+EE3CXQ==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/vscode-pug-languageservice/download/vscode-pug-languageservice-0.31.1.tgz}
name: vscode-pug-languageservice
version: 0.30.6
version: 0.31.1
dependencies:
'@volar/code-gen': registry.npmmirror.com/@volar/code-gen/0.30.6
'@volar/shared': registry.npmmirror.com/@volar/shared/0.30.6
'@volar/source-map': registry.npmmirror.com/@volar/source-map/0.30.6
'@volar/transforms': registry.npmmirror.com/@volar/transforms/0.30.6
'@volar/code-gen': registry.npmmirror.com/@volar/code-gen/0.31.1
'@volar/shared': registry.npmmirror.com/@volar/shared/0.31.1
'@volar/source-map': registry.npmmirror.com/@volar/source-map/0.31.1
'@volar/transforms': registry.npmmirror.com/@volar/transforms/0.31.1
pug-lexer: registry.nlark.com/pug-lexer/5.0.1
pug-parser: registry.nlark.com/pug-parser/6.0.0
vscode-languageserver-textdocument: registry.npmmirror.com/vscode-languageserver-textdocument/1.0.3
vscode-languageserver-types: registry.npmmirror.com/vscode-languageserver-types/3.17.0-next.6
dev: true
registry.npmmirror.com/vscode-typescript-languageservice/0.30.6:
resolution: {integrity: sha512-Dni0VnMe01QkSvO0z7yIIy+vSll6hWCNtuuWvmBNoHAnFlndgq4OibPrpabv2iv4Lmq+66p40kqGcDg/bpjx5Q==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/vscode-typescript-languageservice/download/vscode-typescript-languageservice-0.30.6.tgz}
registry.npmmirror.com/vscode-typescript-languageservice/0.31.1:
resolution: {integrity: sha512-qJlkrznmRJGHAxIclfnAuJSbNfmKwDfAn7o3PLM7bBqtBvJG6HAFCBXaBWaE1kkM/ELG20Dn8Xi7lCfT15DlpA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/vscode-typescript-languageservice/download/vscode-typescript-languageservice-0.31.1.tgz}
name: vscode-typescript-languageservice
version: 0.30.6
version: 0.31.1
dependencies:
'@volar/shared': registry.npmmirror.com/@volar/shared/0.30.6
'@volar/shared': registry.npmmirror.com/@volar/shared/0.31.1
semver: registry.nlark.com/semver/7.3.5
upath: registry.nlark.com/upath/2.0.1
vscode-languageserver-protocol: registry.npmmirror.com/vscode-languageserver-protocol/3.17.0-next.12
vscode-languageserver-textdocument: registry.npmmirror.com/vscode-languageserver-textdocument/1.0.3
vscode-nls: registry.npmmirror.com/vscode-nls/5.0.0
vscode-nls: registry.nlark.com/vscode-nls/5.0.0
dev: true
registry.npmmirror.com/vscode-uri/2.1.2:
@@ -7258,17 +7251,17 @@ packages:
version: 3.0.3
dev: true
registry.npmmirror.com/vscode-vue-languageservice/0.30.6:
resolution: {integrity: sha512-ZDaW6F2WK0LXt9RpwziKEvhfNxNmpx3ULLfPCGc+jIkM+u00gIB4i2K/5F99yNzbvrtxcgb3emFRH5FBlmmWDQ==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/vscode-vue-languageservice/download/vscode-vue-languageservice-0.30.6.tgz}
registry.npmmirror.com/vscode-vue-languageservice/0.31.1:
resolution: {integrity: sha512-7HY4VkD00iyfWyWpJcl3zObnsa9gBKGjTtrWflFR0SqGHMsccfh7QXdrPmgy/2nFRkD6n60XU7eSYg2rN/QexA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/vscode-vue-languageservice/download/vscode-vue-languageservice-0.31.1.tgz}
name: vscode-vue-languageservice
version: 0.30.6
version: 0.31.1
dependencies:
'@volar/code-gen': registry.npmmirror.com/@volar/code-gen/0.30.6
'@volar/html2pug': registry.npmmirror.com/@volar/html2pug/0.30.6
'@volar/shared': registry.npmmirror.com/@volar/shared/0.30.6
'@volar/source-map': registry.npmmirror.com/@volar/source-map/0.30.6
'@volar/transforms': registry.npmmirror.com/@volar/transforms/0.30.6
'@volar/vue-code-gen': registry.npmmirror.com/@volar/vue-code-gen/0.30.6
'@volar/code-gen': registry.npmmirror.com/@volar/code-gen/0.31.1
'@volar/html2pug': registry.npmmirror.com/@volar/html2pug/0.31.1
'@volar/shared': registry.npmmirror.com/@volar/shared/0.31.1
'@volar/source-map': registry.npmmirror.com/@volar/source-map/0.31.1
'@volar/transforms': registry.npmmirror.com/@volar/transforms/0.31.1
'@volar/vue-code-gen': registry.npmmirror.com/@volar/vue-code-gen/0.31.1
'@vscode/emmet-helper': registry.npmmirror.com/@vscode/emmet-helper/2.8.3
'@vue/reactivity': registry.npmmirror.com/@vue/reactivity/3.2.27
'@vue/shared': registry.npmmirror.com/@vue/shared/3.2.27
@@ -7278,8 +7271,8 @@ packages:
vscode-json-languageservice: registry.npmmirror.com/vscode-json-languageservice/4.1.10
vscode-languageserver-protocol: registry.npmmirror.com/vscode-languageserver-protocol/3.17.0-next.12
vscode-languageserver-textdocument: registry.npmmirror.com/vscode-languageserver-textdocument/1.0.3
vscode-pug-languageservice: registry.npmmirror.com/vscode-pug-languageservice/0.30.6
vscode-typescript-languageservice: registry.npmmirror.com/vscode-typescript-languageservice/0.30.6
vscode-pug-languageservice: registry.npmmirror.com/vscode-pug-languageservice/0.31.1
vscode-typescript-languageservice: registry.npmmirror.com/vscode-typescript-languageservice/0.31.1
dev: true
registry.npmmirror.com/vue-demi/0.12.1_vue@3.2.26:
@@ -7333,18 +7326,18 @@ packages:
vue: registry.npmmirror.com/vue/3.2.26
dev: false
registry.npmmirror.com/vue-tsc/0.30.6_typescript@4.5.4:
resolution: {integrity: sha512-p+lemuubzFgwr1Az3pqQ70uvWraf36qTrKkC6C7anv5S1G3aPerc4eY5Rjz3eVDOkK94E+KeBHevvpZbmVwvHA==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/vue-tsc/download/vue-tsc-0.30.6.tgz}
id: registry.npmmirror.com/vue-tsc/0.30.6
registry.npmmirror.com/vue-tsc/0.31.1_typescript@4.5.5:
resolution: {integrity: sha512-pyLQG1fCA02is6NAL0uY5SKxDfjJRI167x89iRz0gWOB0tUng6NjJZicE+Oh+3ZuN/LJ3J/wKfdW7O+hnfhxdg==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/vue-tsc/download/vue-tsc-0.31.1.tgz}
id: registry.npmmirror.com/vue-tsc/0.31.1
name: vue-tsc
version: 0.30.6
version: 0.31.1
hasBin: true
peerDependencies:
typescript: '*'
dependencies:
'@volar/shared': registry.npmmirror.com/@volar/shared/0.30.6
typescript: registry.npmmirror.com/typescript/4.5.4
vscode-vue-languageservice: registry.npmmirror.com/vscode-vue-languageservice/0.30.6
'@volar/shared': registry.npmmirror.com/@volar/shared/0.31.1
typescript: registry.npmmirror.com/typescript/4.5.5
vscode-vue-languageservice: registry.npmmirror.com/vscode-vue-languageservice/0.31.1
dev: true
registry.npmmirror.com/vue/3.2.26:

View File

@@ -34,8 +34,8 @@ function initSvgLogo(id) {
function addThemeColorCssVars() {
const key = '__THEME_COLOR__';
const themeColor = '#1890ff';
const cssVars = window.localStorage.getItem(key) || `--primary-color: ${themeColor}`;
const themeColor = window.localStorage.getItem(key) || '#1890ff';
const cssVars = `--primary-color: ${themeColor}`;
document.documentElement.style.cssText = cssVars;
}

View File

@@ -0,0 +1,97 @@
<template>
<div v-if="reloadFlag" class="relative">
<slot></slot>
<div v-show="showPlaceholder" class="absolute-lt w-full h-full" :class="placeholderClass">
<div v-show="loading" class="absolute-center">
<n-spin :show="true" :size="loadingSize" />
</div>
<div v-show="isEmpty" class="absolute-center">
<div class="relative" :class="emptyNetworkClass">
<svg-empty-data class="text-primary" />
<p class="absolute-lb w-full text-center">{{ emptyDesc }}</p>
</div>
</div>
<div v-show="!network" class="absolute-center">
<div
class="relative"
:class="[{ 'cursor-pointer': showNetworkReload }, emptyNetworkClass]"
@click="handleReload"
>
<svg-network-error class="text-primary" />
<p class="absolute-lb w-full text-center">{{ networkErrorDesc }}</p>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { computed, watch, nextTick, onUnmounted } from 'vue';
import { NSpin } from 'naive-ui';
import { NETWORK_ERROR_MSG } from '@/config';
import { SvgEmptyData, SvgNetworkError } from '@/components';
import { useBoolean } from '@/hooks';
interface Props {
/** 是否加载 */
loading: boolean;
/** 是否为空 */
empty?: boolean;
/** 加载图标的大小 */
loadingSize?: 'small' | 'medium' | 'large';
/** 中间占位符的class */
placeholderClass?: string;
/** 空数据描述文本 */
emptyDesc?: string;
/** 空数据和网络异常占位class */
emptyNetworkClass?: string;
/** 显示网络异常的重试点击按钮 */
showNetworkReload?: boolean;
}
const props = withDefaults(defineProps<Props>(), {
loading: false,
empty: false,
loadingSize: 'medium',
placeholderClass: 'bg-white',
emptyDesc: '暂无数据',
emptyNetworkClass: 'w-320px h-320px text-16px text-[#666]',
showNetworkReload: false
});
// 网络状态
const { bool: network, setBool: setNetwork } = useBoolean(window.navigator.onLine);
const { bool: reloadFlag, setBool: setReload } = useBoolean(true);
// 数据是否为空
const isEmpty = computed(() => props.empty && !props.loading && network.value);
const showPlaceholder = computed(() => props.loading || isEmpty.value || !network.value);
const networkErrorDesc = computed(() =>
props.showNetworkReload ? `${NETWORK_ERROR_MSG}, 点击重试` : NETWORK_ERROR_MSG
);
function handleReload() {
if (!props.showNetworkReload) return;
setReload(false);
nextTick(() => {
setReload(true);
});
}
const stopHandle = watch(
() => props.loading,
newValue => {
// 结束加载判断一下网络状态
if (!newValue) {
setNetwork(window.navigator.onLine);
}
}
);
onUnmounted(() => {
stopHandle();
});
</script>
<style scoped></style>

View File

@@ -1,3 +1,4 @@
import LoadingEmptyWrapper from './LoadingEmptyWrapper/index.vue';
import LoginAgreement from './LoginAgreement/index.vue';
export { LoginAgreement };
export { LoadingEmptyWrapper, LoginAgreement };

View File

@@ -51,7 +51,7 @@ const { bool: isHover, setTrue, setFalse } = useBoolean();
const isIconActive = computed(() => props.isActive || isHover.value);
const buttonStyle = computed(() => {
const style: { [key: string]: string } = {};
const style: Record<string, string> = {};
if (isIconActive.value) {
style.color = props.primaryColor;
style.borderColor = addColorAlpha(props.primaryColor, 0.3);

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1 @@
export {};

8
src/directives/index.ts Normal file
View File

@@ -0,0 +1,8 @@
import type { App } from 'vue';
import setupNetworkDirective from './network';
import setupLoginDirective from './login';
export function setupDirectives(app: App) {
setupNetworkDirective(app);
setupLoginDirective(app);
}

27
src/directives/login.ts Normal file
View File

@@ -0,0 +1,27 @@
import type { App, Directive } from 'vue';
import { useAuthStore } from '@/store';
import { useRouterPush } from '@/composables';
export default function setupLoginDirective(app: App) {
const auth = useAuthStore();
const { toLogin } = useRouterPush(false);
function listenerHandler(event: MouseEvent) {
if (!auth.isLogin) {
event.stopPropagation();
toLogin();
}
}
const loginDirective: Directive<HTMLElement, boolean | undefined> = {
mounted(el: HTMLElement, binding) {
if (binding.value === false) return;
el.addEventListener('click', listenerHandler, { capture: true });
},
unmounted(el: HTMLElement, binding) {
if (binding.value === false) return;
el.removeEventListener('click', listenerHandler);
}
};
app.directive('login', loginDirective);
}

25
src/directives/network.ts Normal file
View File

@@ -0,0 +1,25 @@
import type { App, Directive } from 'vue';
import { NETWORK_ERROR_MSG } from '@/config';
export default function setupNetworkDirective(app: App) {
function listenerHandler(event: MouseEvent) {
const hasNetwork = window.navigator.onLine;
if (!hasNetwork) {
window.$message?.error(NETWORK_ERROR_MSG);
event.stopPropagation();
}
}
const networkDirective: Directive<HTMLElement, boolean | undefined> = {
mounted(el: HTMLElement, binding) {
if (binding.value === false) return;
el.addEventListener('click', listenerHandler, { capture: true });
},
unmounted(el: HTMLElement, binding) {
if (binding.value === false) return;
el.removeEventListener('click', listenerHandler);
}
};
app.directive('network', networkDirective);
}

View File

@@ -0,0 +1 @@
export {};

View File

@@ -1,3 +1,9 @@
/** 布局组件的名称 */
export enum EnumLayoutComponentName {
basic = 'basic-layout',
blank = 'blank-layout'
}
/** 登录模块 */
export enum EnumLoginModule {
'pwd-login' = '账密登录',

View File

@@ -1,4 +1,5 @@
import {
EnumLayoutComponentName,
EnumThemeLayoutMode,
EnumThemeTabMode,
EnumThemeHorizontalMenuPosition,
@@ -6,6 +7,9 @@ import {
EnumLoginModule
} from '@/enum';
/** 布局组件名称 */
export type LayoutComponentName = keyof typeof EnumLayoutComponentName;
/** 布局模式 */
export type ThemeLayoutMode = keyof typeof EnumThemeLayoutMode;

View File

@@ -23,4 +23,10 @@ export type GlobalBreadcrumb = DropdownOption & {
};
/** 多页签Tab的路由 */
export type GlobalTabRoute = Pick<RouteLocationNormalizedLoaded, 'name' | 'path' | 'meta'>;
export interface GlobalTabRoute extends Pick<RouteLocationNormalizedLoaded, 'name' | 'path' | 'meta'> {
/** 滚动的位置 */
scrollPosition: {
left: number;
top: number;
};
}

View File

@@ -13,6 +13,8 @@ export interface ThemeSetting {
themeColorList: string[];
/** 其他颜色 */
otherColor: ThemeOtherColor;
/** 是否自定义info的颜色(默认取比主题色深一级的颜色) */
isCustomizeInfoColor: boolean;
/** 固定头部和多页签 */
fixedHeaderAndTab: boolean;
/** 显示重载按钮 */

View File

@@ -1,6 +1,7 @@
<template>
<soybean-layout
:mode="mode"
:min-width="theme.layout.minWidth"
:fixed-header-and-tab="theme.fixedHeaderAndTab"
:header-height="theme.header.height"
:tab-visible="theme.tab.visible"

View File

@@ -3,16 +3,18 @@
:class="{ 'p-16px': showPadding }"
class="h-full bg-[#f6f9f8] dark:bg-[#101014] transition duration-300 ease-in-out"
>
<router-view v-slot="{ Component }">
<router-view v-slot="{ Component, route }">
<transition name="fade-slide" mode="out-in" appear>
<component :is="Component" v-if="app.reloadFlag" />
<keep-alive :include="routeStore.cacheRoutes">
<component :is="Component" v-if="app.reloadFlag" :key="route.path" />
</keep-alive>
</transition>
</router-view>
</div>
</template>
<script setup lang="ts">
import { useAppStore } from '@/store';
import { useAppStore, useRouteStore } from '@/store';
interface Props {
/** 显示padding */
@@ -24,5 +26,6 @@ withDefaults(defineProps<Props>(), {
});
const app = useAppStore();
const routeStore = useRouteStore();
</script>
<style scoped></style>

View File

@@ -33,13 +33,14 @@ interface Props {
const props = defineProps<Props>();
type LayoutConfig = {
[key in ThemeLayoutMode]: {
type LayoutConfig = Record<
ThemeLayoutMode,
{
placement: FollowerPlacement;
menuClass: string;
mainClass: string;
};
};
}
>;
const layoutConfig: LayoutConfig = {
vertical: {

View File

@@ -5,13 +5,17 @@
<color-checkbox :color="color" :checked="color === theme.themeColor" @click="theme.setThemeColor(color)" />
</n-grid-item>
</n-grid>
<n-button :block="true" :type="otherColorBtnType" class="mt-12px" @click="openModal">更多颜色</n-button>
<n-space :vertical="true" class="pt-12px">
<n-color-picker :value="theme.themeColor" :show-alpha="false" @update-value="theme.setThemeColor" />
<n-button :block="true" :type="otherColorBtnType" @click="openModal">更多颜色</n-button>
</n-space>
<color-modal :visible="visible" @close="closeModal" />
</template>
<script setup lang="ts">
import { computed } from 'vue';
import { NDivider, NGrid, NGridItem, NButton } from 'naive-ui';
import { NDivider, NGrid, NGridItem, NSpace, NButton, NColorPicker } from 'naive-ui';
import { isInTraditionColors } from '@/settings';
import { useThemeStore } from '@/store';
import { useBoolean } from '@/hooks';
import { ColorCheckbox, ColorModal } from './components';
@@ -20,7 +24,7 @@ const theme = useThemeStore();
const { bool: visible, setTrue: openModal, setFalse: closeModal } = useBoolean();
const isInOther = computed(() => !theme.themeColorList.includes(theme.themeColor));
const isInOther = computed(() => isInTraditionColors(theme.themeColor));
const otherColorBtnType = computed(() => (isInOther.value ? 'primary' : 'default'));
</script>
<style scoped></style>

View File

@@ -2,6 +2,7 @@ import { createApp } from 'vue';
import { setupAssets } from '@/plugins';
import { setupRouter } from '@/router';
import { setupStore } from '@/store';
import { setupDirectives } from '@/directives';
import App from './App.vue';
async function setupApp() {
@@ -13,6 +14,9 @@ async function setupApp() {
// 挂载pinia状态
setupStore(app);
// 挂载自定义vue指令
setupDirectives(app);
// 挂载路由
await setupRouter(app);

View File

@@ -36,6 +36,7 @@ const style = computed(() => {
<style scoped>
.soybean-layout__main {
flex-grow: 1;
width: 100%;
transition-property: padding-left;
}
</style>

View File

@@ -17,6 +17,7 @@
v-bind="commonProps"
:fixed="fixedHeaderAndTab"
:z-index="tabZIndex"
:min-width="minWidth"
:top="headerHeight"
:height="tabHeight"
:padding-left="siderWidth"
@@ -46,6 +47,7 @@
v-bind="commonProps"
:fixed="fixedFooter"
:z-index="footerZIndex"
:min-width="minWidth"
:height="footerHeight"
:padding-left="siderWidth"
:style="footerTransform"

View File

@@ -1,4 +1,3 @@
import setupAssets from './assets';
import setupInitSvgLogo from './logo';
export { setupAssets, setupInitSvgLogo };
export { setupAssets };

View File

@@ -1,28 +0,0 @@
/** 初始化加载效果的svg格式logo */
export default function setupInitSvgLogo(id: string) {
const svgStr = `<svg width="128px" height="128px" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
y="0px" viewBox="0 0 158.9 158.9" style="enable-background:new 0 0 158.9 158.9;" xml:space="preserve">
<path style="fill:none" d="M0,158.9C0,106.3,0,53.7,0,1.1C0,0.2,0.2,0,1.1,0c52.2,0,104.5,0,156.7,0c0.9,0,1.1,0.2,1.1,1.1
c0,52.2,0,104.5,0,156.7c0,0.9-0.2,1.1-1.1,1.1C105.2,158.8,52.6,158.8,0,158.9z" />
<path style="fill:currentColor" d="M81.3,55.9c-0.1-11.7-2.9-22.5-9.4-32.4c-1-1.5-2.1-2.9-2.5-4.7c-0.7-3.4,0.9-6.9,4-8.6c3-1.7,6.8-1.2,9.3,1.2
c2.4,2.6,4.4,5.6,5.9,8.8c4.7,8.9,7.6,18.6,8.4,28.6c1,12.5-0.7,25-5.2,36.7c-0.9,2.5-1.9,4.9-3,7.3c-0.3,0.4-0.3,1,0,1.4
c9.6,13.3,21.8,23,37.8,27.2c6.4,1.7,13.1,2.3,19.7,1.6c4.2-0.4,7.9,2.7,8.4,6.9c0.7,4.3-2.3,8.3-6.6,9c0,0,0,0-0.1,0
c-7.7,0.9-15.5,0.5-23-1.3c-13.9-3.1-26.7-10-36.9-19.9c-4.4-4.2-8.4-8.8-11.9-13.7c-0.5-0.8-1.4-1.2-2.3-1.1
c-9.5,0.7-18.8,3.3-27.4,7.6c-11.6,6-20.7,14.6-26.4,26.4c-0.7,1.9-2,3.5-3.7,4.7c-2.9,1.7-6.6,1.5-9.2-0.7c-2.8-2.2-3.8-6-2.4-9.3
c2.2-5.2,5.1-10.1,8.7-14.5c12.2-15.4,28.2-24.6,47.3-28.6c4-0.8,8.1-1.4,12.2-1.6c0.5,0,1-0.3,1.2-0.8c3.3-7.1,5.5-14.6,6.5-22.3
C81.1,61.2,81.3,58.6,81.3,55.9z" />
<path style="fill:currentColor" d="M136.3,108.3c-3.8-0.5-7.6-1.4-11.1-2.9c-7.7-2.8-14.4-7.5-19.7-13.8c-2.9-3.3-2.5-8.4,0.8-11.3
c1.4-1.2,3.1-1.9,4.9-1.9c2.5-0.1,5,1,6.5,2.9c4.9,5.6,11.6,9.4,18.9,10.8c1.5,0.2,3.1,0.6,4.5,1.2c3.2,1.8,4.8,5.6,3.8,9.2
C144,106.1,140.8,108.4,136.3,108.3z" />
<path style="fill:currentColor" d="M55.7,33.3c3,0.2,5.6,2.2,6.6,5c2.2,5.4,3.4,11.2,3.6,17c0.3,5.9-0.6,11.7-2.5,17.3c-2,5.8-8.2,7.8-12.9,4.2
c-2.6-2.2-3.6-5.8-2.4-9c1.4-4,1.9-8.2,1.7-12.4c-0.2-3.8-1-7.5-2.4-11C45.3,38.9,49.2,33.3,55.7,33.3z" />
<path style="fill:currentColor" d="M77.9,126.6c0,3.9-2.8,7.2-6.7,7.9c-7.8,1.5-14.8,5.9-19.7,12.2c-2.7,3.5-7.6,4.2-11.2,1.6
c-3.6-2.6-4.3-7.6-1.7-11.2c0.1-0.1,0.2-0.3,0.3-0.4c4.1-5.2,9.3-9.6,15.1-12.8c4.4-2.5,9.1-4.2,14-5.1
C73.3,117.7,77.9,121.3,77.9,126.6z" />
</svg>
`;
const appEl = document.querySelector(id);
const div = document.createElement('div');
div.innerHTML = svgStr;
appEl?.appendChild(div);
}

View File

@@ -0,0 +1,46 @@
import type { Router, RouteLocationNormalized, NavigationGuardNext } from 'vue-router';
import { routeName } from '@/router';
import { useRouteStore } from '@/store';
import { getToken } from '@/utils';
/**
* 动态路由
*/
export async function createDynamicRouteGuard(
to: RouteLocationNormalized,
_from: RouteLocationNormalized,
next: NavigationGuardNext,
router: Router
) {
const route = useRouteStore();
const isLogin = Boolean(getToken());
// 初始化动态路由
if (!route.isAddedDynamicRoute) {
// 未登录情况下直接回到登录页,登录成功后再加载动态路由
if (!isLogin) {
if (to.name === routeName('login')) {
next();
} else {
const redirect = to.fullPath;
next({ name: routeName('login'), query: { redirect } });
}
return false;
}
await route.initDynamicRoute(router);
if (to.name === routeName('not-found-page')) {
// 动态路由没有加载导致被not-found-page路由捕获等待动态路由加载好了回到之前的路由
next({ path: to.fullPath, replace: true, query: to.query });
return false;
}
// 动态路由已经加载仍然未找到重定向到not-found
if (to.name === routeName('not-found-page')) {
next({ name: routeName('not-found'), replace: true });
return false;
}
}
return true;
}

View File

@@ -1,6 +1,6 @@
import type { Router } from 'vue-router';
import { useTitle } from '@vueuse/core';
import { handlePagePermission } from './permission';
import { createPermissionGuard } from './permission';
/**
* 路由守卫函数
@@ -11,7 +11,7 @@ export function createRouterGuard(router: Router) {
// 开始 loadingBar
window.$loadingBar?.start();
// 页面跳转权限处理
await handlePagePermission(to, from, next, router);
await createPermissionGuard(to, from, next, router);
});
router.afterEach(to => {
// 设置document title

View File

@@ -1,39 +1,19 @@
import type { Router, RouteLocationNormalized, NavigationGuardNext } from 'vue-router';
import { routeName } from '@/router';
import { useAuthStore, useRouteStore } from '@/store';
import { useAuthStore } from '@/store';
import { exeStrategyActions, getToken } from '@/utils';
import { createDynamicRouteGuard } from './dynamic';
/** 处理路由页面的权限 */
export async function handlePagePermission(
export async function createPermissionGuard(
to: RouteLocationNormalized,
from: RouteLocationNormalized,
next: NavigationGuardNext,
router: Router
) {
const auth = useAuthStore();
const route = useRouteStore();
const isLogin = Boolean(getToken());
const permissions = to.meta.permissions || [];
const needLogin = Boolean(to.meta?.requiresAuth) || Boolean(permissions.length);
const hasPermission = !permissions.length || permissions.includes(auth.userInfo.userRole);
// 初始化动态路由
if (!route.isAddedDynamicRoute) {
await route.initDynamicRoute(router);
if (to.name === routeName('not-found-page')) {
// 动态路由没有加载导致被not-found-page路由捕获等待动态路由加载好了回到之前的路由
next({ path: to.fullPath, replace: true, query: to.query });
return;
}
}
// 动态路由已经加载仍然未找到重定向到not-found
if (to.name === routeName('not-found-page')) {
next({ name: routeName('not-found'), replace: true });
return;
}
// 动态路由
const permission = await createDynamicRouteGuard(to, from, next, router);
if (!permission) return;
// 外链路由, 从新标签打开,返回上一个路由
if (to.meta.href) {
@@ -42,6 +22,12 @@ export async function handlePagePermission(
return;
}
const auth = useAuthStore();
const isLogin = Boolean(getToken());
const permissions = to.meta.permissions || [];
const needLogin = Boolean(to.meta?.requiresAuth) || Boolean(permissions.length);
const hasPermission = !permissions.length || permissions.includes(auth.userInfo.userRole);
const actions: Common.StrategyAction[] = [
// 已登录状态跳转登录页,跳转至首页
[

View File

@@ -0,0 +1 @@
export * from './scroll';

View File

@@ -0,0 +1,33 @@
import type { RouterScrollBehavior } from 'vue-router';
import { useTabStore } from '@/store';
export const scrollBehavior: RouterScrollBehavior = (to, from) => {
return new Promise(resolve => {
const tab = useTabStore();
if (to.hash) {
resolve({
el: to.hash,
behavior: 'smooth'
});
}
const { left, top } = tab.getTabScrollPosition(to.path);
const scrollPosition = {
left,
top
};
const { scrollLeft, scrollTop } = document.documentElement;
const isFromCached = Boolean(from.meta.keepAlive);
if (isFromCached) {
tab.recordTabScrollPosition(from.path, { left: scrollLeft, top: scrollTop });
}
const duration = !scrollPosition.left && !scrollPosition.top ? 0 : 350;
setTimeout(() => {
resolve(scrollPosition);
}, duration);
});
};

View File

@@ -2,6 +2,7 @@ import type { App } from 'vue';
import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router';
import { transformAuthRoutesToVueRoutes } from '@/utils';
import { constantRoutes } from './routes';
import { scrollBehavior } from './helpers';
import { createRouterGuard } from './guard';
const createHistoryFunc = import.meta.env.VITE_IS_VERCEL === '1' ? createWebHashHistory : createWebHistory;
@@ -9,7 +10,7 @@ const createHistoryFunc = import.meta.env.VITE_IS_VERCEL === '1' ? createWebHash
export const router = createRouter({
history: createHistoryFunc(import.meta.env.BASE_URL),
routes: transformAuthRoutesToVueRoutes(constantRoutes),
scrollBehavior: () => ({ left: 0, top: 0 })
scrollBehavior
});
export async function setupRouter(app: App) {

View File

@@ -32,7 +32,7 @@ export function fetchUserInfo() {
* @param userId - 用户id
* @description 后端根据用户id查询到对应的角色类型并将路由筛选出对应角色的路由数据返回前端
*/
export function fetchUserRoutes(userId: string = 'soybean') {
export function fetchUserRoutes(userId: string) {
return mockRequest.post<ApiRoute.Route>('/getUserRoutes', { userId });
}

View File

@@ -1,5 +1,5 @@
import axios from 'axios';
import type { AxiosRequestConfig, AxiosInstance, AxiosError, CancelTokenStatic } from 'axios';
import type { AxiosRequestConfig, AxiosInstance, AxiosError } from 'axios';
import { REQUEST_TIMEOUT, REFRESH_TOKEN_CODE } from '@/config';
import {
getToken,
@@ -18,17 +18,28 @@ import { refreshToken } from './helpers';
export default class CustomAxiosInstance {
instance: AxiosInstance;
private backendSuccessCode = 200;
backendConfig: Service.BackendResultConfig;
cancelToken: CancelTokenStatic;
constructor(axiosConfig: AxiosRequestConfig) {
/**
*
* @param axiosConfig - axios配置
* @param backendSuccessCode - 后端业务上定义的成功请求的状态码
*/
constructor(
axiosConfig: AxiosRequestConfig,
backendConfig: Service.BackendResultConfig = {
codeKey: 'code',
dataKey: 'data',
msgKey: 'message',
successCode: 200
}
) {
this.backendConfig = backendConfig;
const defaultConfig: AxiosRequestConfig = {
timeout: REQUEST_TIMEOUT
};
Object.assign(defaultConfig, axiosConfig);
this.instance = axios.create(defaultConfig);
this.cancelToken = axios.CancelToken;
this.setInterceptor();
}
@@ -55,21 +66,22 @@ export default class CustomAxiosInstance {
async response => {
const { status } = response;
if (status === 200 || status < 300 || status === 304) {
const backend = response.data as Service.BackendServiceResult;
const backend = response.data;
const { codeKey, dataKey, successCode } = this.backendConfig;
// 请求成功
if (backend.code === this.backendSuccessCode) {
return handleServiceResult(null, backend.data);
if (backend[codeKey] === successCode) {
return handleServiceResult(null, backend[dataKey]);
}
// token失效, 刷新token
if (REFRESH_TOKEN_CODE.includes(backend.code)) {
if (REFRESH_TOKEN_CODE.includes(backend[codeKey])) {
const config = await refreshToken(response.config);
if (config) {
return this.instance.request(config);
}
}
const error = handleBackendError(backend);
const error = handleBackendError(backend, this.backendConfig);
return handleServiceResult(error, null);
}
const error = handleResponseError(response);

View File

@@ -16,9 +16,10 @@ interface RequestParam {
/**
* 创建请求
* @param axiosConfig - axios配置
* @param backendConfig - 后端接口字段配置
*/
export function createRequest(axiosConfig: AxiosRequestConfig) {
const customInstance = new CustomAxiosInstance(axiosConfig);
export function createRequest(axiosConfig: AxiosRequestConfig, backendConfig?: Service.BackendResultConfig) {
const customInstance = new CustomAxiosInstance(axiosConfig, backendConfig);
/**
* 异步promise请求
@@ -98,9 +99,10 @@ type RequestResultHook<T = any> = {
/**
* 创建hooks请求
* @param axiosConfig - axios配置
* @param backendConfig - 后端接口字段配置
*/
export function createHookRequest(axiosConfig: AxiosRequestConfig) {
const customInstance = new CustomAxiosInstance(axiosConfig);
export function createHookRequest(axiosConfig: AxiosRequestConfig, backendConfig?: Service.BackendResultConfig) {
const customInstance = new CustomAxiosInstance(axiosConfig, backendConfig);
/**
* hooks请求

View File

@@ -11,3 +11,10 @@ interface TraditionColor {
/** 中国传统颜色 */
export const traditionColors = colorJson as TraditionColor[];
export function isInTraditionColors(color: string) {
return traditionColors.some(item => {
const flag = item.data.some(v => v.color === color);
return flag;
});
}

View File

@@ -3,28 +3,29 @@ import type { ThemeSetting } from '@/interface';
const themeColorList = [
'#1890ff',
'#007AFF',
'#2d8cf0',
'#409EFF',
'#536dfe',
'#2d8cf0',
'#007AFF',
'#5ac8fa',
'#5856D6',
'#536dfe',
'#9c27b0',
'#AF52DE',
'#0096c7',
'#00C1D4',
'#009688',
'#5AC8FA',
'#34C759',
'#71EFA3',
'#43a047',
'#7cb342',
'#c0ca33',
'#78DEC7',
'#FC5404',
'#ee4f12',
'#FF9500',
'#fadb14',
'#FFCC00',
'#FF3B30',
'#FF2D55',
'#ff5c93',
'#9c27b0',
'#AF52DE'
'#e53935',
'#d81b60',
'#f4511e',
'#fb8c00',
'#ffb300',
'#fdd835',
'#6d4c41',
'#546e7a'
];
const defaultThemeSetting: ThemeSetting = {
@@ -47,6 +48,7 @@ const defaultThemeSetting: ThemeSetting = {
warning: '#faad14',
error: '#f5222d'
},
isCustomizeInfoColor: false,
fixedHeaderAndTab: true,
showReload: true,
header: {

View File

@@ -34,6 +34,9 @@ export const useAppStore = defineStore('app-store', {
} else {
this.reloadFlag = true;
}
setTimeout(() => {
document.documentElement.scrollTo({ left: 0, top: 0 });
}, 100);
},
/** 打开设置抽屉 */
openSettingDrawer() {

View File

@@ -1,7 +1,7 @@
import type { Router } from 'vue-router';
import { defineStore } from 'pinia';
import { fetchUserRoutes } from '@/service';
import { transformAuthRouteToMenu, transformAuthRoutesToVueRoutes } from '@/utils';
import { getUserInfo, transformAuthRouteToMenu, transformAuthRoutesToVueRoutes, getCacheRoutes } from '@/utils';
import type { GlobalMenuOption } from '@/interface';
import { useTabStore } from '../tab';
@@ -12,13 +12,16 @@ interface RouteState {
routeHomeName: AuthRoute.RouteKey;
/** 菜单 */
menus: GlobalMenuOption[];
/** 缓存的路由名称 */
cacheRoutes: string[];
}
export const useRouteStore = defineStore('route-store', {
state: (): RouteState => ({
isAddedDynamicRoute: false,
routeHomeName: 'dashboard_analysis',
menus: []
menus: [],
cacheRoutes: []
}),
actions: {
/**
@@ -28,7 +31,9 @@ export const useRouteStore = defineStore('route-store', {
async initDynamicRoute(router: Router) {
const { initHomeTab } = useTabStore();
const { data } = await fetchUserRoutes();
const { userId } = getUserInfo();
if (!userId) return;
const { data } = await fetchUserRoutes(userId);
if (data) {
this.routeHomeName = data.home;
this.menus = transformAuthRouteToMenu(data.routes);
@@ -38,6 +43,8 @@ export const useRouteStore = defineStore('route-store', {
router.addRoute(route);
});
this.cacheRoutes = getCacheRoutes(vueRoutes);
initHomeTab(data.home, router);
this.isAddedDynamicRoute = true;
}

View File

@@ -9,7 +9,11 @@ export function getTabRouteByVueRoute(route: RouteRecordNormalized | RouteLocati
const tabRoute: GlobalTabRoute = {
name: route.name,
path: route.path,
meta: route.meta
meta: route.meta,
scrollPosition: {
left: 0,
top: 0
}
};
return tabRoute;
}

View File

@@ -23,6 +23,10 @@ export const useTabStore = defineStore('tab-store', {
path: '/',
meta: {
title: 'root'
},
scrollPosition: {
left: 0,
top: 0
}
},
activeTab: ''
@@ -132,6 +136,32 @@ export const useTabStore = defineStore('tab-store', {
routerPush(path);
}
},
/**
* 记录tab滚动位置
* @param path - 路由path
* @param position - tab当前页的滚动位置
*/
recordTabScrollPosition(path: string, position: { left: number; top: number }) {
const index = getIndexInTabRoutes(this.tabs, path);
if (index > -1) {
this.tabs[index].scrollPosition = position;
}
},
/**
* 获取tab滚动位置
* @param path - 路由path
*/
getTabScrollPosition(path: string) {
const position = {
left: 0,
top: 0
};
const index = getIndexInTabRoutes(this.tabs, path);
if (index > -1) {
Object.assign(position, this.tabs[index].scrollPosition);
}
return position;
},
/** 初始化Tab状态 */
iniTabStore(currentRoute: RouteLocationNormalizedLoaded) {
const theme = useThemeStore();

View File

@@ -1,6 +1,16 @@
import type { GlobalThemeOverrides } from 'naive-ui';
import { kebabCase } from 'lodash-es';
import { getColorPalette, addColorAlpha } from '@/utils';
import { cloneDeep, kebabCase } from 'lodash-es';
import { themeSetting } from '@/settings';
import { getThemeColor, getColorPalette, addColorAlpha } from '@/utils';
/** 获取主题配置 */
export function getThemeSettings() {
const themeColor = getThemeColor() || themeSetting.themeColor;
const info = themeSetting.isCustomizeInfoColor ? themeSetting.otherColor.info : getColorPalette(themeColor, 7);
const otherColor = { ...themeSetting.otherColor, info };
const setting = cloneDeep({ ...themeSetting, themeColor, otherColor });
return setting;
}
type ColorType = 'primary' | 'info' | 'success' | 'warning' | 'error';
type ColorScene = '' | 'Suppl' | 'Hover' | 'Pressed' | 'Active';
@@ -37,8 +47,11 @@ function getThemeColors(colors: [ColorType, string][]) {
}
/** 获取naive的主题颜色 */
export function getNaiveThemeOverrides(colors: { [key in ColorType]: string }): GlobalThemeOverrides {
const { primary, info, success, warning, error } = colors;
export function getNaiveThemeOverrides(colors: Record<ColorType, string>): GlobalThemeOverrides {
const { primary, success, warning, error } = colors;
const info = themeSetting.isCustomizeInfoColor ? colors.info : getColorPalette(primary, 7);
const themeColors = getThemeColors([
['primary', primary],
['info', info],
@@ -70,7 +83,7 @@ export function addThemeCssVarsToHtml(themeVars: ThemeVars) {
style.push(`--${kebabCase(key)}: ${themeVars[key]}`);
});
const styleStr = style.join(';');
document.documentElement.style.cssText = styleStr;
document.documentElement.style.cssText += styleStr;
}
/** windicss 暗黑模式 */

View File

@@ -1,7 +1,5 @@
import { defineStore } from 'pinia';
import { darkTheme } from 'naive-ui';
import { cloneDeep } from 'lodash-es';
import { themeSetting } from '@/settings';
import type {
ThemeSetting,
ThemeLayoutMode,
@@ -9,12 +7,12 @@ import type {
ThemeHorizontalMenuPosition,
ThemeAnimateMode
} from '@/interface';
import { getNaiveThemeOverrides, addThemeCssVarsToHtml } from './helpers';
import { getThemeSettings, getNaiveThemeOverrides, addThemeCssVarsToHtml } from './helpers';
type ThemeState = ThemeSetting;
export const useThemeStore = defineStore('theme-store', {
state: (): ThemeState => cloneDeep(themeSetting),
state: (): ThemeState => getThemeSettings(),
getters: {
/** naiveUI的主题配置 */
naiveThemeOverrides(state) {

View File

@@ -1,7 +1,7 @@
import { watch, onUnmounted } from 'vue';
import { useOsTheme } from 'naive-ui';
import { useElementSize } from '@vueuse/core';
import { EnumStorageKey } from '@/enum';
import { setThemeColor } from '@/utils';
import { useThemeStore } from '../modules';
/** 订阅theme store */
@@ -14,7 +14,7 @@ export default function subscribeThemeStore() {
const stopThemeColor = watch(
() => theme.themeColor,
newValue => {
window.localStorage.setItem(EnumStorageKey['theme-color'], `--primary-color: ${newValue};`);
setThemeColor(newValue);
},
{ immediate: true }
);

View File

@@ -22,15 +22,19 @@ declare namespace AuthRoute {
| 'document_vite'
| 'document_naive'
| 'document_project'
| 'component'
| 'component_button'
| 'component_card'
| 'component_table'
| 'exception'
| 'exception_403'
| 'exception_404'
| 'exception_500'
| 'multi-menu'
| 'multi-menu_first'
| 'multi-menu_first_second'
| 'multi-menu_first_second-new'
| 'multi-menu_first_second-new_third'
| 'exception'
| 'exception_403'
| 'exception_404'
| 'exception_500'
| 'about';
/** 路由的path */
@@ -55,20 +59,20 @@ declare namespace AuthRoute {
title: string;
/** 路由的动态路径 */
dynamicPath?: PathToDynamicPath<'/login'>;
/** 作为单路由的父级路由布局组件 */
/** 作为单路由的父级路由布局组件 */
singleLayout?: Extract<RouteComponent, 'basic' | 'blank'>;
/** 需要登录权限 */
requiresAuth?: boolean;
/** 哪些类型的用户有权限才能访问的路由 */
/** 哪些类型的用户有权限才能访问的路由(空的话则表示不需要权限) */
permissions?: Auth.RoleType[];
/** 缓存页面 */
keepAlive?: boolean;
/** 菜单和面包屑对应的图标 */
icon?: string;
/** 外链链接 */
href?: string;
/** 是否在菜单中隐藏 */
hide?: boolean;
/** 外链链接 */
href?: string;
/** 路由顺序,可用于菜单的排序 */
order?: number;
/** 表示是否是多级路由的中间级路由(用于转换路由数据时筛选多级路由的标识,定义路由时不用填写) */
@@ -102,14 +106,11 @@ declare namespace AuthRoute {
/** 单独一级路由的key (单独路由需要添加一个父级路由用于应用布局组件) */
type SingleRouteKey = Exclude<
GetSingleRouteKey<RouteKey>,
GetMultiRouteParentKey<RouteKey> | 'root' | 'not-found-page'
GetRouteFirstParentKey<RouteKey> | 'root' | 'not-found-page'
>;
/** 单独路由父级路由key */
type SingleRouteParentKey = `${SingleRouteKey}-parent`;
/** 单独路由path */
type SingleRoutePath = KeyToPath<SingleRouteKey>;
/** 单独路由父级路由path */
type SingleRouteParentPath = KeyToPath<SingleRouteParentKey>;
@@ -124,12 +125,12 @@ declare namespace AuthRoute {
| `${Path}/:module(${string})`
| `${Path}/:module(${string})?`;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
type GetSingleRouteKey<Key extends RouteKey> = Key extends `${infer Left}${RouteSplitMark}${infer Right}`
? never
: Key;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
type GetMultiRouteParentKey<Key extends RouteKey> = Key extends `${infer Left}${RouteSplitMark}${infer Right}`
/** 获取一级路由(包括有子路由的一级路由) */
type GetSingleRouteKey<Key extends RouteKey> =
Key extends `${infer IgnoredLeft}${RouteSplitMark}${infer IgnoredRight}` ? never : Key;
/** 获取子路由的一级父路由 */
type GetRouteFirstParentKey<Key extends RouteKey> = Key extends `${infer Left}${RouteSplitMark}${infer IgnoredRight}`
? Left
: never;
}

View File

@@ -23,14 +23,16 @@ declare namespace Service {
msg: string;
}
/** 后端接口返回的数据的类型 */
interface BackendServiceResult<T = any> {
/** 状态码 */
code: string | number;
/** 接口数据 */
data: T;
/** 接口消息 */
message: string;
/** 后端接口返回的数据结构配置 */
interface BackendResultConfig {
/** 表示后端请求状态码的属性字段 */
codeKey: string;
/** 表示后端请求数据的属性字段 */
dataKey: string;
/** 表示后端消息的属性字段 */
msgKey: string;
/** 后端业务上定义的成功请求的状态 */
successCode: number | string;
}
/** 自定义的请求成功结果 */
@@ -51,4 +53,14 @@ declare namespace Service {
/** 自定义的请求结果 */
type RequestResult<T = any> = SuccessResult<T> | FailedResult;
/** mock示例接口类型后端接口返回的数据的类型 */
interface MockServiceResult<T = any> {
/** 状态码 */
code: string | number;
/** 接口数据 */
data: T;
/** 接口消息 */
message: string;
}
}

View File

@@ -136,3 +136,11 @@ export function addColorAlpha(color: string, alpha: number) {
export function mixColor(firstColor: string, secondColor: string, ratio: number) {
return colord(firstColor).mix(secondColor, ratio).toHex();
}
/**
* 是否是白颜色
* @param color - 颜色
*/
export function isWhiteColor(color: string) {
return colord(color).isEqual('#ffffff');
}

View File

@@ -5,3 +5,4 @@ export * from './number';
export * from './object';
export * from './icon';
export * from './design-pattern';
export * from './theme';

View File

@@ -21,3 +21,14 @@ export function transformToTimeCountDown(seconds: number) {
const second = fillZero(seconds - minuteNum * SECONDS_A_MINUTE);
return `${minute}: ${second}`;
}
/**
* 获取指定整数范围内的随机整数
* @param start - 开始范围
* @param end - 结束范围
*/
export function getRandomInterger(end: number, start: number = 0) {
const range = end - start;
const random = Math.floor(Math.random() * range + start);
return random;
}

View File

@@ -1,4 +1,4 @@
/** 设置对象数据 */
export function objectAssign<T extends { [key: string]: any }>(target: T, source: Partial<T>) {
export function objectAssign<T extends Record<string, any>>(target: T, source: Partial<T>) {
Object.assign(target, source);
}

16
src/utils/common/theme.ts Normal file
View File

@@ -0,0 +1,16 @@
import { EnumStorageKey } from '@/enum';
/**
* 缓存主题颜色
* @param color
*/
export function setThemeColor(color: string) {
window.localStorage.setItem(EnumStorageKey['theme-color'], color);
}
/**
* 获取缓存的主题颜色
*/
export function getThemeColor() {
return window.localStorage.getItem(EnumStorageKey['theme-color']);
}

35
src/utils/router/cache.ts Normal file
View File

@@ -0,0 +1,35 @@
import type { RouteRecordRaw } from 'vue-router';
/**
* 获取缓存的路由对应组件的名称
* @param routes - 转换后的vue路由
*/
export function getCacheRoutes(routes: RouteRecordRaw[]) {
const cacheNames: string[] = [];
routes.forEach(route => {
// 只需要获取二级路由的缓存的组件名
if (hasChildren(route)) {
route.children!.forEach(item => {
if (isKeepAlive(item)) {
cacheNames.push(item.name as string);
}
});
}
});
return cacheNames;
}
/**
* 路由是否缓存
* @param route
*/
function isKeepAlive(route: RouteRecordRaw) {
return Boolean(route?.meta?.keepAlive);
}
/**
* 是否有二级路由
* @param route
*/
function hasChildren(route: RouteRecordRaw) {
return Boolean(route.children && route.children.length);
}

View File

@@ -1,4 +1,6 @@
import type { Component } from 'vue';
import { EnumLayoutComponentName } from '@/enum';
import { BasicLayout, BlankLayout } from '@/layouts';
import {
Login,
NoPermission,
@@ -10,10 +12,28 @@ import {
DocumentVueNew,
DocumentVite,
DocumentNaive,
About,
ComponentButton,
ComponentCard,
ComponentTable,
MultiMenuFirstSecond,
MultiMenuFirstSecondNewThird
MultiMenuFirstSecondNewThird,
About
} from '@/views';
import type { LayoutComponentName } from '@/interface';
type LayoutComponent = Record<LayoutComponentName, () => Promise<Component>>;
/**
* 获取页面导入的vue文件(懒加载的方式)
* @param layoutType - 布局类型
*/
export function getLayoutComponent(layoutType: LayoutComponentName) {
const layoutComponent: LayoutComponent = {
basic: BasicLayout,
blank: BlankLayout
};
return () => setViewComponentName(layoutComponent[layoutType], EnumLayoutComponentName[layoutType]);
}
/** 需要用到自身vue组件的页面 */
type ViewComponentKey = Exclude<
@@ -22,18 +42,18 @@ type ViewComponentKey = Exclude<
| 'dashboard'
| 'document'
| 'document_project'
| 'component'
| 'multi-menu'
| 'multi-menu_first'
| 'multi-menu_first_second-new'
| 'exception'
>;
type ViewComponent = {
[key in ViewComponentKey]: () => Promise<Component>;
};
type ViewComponent = Record<ViewComponentKey, () => Promise<Component>>;
/**
* 获取页面导入的vue文件(懒加载的方式)
* @param routeKey - 路由key
*/
export function getViewComponent(routeKey: AuthRoute.RouteKey) {
const keys: ViewComponentKey[] = [
@@ -47,12 +67,15 @@ export function getViewComponent(routeKey: AuthRoute.RouteKey) {
'document_vue-new',
'document_vite',
'document_naive',
'about',
'multi-menu_first_second',
'multi-menu_first_second-new_third',
'component_button',
'component_card',
'component_table',
'exception_403',
'exception_404',
'exception_500',
'multi-menu_first_second',
'multi-menu_first_second-new_third',
'about',
'not-found-page'
];
@@ -69,13 +92,16 @@ export function getViewComponent(routeKey: AuthRoute.RouteKey) {
'document_vue-new': DocumentVueNew,
document_vite: DocumentVite,
document_naive: DocumentNaive,
'multi-menu_first_second': MultiMenuFirstSecond,
'multi-menu_first_second-new_third': MultiMenuFirstSecondNewThird,
'not-found-page': NotFound,
component_button: ComponentButton,
component_card: ComponentCard,
component_table: ComponentTable,
exception_403: NoPermission,
exception_404: NotFound,
exception_500: ServiceError,
about: About
'multi-menu_first_second': MultiMenuFirstSecond,
'multi-menu_first_second-new_third': MultiMenuFirstSecondNewThird,
about: About,
'not-found-page': NotFound
};
return () => setViewComponentName(viewComponent[key], key) as Promise<Component>;

View File

@@ -1,15 +1,13 @@
import type { RouteRecordRaw } from 'vue-router';
import { BasicLayout, BlankLayout } from '@/layouts';
import { consoleError } from '../common';
import { getViewComponent } from './component';
import { getLayoutComponent, getViewComponent } from './component';
type ComponentAction = {
[key in AuthRoute.RouteComponent]: () => void;
};
type ComponentAction = Record<AuthRoute.RouteComponent, () => void>;
/**
* 将权限路由转换成vue路由
* @param routes - 权限路由
* @description 所有多级路由都会被转换成二级路由
*/
export function transformAuthRoutesToVueRoutes(routes: AuthRoute.Route[]) {
return routes.map(route => transformAuthRouteToVueRoute(route)).flat(1);
@@ -38,10 +36,10 @@ function transformAuthRouteToVueRoute(item: AuthRoute.Route) {
if (hasComponent(item)) {
const action: ComponentAction = {
basic() {
itemRoute.component = BasicLayout;
itemRoute.component = getLayoutComponent('basic');
},
blank() {
itemRoute.component = BlankLayout;
itemRoute.component = getLayoutComponent('blank');
},
multi() {
// 多级路由一定有子路由
@@ -81,7 +79,7 @@ function transformAuthRouteToVueRoute(item: AuthRoute.Route) {
} else {
const parentPath = `${itemRoute.path}-parent` as AuthRoute.SingleRouteParentPath;
const layout = item.meta.singleLayout === 'basic' ? BasicLayout : BlankLayout;
const layout = item.meta.singleLayout === 'basic' ? getLayoutComponent('basic') : getLayoutComponent('blank');
const parentRoute: RouteRecordRaw = {
path: parentPath,
@@ -120,22 +118,42 @@ function transformAuthRouteToVueRoute(item: AuthRoute.Route) {
return resultRoute;
}
/**
* 是否有外链
* @param item - 权限路由
*/
function hasHref(item: AuthRoute.Route) {
return Boolean(item.meta.href);
}
/**
* 是否有动态路由path
* @param item - 权限路由
*/
function hasDynamicPath(item: AuthRoute.Route) {
return Boolean(item.meta.dynamicPath);
}
/**
* 是否有路由组件
* @param item - 权限路由
*/
function hasComponent(item: AuthRoute.Route) {
return Boolean(item.component);
}
/**
* 是否有子路由
* @param item - 权限路由
*/
function hasChildren(item: AuthRoute.Route) {
return Boolean(item.children && item.children.length);
}
/**
* 是否是单层级路由
* @param item - 权限路由
*/
function isSingleRoute(item: AuthRoute.Route) {
return Boolean(item.meta.singleLayout);
}

View File

@@ -1,4 +1,5 @@
export * from './helpers';
export * from './cache';
export * from './menu';
export * from './breadcrumb';
export * from './tab';

View File

@@ -12,7 +12,14 @@ export function getTabRoutes() {
const routes: GlobalTabRoute[] = [];
const data = getLocal<GlobalTabRoute[]>(EnumStorageKey['tab-routes']);
if (data) {
routes.push(...data);
const defaultTabRoutes = data.map(item => ({
...item,
scrollPosition: {
left: 0,
top: 0
}
}));
routes.push(...defaultTabRoutes);
}
return routes;
}

View File

@@ -87,11 +87,12 @@ export function handleResponseError(response: AxiosResponse) {
* 处理后端返回的错误(业务错误)
* @param backendResult - 后端接口的响应数据
*/
export function handleBackendError(backendResult: Service.BackendServiceResult) {
export function handleBackendError(backendResult: Record<string, any>, config: Service.BackendResultConfig) {
const { codeKey, msgKey } = config;
const error: Service.RequestError = {
type: 'backend',
code: backendResult.code,
msg: backendResult.message
code: backendResult[codeKey],
msg: backendResult[msgKey]
};
showErrorMsg(error);

View File

@@ -9,12 +9,8 @@ export interface PkgVersionInfo {
interface Package {
name: string;
version: string;
dependencies: {
[key: string]: string;
};
devDependencies: {
[key: string]: string;
};
dependencies: Record<string, string>;
devDependencies: Record<string, string>;
[key: string]: any;
}

View File

@@ -0,0 +1,576 @@
<template>
<div>
<n-card title="按钮" class="h-full shadow-sm rounded-16px">
<n-grid cols="s:1 m:2" responsive="screen" :x-gap="16" :y-gap="16">
<n-grid-item v-for="item in buttonExample" :key="item.id">
<n-card :title="item.label" class="min-h-180px">
<p v-if="item.desc" class="pb-16px">{{ item.desc }}</p>
<n-space>
<n-button
v-for="button in item.buttons"
:key="button.id"
v-bind="button.props"
:style="`--icon-margin: ${button.props.circle ? 0 : 6}px`"
>
<template v-if="button.icon" #icon>
<Icon :icon="button.icon" />
</template>
{{ button.label }}
</n-button>
</n-space>
</n-card>
</n-grid-item>
<n-grid-item class="h-180px">
<n-card title="加载中" class="h-full">
<p class="pb-16px">按钮有加载状态</p>
<n-space>
<n-button :loading="loading" type="primary" @click="startLoading">开始加载</n-button>
<n-button @click="endLoading">取消加载</n-button>
</n-space>
</n-card>
</n-grid-item>
</n-grid>
</n-card>
</div>
</template>
<script setup lang="ts">
import { NCard, NGrid, NGridItem, NSpace, NButton } from 'naive-ui';
import type { ButtonProps } from 'naive-ui';
import { Icon } from '@iconify/vue';
import { useLoading } from '@/hooks';
interface ButtonDetail {
id: number;
props: ButtonProps & { href?: string; target?: string };
label?: string;
icon?: string;
}
interface ButtonExample {
id: number;
label: string;
buttons: ButtonDetail[];
desc?: string;
}
const { loading, startLoading, endLoading } = useLoading();
const buttonExample: ButtonExample[] = [
{
id: 0,
label: '基础',
buttons: [
{
id: 0,
props: {},
label: 'Default'
},
{
id: 1,
props: { type: 'tertiary' },
label: 'Tertiary'
},
{
id: 2,
props: { type: 'primary' },
label: 'Primary'
},
{
id: 3,
props: { type: 'info' },
label: 'Info'
},
{
id: 4,
props: { type: 'success' },
label: 'Success'
},
{
id: 5,
props: { type: 'warning' },
label: 'Warning'
},
{
id: 6,
props: { type: 'error' },
label: 'Error'
}
],
desc: '按钮的 type 分别为 default、primary、info、success、warning 和 error。'
},
{
id: 1,
label: '次要按钮',
buttons: [
{
id: 0,
props: { strong: true, secondary: true },
label: 'Default'
},
{
id: 1,
props: { strong: true, secondary: true, type: 'tertiary' },
label: 'Tertiary'
},
{
id: 2,
props: { strong: true, secondary: true, type: 'primary' },
label: 'Primary'
},
{
id: 3,
props: { strong: true, secondary: true, type: 'info' },
label: 'Info'
},
{
id: 4,
props: { strong: true, secondary: true, type: 'success' },
label: 'Success'
},
{
id: 5,
props: { strong: true, secondary: true, type: 'warning' },
label: 'Warning'
},
{
id: 6,
props: { strong: true, secondary: true, type: 'error' },
label: 'Error'
},
{
id: 7,
props: { strong: true, secondary: true, round: true },
label: 'Default'
},
{
id: 8,
props: { strong: true, secondary: true, round: true, type: 'tertiary' },
label: 'Tertiary'
},
{
id: 9,
props: { strong: true, secondary: true, round: true, type: 'primary' },
label: 'Primary'
},
{
id: 10,
props: { strong: true, secondary: true, round: true, type: 'info' },
label: 'Info'
},
{
id: 11,
props: { strong: true, secondary: true, round: true, type: 'success' },
label: 'Success'
},
{
id: 12,
props: { strong: true, secondary: true, round: true, type: 'warning' },
label: 'Warning'
},
{
id: 13,
props: { strong: true, secondary: true, round: true, type: 'error' },
label: 'Error'
}
]
},
{
id: 2,
label: '次次要按钮',
buttons: [
{
id: 0,
props: { tertiary: true },
label: 'Default'
},
{
id: 1,
props: { tertiary: true, type: 'primary' },
label: 'Primary'
},
{
id: 2,
props: { tertiary: true, type: 'info' },
label: 'Info'
},
{
id: 3,
props: { tertiary: true, type: 'success' },
label: 'Success'
},
{
id: 4,
props: { tertiary: true, type: 'warning' },
label: 'Warning'
},
{
id: 5,
props: { tertiary: true, type: 'error' },
label: 'Error'
},
{
id: 6,
props: { tertiary: true, round: true },
label: 'Default'
},
{
id: 7,
props: { tertiary: true, round: true, type: 'primary' },
label: 'Primary'
},
{
id: 8,
props: { tertiary: true, round: true, type: 'info' },
label: 'Info'
},
{
id: 9,
props: { tertiary: true, round: true, type: 'success' },
label: 'Success'
},
{
id: 10,
props: { tertiary: true, round: true, type: 'warning' },
label: 'Warning'
},
{
id: 11,
props: { tertiary: true, round: true, type: 'error' },
label: 'Error'
}
]
},
{
id: 3,
label: '次次次要按钮',
buttons: [
{
id: 0,
props: { quaternary: true },
label: 'Default'
},
{
id: 1,
props: { quaternary: true, type: 'primary' },
label: 'Primary'
},
{
id: 2,
props: { quaternary: true, type: 'info' },
label: 'Info'
},
{
id: 3,
props: { quaternary: true, type: 'success' },
label: 'Success'
},
{
id: 4,
props: { quaternary: true, type: 'warning' },
label: 'Warning'
},
{
id: 5,
props: { quaternary: true, type: 'error' },
label: 'Error'
},
{
id: 6,
props: { quaternary: true, round: true },
label: 'Default'
},
{
id: 7,
props: { quaternary: true, round: true, type: 'primary' },
label: 'Primary'
},
{
id: 8,
props: { quaternary: true, round: true, type: 'info' },
label: 'Info'
},
{
id: 9,
props: { quaternary: true, round: true, type: 'success' },
label: 'Success'
},
{
id: 10,
props: { quaternary: true, round: true, type: 'warning' },
label: 'Warning'
},
{
id: 11,
props: { quaternary: true, round: true, type: 'error' },
label: 'Error'
}
]
},
{
id: 4,
label: '虚线按钮',
buttons: [
{
id: 0,
props: { dashed: true },
label: 'Default'
},
{
id: 1,
props: { dashed: true, type: 'tertiary' },
label: 'Tertiary'
},
{
id: 2,
props: { dashed: true, type: 'primary' },
label: 'Primary'
},
{
id: 3,
props: { dashed: true, type: 'info' },
label: 'Info'
},
{
id: 4,
props: { dashed: true, type: 'success' },
label: 'Success'
},
{
id: 5,
props: { dashed: true, type: 'warning' },
label: 'Warning'
},
{
id: 6,
props: { dashed: true, type: 'error' },
label: 'Error'
}
]
},
{
id: 5,
label: '尺寸',
buttons: [
{
id: 0,
props: { size: 'tiny', strong: true },
label: '小小'
},
{
id: 1,
props: { size: 'small', strong: true },
label: '小'
},
{
id: 2,
props: { size: 'medium', strong: true },
label: '不小'
},
{
id: 3,
props: { size: 'large', strong: true },
label: '不不小'
}
]
},
{
id: 6,
label: '文本按钮',
buttons: [
{
id: 0,
props: { text: true },
label: '那车头依然吐着烟',
icon: 'mdi:train'
}
]
},
{
id: 7,
label: '自定义标签按钮',
buttons: [
{
id: 0,
props: {
text: true,
tag: 'a',
href: 'https://github.com/honghuangdc/soybean-admin',
target: '_blank',
type: 'primary'
},
label: 'soybean-admin'
}
],
desc: '你可以把按钮渲染成不同的标签,比如 a标签 。'
},
{
id: 8,
label: '按钮禁用',
buttons: [
{
id: 0,
props: {
disabled: true
},
label: '不许点'
}
],
desc: '按钮可以被禁用'
},
{
id: 9,
label: '图标按钮',
buttons: [
{
id: 0,
props: {
secondary: true,
strong: true
},
label: '+100元',
icon: 'mdi:cash-100'
},
{
id: 0,
props: {
iconPlacement: 'right',
secondary: true,
strong: true
},
label: '+100元',
icon: 'mdi:cash-100'
}
],
desc: '在按钮上使用图标。'
},
{
id: 10,
label: '不同形状按钮',
buttons: [
{
id: 0,
props: {
circle: true
},
icon: 'mdi:cash-100'
},
{
id: 1,
props: {
round: true
},
label: '圆角'
},
{
id: 2,
props: {},
label: '方'
}
],
desc: '按钮拥有不同的形状。'
},
{
id: 11,
label: '透明背景按钮',
buttons: [
{
id: 0,
props: { ghost: true },
label: 'Default'
},
{
id: 1,
props: { ghost: true, type: 'tertiary' },
label: 'Tertiary'
},
{
id: 2,
props: { ghost: true, type: 'primary' },
label: 'Primary'
},
{
id: 3,
props: { ghost: true, type: 'info' },
label: 'Info'
},
{
id: 4,
props: { ghost: true, type: 'success' },
label: 'Success'
},
{
id: 5,
props: { ghost: true, type: 'warning' },
label: 'Warning'
},
{
id: 6,
props: { ghost: true, type: 'error' },
label: 'Error'
}
],
desc: 'Ghost 按钮有透明的背景。'
},
{
id: 12,
label: '自定义颜色',
buttons: [
{
id: 0,
props: {
color: '#8a2be2'
},
label: '#8a2be2',
icon: 'ic:baseline-color-lens'
},
{
id: 1,
props: {
color: '#ff69b4'
},
label: '#ff69b4',
icon: 'ic:baseline-color-lens'
},
{
id: 2,
props: {
color: '#8a2be2',
ghost: true
},
label: '#8a2be2',
icon: 'ic:baseline-color-lens'
},
{
id: 3,
props: {
color: '#ff69b4',
ghost: true
},
label: '#ff69b4',
icon: 'ic:baseline-color-lens'
},
{
id: 4,
props: {
color: '#8a2be2',
text: true
},
label: '#8a2be2',
icon: 'ic:baseline-color-lens'
},
{
id: 5,
props: {
color: '#ff69b4',
text: true
},
label: '#ff69b4',
icon: 'ic:baseline-color-lens'
}
],
desc: '这两个颜色看起来像毒蘑菇。'
}
];
</script>
<style scoped></style>

View File

@@ -0,0 +1,43 @@
<template>
<div>
<n-card title="卡片" class="h-full shadow-sm rounded-16px">
<n-space :vertical="true">
<n-card title="基本用法">
<p class="pb-16px">基础卡片</p>
<n-card title="卡片">卡片内容</n-card>
</n-card>
<n-card title="尺寸">
<p class="pb-16px">卡片有 smallmediumlargehuge 尺寸</p>
<n-space vertical>
<n-card title="小卡片" size="small">卡片内容</n-card>
<n-card title="中卡片" size="medium">卡片内容</n-card>
<n-card title="大卡片" size="large">卡片内容</n-card>
<n-card title="超大卡片" size="huge">卡片内容</n-card>
</n-space>
</n-card>
<n-card title="文本按钮">
<p class="pb-16px">
content footer 可以被 hard soft 分段action 可以被分段分段分割线会在区域的上方出现
</p>
<n-card
title="卡片分段示例"
:segmented="{
content: true,
footer: 'soft'
}"
>
<template #header-extra>#header-extra</template>
卡片内容
<template #footer>#footer</template>
<template #action>#action</template>
</n-card>
</n-card>
</n-space>
</n-card>
</div>
</template>
<script setup lang="ts">
import { NCard, NSpace } from 'naive-ui';
</script>
<style scoped></style>

View File

@@ -0,0 +1,5 @@
const ComponentButton = () => import('./button/index.vue');
const ComponentCard = () => import('./card/index.vue');
const ComponentTable = () => import('./table/index.vue');
export { ComponentButton, ComponentCard, ComponentTable };

View File

@@ -0,0 +1,85 @@
<template>
<div>
<n-card title="表格" class="h-full shadow-sm rounded-16px">
<n-space :vertical="true">
<n-space>
<n-button @click="getDataSource">有数据</n-button>
<n-button @click="getEmptyDataSource">空数据</n-button>
</n-space>
<loading-empty-wrapper class="h-480px" :loading="loading" :empty="empty">
<n-data-table :columns="columns" :data="dataSource" :flex-height="true" class="h-480px" />
</loading-empty-wrapper>
</n-space>
</n-card>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { NCard, NSpace, NButton, NDataTable } from 'naive-ui';
import type { DataTableColumn } from 'naive-ui';
import { LoadingEmptyWrapper } from '@/components';
import { useLoadingEmpty } from '@/hooks';
import { getRandomInterger } from '@/utils';
interface DataSource {
name: string;
age: number;
address: string;
}
const { loading, startLoading, endLoading, empty, setEmpty } = useLoadingEmpty();
const columns: DataTableColumn[] = [
{
title: 'Name',
key: 'name',
align: 'center'
},
{
title: 'Age',
key: 'age'
},
{
title: 'Address',
key: 'address'
}
];
const dataSource = ref<DataSource[]>([]);
function createDataSource(): DataSource[] {
return Array(100)
.fill(1)
.map((_item, index) => {
return {
name: `Name${index}`,
age: getRandomInterger(30, 20),
address: '中国'
};
});
}
function getDataSource() {
startLoading();
setTimeout(() => {
dataSource.value = createDataSource();
endLoading();
setEmpty(!dataSource.value.length);
}, 1000);
}
function getEmptyDataSource() {
startLoading();
setTimeout(() => {
dataSource.value = [];
endLoading();
setEmpty(!dataSource.value.length);
}, 1000);
}
onMounted(() => {
getDataSource();
});
</script>
<style scoped></style>

View File

@@ -1,5 +1,6 @@
export * from './system';
export * from './dashboard';
export * from './document';
export * from './component';
export * from './about';
export * from './multi-menu';

View File

@@ -23,9 +23,7 @@ interface Props {
type: ExceptionType;
}
type ExceptionComponent = {
[key in ExceptionType]: Component;
};
type ExceptionComponent = Record<ExceptionType, Component>;
const props = defineProps<Props>();