From 7f1b75d182b70f92c1521637e7d472c78164d4e5 Mon Sep 17 00:00:00 2001 From: zyh Date: Mon, 23 Oct 2023 15:16:07 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-3201=20fix=EF=BC=9AShare=20tooltip=20?= =?UTF-8?q?=E5=8F=B3=E4=BE=A7=20chart=20tooltip=20=E9=81=AE=E6=8C=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/chart/chart/chartTimeSeries.vue | 6 ++++-- nezha-fronted/src/components/chart/chartMixin.js | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/nezha-fronted/src/components/chart/chart/chartTimeSeries.vue b/nezha-fronted/src/components/chart/chart/chartTimeSeries.vue index 4846c97d9..8cb4fcade 100644 --- a/nezha-fronted/src/components/chart/chart/chartTimeSeries.vue +++ b/nezha-fronted/src/components/chart/chart/chartTimeSeries.vue @@ -134,6 +134,9 @@ export default { // 监听当前鼠标所在的图表id变化 '$store.state.panel.currentMousemove': { handler (n) { + if (this.isConnect !== 'crosshair') { + return + } // 判断是否是当前鼠标所在的图表 if (n === this.chartId) { let option = {} @@ -250,9 +253,8 @@ export default { // timeSeries类型图表设置group 用于多表联动 if (this.isInit && !this.isFullscreen) { myChart.group = 'timeSeriesGroup' - if (this.isConnect === 'crosshair') { + if (this.isConnect !== 'none') { myChart.getZr().on('mousemove', params => { - // crosshair 模式才会执行 if (this.$store.state.panel.currentMousemove !== this.chartId) { this.$store.commit('setCurrentMousemove', this.chartId) } diff --git a/nezha-fronted/src/components/chart/chartMixin.js b/nezha-fronted/src/components/chart/chartMixin.js index 7386b6a5a..0d61c24d7 100644 --- a/nezha-fronted/src/components/chart/chartMixin.js +++ b/nezha-fronted/src/components/chart/chartMixin.js @@ -337,6 +337,9 @@ export default { } }, tooltipPosition (point, params, dom, rect, size) { + if (this.isConnect === 'tooltip' && this.$store.state.panel.currentMousemove != this.chartId) { + return + } dom.style.transform = 'translateZ(999999)' const windowWidth = window.innerWidth// 窗口宽度 const windowHeight = window.innerHeight// 窗口高度