diff --git a/package.json b/package.json index 90fbfbb..754149b 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,8 @@ "@zxcvbn-ts/core": "^1.2.0", "animate.css": "^4.1.1", "axios": "^0.25.0", + "echarts": "^5.2.2", + "echarts-wordcloud": "^2.0.0", "element-plus": "1.3.0-beta.5", "lodash-es": "^4.17.21", "mockjs": "^1.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a9dd38e..dc3b93d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,6 +21,8 @@ specifiers: autoprefixer: ^10.4.2 axios: ^0.25.0 commitizen: ^4.2.4 + echarts: ^5.2.2 + echarts-wordcloud: ^2.0.0 element-plus: 1.3.0-beta.5 eslint: ^8.7.0 eslint-config-prettier: ^8.3.0 @@ -70,6 +72,8 @@ dependencies: '@zxcvbn-ts/core': registry.npmmirror.com/@zxcvbn-ts/core/1.2.0 animate.css: registry.npmmirror.com/animate.css/4.1.1 axios: registry.npmmirror.com/axios/0.25.0 + echarts: registry.npmmirror.com/echarts/5.2.2 + echarts-wordcloud: registry.npmmirror.com/echarts-wordcloud/2.0.0_echarts@5.2.2 element-plus: registry.npmmirror.com/element-plus/1.3.0-beta.5_vue@3.2.26 lodash-es: registry.nlark.com/lodash-es/4.17.21 mockjs: registry.npmmirror.com/mockjs/1.1.0 @@ -350,38 +354,6 @@ packages: version: 1.0.2 dev: true - registry.nlark.com/acorn-jsx/5.3.2_acorn@7.4.1: - resolution: - { - integrity: sha1-ftW7VZCLOy8bxVxq8WU7rafweTc=, - registry: https://registry.npm.taobao.org/, - tarball: https://registry.nlark.com/acorn-jsx/download/acorn-jsx-5.3.2.tgz - } - id: registry.nlark.com/acorn-jsx/5.3.2 - name: acorn-jsx - version: 5.3.2 - peerDependencies: - acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - dependencies: - acorn: registry.npmmirror.com/acorn/7.4.1 - dev: true - - registry.nlark.com/acorn-jsx/5.3.2_acorn@8.7.0: - resolution: - { - integrity: sha1-ftW7VZCLOy8bxVxq8WU7rafweTc=, - registry: https://registry.npm.taobao.org/, - tarball: https://registry.nlark.com/acorn-jsx/download/acorn-jsx-5.3.2.tgz - } - id: registry.nlark.com/acorn-jsx/5.3.2 - name: acorn-jsx - version: 5.3.2 - peerDependencies: - acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - dependencies: - acorn: registry.npmmirror.com/acorn/8.7.0 - dev: true - registry.nlark.com/acorn-walk/8.2.0: resolution: { @@ -1781,7 +1753,7 @@ packages: { integrity: sha1-0t5eA0JOcH3BDHQGjd7a5wh0Gyc=, registry: https://registry.npm.taobao.org/, - tarball: https://registry.nlark.com/eslint-utils/download/eslint-utils-2.1.0.tgz + tarball: https://registry.nlark.com/eslint-utils/download/eslint-utils-2.1.0.tgz?cache=0&sync_timestamp=1631600361784&other_urls=https%3A%2F%2Fregistry.nlark.com%2Feslint-utils%2Fdownload%2Feslint-utils-2.1.0.tgz } name: eslint-utils version: 2.1.0 @@ -6244,6 +6216,19 @@ packages: engines: { node: '>=10' } dev: true + registry.nlark.com/zrender/5.2.1: + resolution: + { + integrity: sha1-X0u9qRW6bUErCxncJDG+qtBUF7s=, + registry: https://registry.npm.taobao.org/, + tarball: https://registry.nlark.com/zrender/download/zrender-5.2.1.tgz + } + name: zrender + version: 5.2.1 + dependencies: + tslib: registry.npmmirror.com/tslib/2.3.0 + dev: false + registry.npmmirror.com/@antfu/utils/0.3.0: resolution: { @@ -8402,6 +8387,38 @@ packages: through: registry.nlark.com/through/2.3.8 dev: true + registry.npmmirror.com/acorn-jsx/5.3.2_acorn@7.4.1: + resolution: + { + integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==, + registry: https://registry.npm.taobao.org/, + tarball: https://registry.npmmirror.com/acorn-jsx/download/acorn-jsx-5.3.2.tgz + } + id: registry.npmmirror.com/acorn-jsx/5.3.2 + name: acorn-jsx + version: 5.3.2 + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + acorn: registry.npmmirror.com/acorn/7.4.1 + dev: true + + registry.npmmirror.com/acorn-jsx/5.3.2_acorn@8.7.0: + resolution: + { + integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==, + registry: https://registry.npm.taobao.org/, + tarball: https://registry.npmmirror.com/acorn-jsx/download/acorn-jsx-5.3.2.tgz + } + id: registry.npmmirror.com/acorn-jsx/5.3.2 + name: acorn-jsx + version: 5.3.2 + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + acorn: registry.npmmirror.com/acorn/8.7.0 + dev: true + registry.npmmirror.com/acorn/7.4.1: resolution: { @@ -9378,6 +9395,36 @@ packages: domhandler: registry.npmmirror.com/domhandler/4.3.0 dev: true + registry.npmmirror.com/echarts-wordcloud/2.0.0_echarts@5.2.2: + resolution: + { + integrity: sha512-K7l6pTklqdW7ZWzT/1CS0KhBSINr/cd7c5N1fVMzZMwLQHEwT7x+nivK7g5hkVh7WNcAv4Dn6/ZS5zMKRozC1g==, + registry: https://registry.npm.taobao.org/, + tarball: https://registry.npmmirror.com/echarts-wordcloud/download/echarts-wordcloud-2.0.0.tgz + } + id: registry.npmmirror.com/echarts-wordcloud/2.0.0 + name: echarts-wordcloud + version: 2.0.0 + peerDependencies: + echarts: ^5.0.1 + dependencies: + echarts: registry.npmmirror.com/echarts/5.2.2 + dev: false + + registry.npmmirror.com/echarts/5.2.2: + resolution: + { + integrity: sha512-yxuBfeIH5c+0FsoRP60w4De6omXhA06c7eUYBsC1ykB6Ys2yK5fSteIYWvkJ4xJVLQgCvAdO8C4mN6MLeJpBaw==, + registry: https://registry.npm.taobao.org/, + tarball: https://registry.npmmirror.com/echarts/download/echarts-5.2.2.tgz + } + name: echarts + version: 5.2.2 + dependencies: + tslib: registry.npmmirror.com/tslib/2.3.0 + zrender: registry.nlark.com/zrender/5.2.1 + dev: false + registry.npmmirror.com/electron-to-chromium/1.4.30: resolution: { @@ -10035,7 +10082,7 @@ packages: engines: { node: '>=6.0.0' } dependencies: acorn: registry.npmmirror.com/acorn/7.4.1 - acorn-jsx: registry.nlark.com/acorn-jsx/5.3.2_acorn@7.4.1 + acorn-jsx: registry.npmmirror.com/acorn-jsx/5.3.2_acorn@7.4.1 eslint-visitor-keys: registry.npmmirror.com/eslint-visitor-keys/1.3.0 dev: true @@ -10051,7 +10098,7 @@ packages: engines: { node: ^10.12.0 || >=12.0.0 } dependencies: acorn: registry.npmmirror.com/acorn/7.4.1 - acorn-jsx: registry.nlark.com/acorn-jsx/5.3.2_acorn@7.4.1 + acorn-jsx: registry.npmmirror.com/acorn-jsx/5.3.2_acorn@7.4.1 eslint-visitor-keys: registry.npmmirror.com/eslint-visitor-keys/1.3.0 dev: true @@ -10067,7 +10114,7 @@ packages: engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } dependencies: acorn: registry.npmmirror.com/acorn/8.7.0 - acorn-jsx: registry.nlark.com/acorn-jsx/5.3.2_acorn@8.7.0 + acorn-jsx: registry.npmmirror.com/acorn-jsx/5.3.2_acorn@8.7.0 eslint-visitor-keys: registry.npmmirror.com/eslint-visitor-keys/3.2.0 dev: true @@ -12239,6 +12286,17 @@ packages: version: 1.14.1 dev: true + registry.npmmirror.com/tslib/2.3.0: + resolution: + { + integrity: sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==, + registry: https://registry.npm.taobao.org/, + tarball: https://registry.npmmirror.com/tslib/download/tslib-2.3.0.tgz + } + name: tslib + version: 2.3.0 + dev: false + registry.npmmirror.com/tslib/2.3.1: resolution: { diff --git a/src/components/CountTo/index.ts b/src/components/CountTo/index.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/components/CountTo/src/CountTo.vue b/src/components/CountTo/src/CountTo.vue new file mode 100644 index 0000000..a5d54dc --- /dev/null +++ b/src/components/CountTo/src/CountTo.vue @@ -0,0 +1,175 @@ + + + diff --git a/src/components/Echart/index.ts b/src/components/Echart/index.ts new file mode 100644 index 0000000..4822092 --- /dev/null +++ b/src/components/Echart/index.ts @@ -0,0 +1,3 @@ +import Echart from './src/Echart.vue' + +export { Echart } diff --git a/src/components/Echart/src/Echart.vue b/src/components/Echart/src/Echart.vue new file mode 100644 index 0000000..98d9456 --- /dev/null +++ b/src/components/Echart/src/Echart.vue @@ -0,0 +1,110 @@ + + + diff --git a/src/components/TagsView/src/TagsView.vue b/src/components/TagsView/src/TagsView.vue index f06590c..986404f 100644 --- a/src/components/TagsView/src/TagsView.vue +++ b/src/components/TagsView/src/TagsView.vue @@ -147,6 +147,7 @@ watch( { icon: 'ant-design:close-outlined', label: t('common.closeTab'), + disabled: !!visitedViews?.length && selectedTag?.meta.affix, command: () => { closeSelectedTag(item) } @@ -243,7 +244,8 @@ watch( }, { icon: 'ant-design:close-outlined', - label: t('common.closeTab') + label: t('common.closeTab'), + disabled: !!visitedViews?.length && selectedTag?.meta.affix }, { divided: true, diff --git a/src/layout/components/useRenderLayout.tsx b/src/layout/components/useRenderLayout.tsx index 3b5fa19..94f3ba0 100644 --- a/src/layout/components/useRenderLayout.tsx +++ b/src/layout/components/useRenderLayout.tsx @@ -49,7 +49,7 @@ export const useRenderLayout = () => {
{ {
{ {
-
+
{ {/* */}
{ { const redirect = decodeURIComponent(redirectPath as string) const nextData = to.path === redirect ? { ...to, replace: true } : { path: redirect } permissionStore.setIsAddRouters(true) - next(nextData) + next(to.path === '/' ? { path: permissionStore.addRouters[0]?.path as string } : nextData) } } else { if (whiteList.indexOf(to.path) !== -1) { diff --git a/src/plugins/echarts/index.ts b/src/plugins/echarts/index.ts new file mode 100644 index 0000000..54bc668 --- /dev/null +++ b/src/plugins/echarts/index.ts @@ -0,0 +1,33 @@ +import * as echarts from 'echarts/core' + +import { BarChart, LineChart, PieChart, MapChart, PictorialBarChart } from 'echarts/charts' + +import { + TitleComponent, + TooltipComponent, + GridComponent, + PolarComponent, + AriaComponent, + ParallelComponent, + LegendComponent +} from 'echarts/components' + +import { CanvasRenderer } from 'echarts/renderers' + +echarts.use([ + LegendComponent, + TitleComponent, + TooltipComponent, + GridComponent, + PolarComponent, + AriaComponent, + ParallelComponent, + BarChart, + LineChart, + PieChart, + MapChart, + CanvasRenderer, + PictorialBarChart +]) + +export default echarts diff --git a/src/router/index.ts b/src/router/index.ts index 2b6be16..4e371b2 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -37,6 +37,29 @@ export const constantRouterMap: AppRouteRecordRaw[] = [ ] export const asyncRouterMap: AppRouteRecordRaw[] = [ + { + path: '/dashboard', + component: Layout, + redirect: '/dashboard/analysis', + name: 'Dashboard', + meta: { + title: t('router.dashboard'), + icon: 'ant-design:dashboard-filled', + alwaysShow: true + }, + children: [ + { + path: 'analysis', + component: () => import('@/views/Dashboard/Analysis.vue'), + name: 'Analysis', + meta: { + title: t('router.analysis'), + noCache: true, + affix: true + } + } + ] + }, { path: '/level', component: Layout, diff --git a/src/views/Dashboard/Analysis.vue b/src/views/Dashboard/Analysis.vue new file mode 100644 index 0000000..4dde1e6 --- /dev/null +++ b/src/views/Dashboard/Analysis.vue @@ -0,0 +1,7 @@ + + + diff --git a/src/views/Dashboard/echarts-data.ts b/src/views/Dashboard/echarts-data.ts new file mode 100644 index 0000000..e69de29