From 6efe29c6f38bbae22d061a2cba9340a1d1f2dcaf Mon Sep 17 00:00:00 2001 From: caill <815519168@qq.com> Date: Thu, 31 Aug 2023 10:56:54 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E6=B5=81=E5=B7=A5=E8=89=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/shunhe/LogisticsProcess.vue | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/pages/shunhe/LogisticsProcess.vue b/src/pages/shunhe/LogisticsProcess.vue index 6c8d613..015ad35 100644 --- a/src/pages/shunhe/LogisticsProcess.vue +++ b/src/pages/shunhe/LogisticsProcess.vue @@ -267,6 +267,8 @@ export default { computed: { defaultOption1 () { return { + timer1: null, + timer2: null, step: 0.4, // 数值越大速度滚动越快 limitMoveNum: 9, // 开始无缝滚动的数据量 this.dataList.length hoverStop: true, // 是否开启鼠标悬停stop @@ -279,14 +281,14 @@ export default { } }, mounted () { + clearInterval(this.timer1) + clearInterval(this.timer2) this.refresh() }, beforeDestroy () { this.$once('hook:beforeDestroy', () => { clearInterval(this.timer1) clearInterval(this.timer2) - clearInterval(this.interTime) - clearInterval(this.timeOut1) }) }, methods: { @@ -635,11 +637,8 @@ export default { } var count = 0 - var timer = null - - var dataLength = option.series[1].data.length - timer && clearInterval(timer) - timer = setInterval(() => { + clearInterval(this.timer1) + this.timer1 = setInterval(() => { this.myCharts2.dispatchAction({ type: 'downplay', seriesIndex: 1 @@ -647,14 +646,20 @@ export default { this.myCharts2.dispatchAction({ type: 'highlight', seriesIndex: 1, - dataIndex: count % dataLength + dataIndex: count }) this.myCharts2.dispatchAction({ type: 'showTip', seriesIndex: 1, - dataIndex: count % dataLength + dataIndex: count }) count++ + if (count >= option.series[0].data.length) { + count = 0 + } + if (count >= option.series[1].data.length) { + count = 0 + } }, 3000) }, async _homepageData () {