From bda097fe8cbbd213f6253bf2fa015d4c8c9552d2 Mon Sep 17 00:00:00 2001 From: gtz217 <535262213@qq.com> Date: Fri, 26 Nov 2021 17:15:20 +0800 Subject: [PATCH] update --- package-lock.json | 22 ++ package.json | 1 + src/components/Charts/LineChart.vue | 32 +-- src/components/Charts/PieChart.vue | 13 +- src/components/Charts/RingChart.vue | 112 ++++++++ src/views/energy/electric.vue | 405 +++++++++++++++++++++++++++- 6 files changed, 535 insertions(+), 50 deletions(-) create mode 100644 src/components/Charts/RingChart.vue diff --git a/package-lock.json b/package-lock.json index 7202edb..212ea45 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3834,6 +3834,15 @@ "safer-buffer": "^2.1.0" } }, + "echarts": { + "version": "5.2.2", + "resolved": "https://registry.npmmirror.com/echarts/download/echarts-5.2.2.tgz", + "integrity": "sha1-7DyLKhUcu6cbo8LHz5svIEfOQ3A=", + "requires": { + "tslib": "2.3.0", + "zrender": "5.2.1" + } + }, "editorconfig": { "version": "0.15.3", "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-0.15.3.tgz", @@ -19252,6 +19261,11 @@ } } }, + "tslib": { + "version": "2.3.0", + "resolved": "https://registry.nlark.com/tslib/download/tslib-2.3.0.tgz", + "integrity": "sha1-gDuM2rPhK6WBpMpByIObuw2ssJ4=" + }, "tty-browserify": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", @@ -20978,6 +20992,14 @@ "version": "20.2.9", "resolved": "https://registry.nlark.com/yargs-parser/download/yargs-parser-20.2.9.tgz?cache=0&sync_timestamp=1624233514145&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fyargs-parser%2Fdownload%2Fyargs-parser-20.2.9.tgz", "integrity": "sha1-LrfcOwKJcY/ClfNidThFxBoMlO4=" + }, + "zrender": { + "version": "5.2.1", + "resolved": "https://registry.nlark.com/zrender/download/zrender-5.2.1.tgz", + "integrity": "sha1-X0u9qRW6bUErCxncJDG+qtBUF7s=", + "requires": { + "tslib": "2.3.0" + } } } } diff --git a/package.json b/package.json index a0915f8..f49e47e 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "axios": "0.17.1", "babel-plugin-component": "0.10.1", "babel-polyfill": "6.26.0", + "echarts": "^5.2.2", "element-ui": "2.8.2", "gulp": "3.9.1", "gulp-concat": "2.6.1", diff --git a/src/components/Charts/LineChart.vue b/src/components/Charts/LineChart.vue index 3a4e26b..ea9a990 100644 --- a/src/components/Charts/LineChart.vue +++ b/src/components/Charts/LineChart.vue @@ -6,21 +6,6 @@
- - -
-
-
- - -
-
-
- - -
-
-
@@ -30,32 +15,17 @@ export default { data () { return { - chartLine: null, - chartBar: null, - chartPie: null, - chartScatter: null + chartLine: null } }, mounted () { this.initChartLine() - this.initChartBar() - this.initChartPie() - this.initChartScatter() }, activated () { // 由于给echart添加了resize事件, 在组件激活时需要重新resize绘画一次, 否则出现空白bug if (this.chartLine) { this.chartLine.resize() } - if (this.chartBar) { - this.chartBar.resize() - } - if (this.chartPie) { - this.chartPie.resize() - } - if (this.chartScatter) { - this.chartScatter.resize() - } }, methods: { // 折线图 diff --git a/src/components/Charts/PieChart.vue b/src/components/Charts/PieChart.vue index cc359db..477c784 100644 --- a/src/components/Charts/PieChart.vue +++ b/src/components/Charts/PieChart.vue @@ -1,12 +1,7 @@ + + diff --git a/src/views/energy/electric.vue b/src/views/energy/electric.vue index abc1a40..3ac199d 100644 --- a/src/views/energy/electric.vue +++ b/src/views/energy/electric.vue @@ -2,7 +2,7 @@ * @Author: zwq * @Date: 2021-11-19 10:55:33 * @LastEditors: gtz - * @LastEditTime: 2021-11-25 19:30:06 + * @LastEditTime: 2021-11-26 16:53:20 * @Description: -->