diff --git a/package.json b/package.json index b0f4b16..4f5ba06 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "@iconify/iconify": "^2.2.0", "@vueuse/core": "^8.1.1", "axios": "^0.25.0", + "echarts": "5.3.1", "element-plus": "^2.1.4", "less": "^4.1.2", "lodash": "^4.17.21", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cef9eeb..b111105 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,6 +21,7 @@ specifiers: cross-env: ^7.0.3 cz-conventional-changelog: ^3.3.0 dotenv: ^14.3.2 + echarts: 5.3.1 element-plus: ^2.1.4 eslint: ^8.7.0 eslint-config-prettier: ^8.3.0 @@ -57,6 +58,7 @@ dependencies: '@iconify/iconify': 2.2.0 '@vueuse/core': 8.2.0_vue@3.2.31 axios: 0.25.0 + echarts: 5.3.1 element-plus: 2.1.6_1a412d14def5ff5ca1122000e4bee666 less: 4.1.2 lodash: 4.17.21 @@ -1790,6 +1792,13 @@ packages: engines: {node: '>=12'} dev: true + /echarts/5.3.1: + resolution: {integrity: sha512-nWdlbgX3OVY0hpqncSvp0gDt1FRSKWn7lsWEH+PHmfCuvE0QmSw17pczQvm8AvawnLEkmf1Cts7YwQJZNC0AEQ==} + dependencies: + tslib: 2.3.0 + zrender: 5.3.1 + dev: false + /electron-to-chromium/1.4.96: resolution: {integrity: sha512-DPNjvNGPabv6FcyjzLAN4C0psN/GgD9rSGvMTuv81SeXG/EX3mCz0wiw9N1tUEnfQXYCJi3H8M0oFPRziZh7rw==} dev: true @@ -4169,6 +4178,10 @@ packages: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} dev: true + /tslib/2.3.0: + resolution: {integrity: sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==} + dev: false + /tslib/2.3.1: resolution: {integrity: sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==} dev: false @@ -4600,3 +4613,9 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} dev: true + + /zrender/5.3.1: + resolution: {integrity: sha512-7olqIjy0gWfznKr6vgfnGBk7y4UtdMvdwFmK92vVQsQeDPyzkHW1OlrLEKg6GHz1W5ePf0FeN1q2vkl/HFqhXw==} + dependencies: + tslib: 2.3.0 + dev: false diff --git a/src/components/Echarts/index.ts b/src/components/Echarts/index.ts new file mode 100644 index 0000000..0822970 --- /dev/null +++ b/src/components/Echarts/index.ts @@ -0,0 +1,10 @@ +/* + * @Version: 1.0 + * @Autor: YDKD + * @Date: 2022-04-06 11:13:32 + * @LastEditors: YDKD + * @LastEditTime: 2022-04-06 11:13:32 + */ +import Echart from './src/Echarts.vue' + +export { Echart } diff --git a/src/components/Echarts/src/Echarts.vue b/src/components/Echarts/src/Echarts.vue new file mode 100644 index 0000000..a5d4ab4 --- /dev/null +++ b/src/components/Echarts/src/Echarts.vue @@ -0,0 +1,138 @@ + + + + + + diff --git a/src/components/Menu/src/components/useRenderMenuTitle.tsx b/src/components/Menu/src/components/useRenderMenuTitle.tsx index c80298e..e07d74a 100644 --- a/src/components/Menu/src/components/useRenderMenuTitle.tsx +++ b/src/components/Menu/src/components/useRenderMenuTitle.tsx @@ -12,7 +12,7 @@ export const useRenderMenuTitle = () => { const renderMenuTitle = (meta?: RouteMeta) => { let icon const type = meta?.icon?.split('-')[0] == 'fa' ? 'iconify' : 'iconfont' - if (type == 'iconify' ) { + if (type == 'iconify') { icon = meta?.icon?.split('-')[1] } else { icon = meta?.icon diff --git a/src/hooks/web/useDesign.ts b/src/hooks/web/useDesign.ts index d4a8a4b..1086677 100644 --- a/src/hooks/web/useDesign.ts +++ b/src/hooks/web/useDesign.ts @@ -3,7 +3,7 @@ * @Autor: YDKD * @Date: 2022-03-23 16:46:13 * @LastEditors: YDKD - * @LastEditTime: 2022-03-23 17:02:13 + * @LastEditTime: 2022-04-07 15:43:59 */ import variables from '@/styles/variables.module.less' @@ -22,6 +22,6 @@ export const useDesign = (type: Type = 'prefix', componentScope?: string) => { if (type == 'prefix') { return getPrefixCls(componentScope!) } else { - return lessVariables + return variables } } diff --git a/src/plugins/echarts/index.ts b/src/plugins/echarts/index.ts new file mode 100644 index 0000000..1049a5d --- /dev/null +++ b/src/plugins/echarts/index.ts @@ -0,0 +1,31 @@ +import * as echarts from 'echarts/core' + +import { PieChart } from 'echarts/charts' + +import { + TitleComponent, + TooltipComponent, + GridComponent, + PolarComponent, + AriaComponent, + ParallelComponent, + LegendComponent, + ToolboxComponent +} from 'echarts/components' + +import { CanvasRenderer } from 'echarts/renderers' + +echarts.use([ + LegendComponent, + TitleComponent, + TooltipComponent, + GridComponent, + PolarComponent, + AriaComponent, + ParallelComponent, + PieChart, + CanvasRenderer, + ToolboxComponent +]) + +export default echarts diff --git a/src/views/analysis/index.vue b/src/views/analysis/index.vue index e6837f0..e894778 100644 --- a/src/views/analysis/index.vue +++ b/src/views/analysis/index.vue @@ -3,7 +3,7 @@ * @Autor: YDKD * @Date: 2022-03-24 15:42:06 * @LastEditors: YDKD - * @LastEditTime: 2022-03-24 15:49:29 + * @LastEditTime: 2022-04-06 10:53:25 -->