From dae3882b501370115d688420ba0ab22d613d3d5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E7=8F=AE=E5=AE=87?= Date: Fri, 3 Nov 2023 14:42:24 +0800 Subject: [PATCH] =?UTF-8?q?Data=20Recevice=20status=20Monitoring=20?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E5=9B=BE=E8=A1=A8=E7=82=B9=E5=87=BBlegned?= =?UTF-8?q?=EF=BC=8C=E6=B8=B2=E6=9F=93=E5=9B=BE=E8=A1=A8=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=EF=BC=8C=E4=BC=9A=E5=9B=9E=E5=88=B0=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=AE=9A=E4=BD=8D=E7=9A=84=E5=9C=B0=E6=96=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CustomChart/index.vue | 26 +-- .../components/RealTimeDataChart.vue | 154 +++++++++++------- 2 files changed, 104 insertions(+), 76 deletions(-) diff --git a/src/components/CustomChart/index.vue b/src/components/CustomChart/index.vue index 8dac754..44a3a22 100644 --- a/src/components/CustomChart/index.vue +++ b/src/components/CustomChart/index.vue @@ -5,22 +5,22 @@ import * as echarts from 'echarts' import 'echarts-gl' -const events = ['click', 'brushEnd'] +const events = ['click', 'brushEnd', 'dataZoom'] const zrEvents = ['mousemove', 'mousedown', 'mouseup', 'click', 'dblclick', 'contextmenu'] export default { props: { option: { type: Object, - default: () => ({}) + default: () => ({}), }, opts: { type: Object, - default: () => {} + default: () => {}, }, height: { type: Number, - default: null - } + default: null, + }, }, data() { return {} @@ -31,21 +31,21 @@ export default { this.initEventListener() }, destroyed() { - if(this._chart) { + if (this._chart) { this._chart.dispose() } }, methods: { initEventListener() { - events.forEach(eventName => { + events.forEach((eventName) => { this._chart.on(eventName, (params) => { this.$emit(eventName, params) }) }) const zr = this.getZRender() - zrEvents.forEach(eventName => { - zr.on(eventName, params => { + zrEvents.forEach((eventName) => { + zr.on(eventName, (params) => { this.$emit(`zr:${eventName}`, params) }) }) @@ -62,7 +62,7 @@ export default { getZRender() { return this._chart.getZr() - } + }, }, watch: { option: { @@ -71,14 +71,14 @@ export default { this._chart.setOption(this.option, this.opts) } }, - deep: true + deep: true, }, height() { this.$nextTick(() => { this._chart && this._chart.resize() }) - } - } + }, + }, }