From 8069461c71f90fb29e7321c39ce71b164758909e Mon Sep 17 00:00:00 2001 From: zhangyu Date: Fri, 8 Mar 2024 16:01:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20(NEZ-3420)=20chart=20legend=20=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E4=B9=8B=E5=90=8E=E5=86=8D=E5=8F=96=E6=B6=88=20?= =?UTF-8?q?=E4=B8=8D=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/chart/chart/legend.vue | 2 +- .../src/components/chart/chart/uplot/chartTimeSeries.vue | 4 ---- .../src/components/page/dashboard/explore/exploreItem.vue | 1 + 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/nezha-fronted/src/components/chart/chart/legend.vue b/nezha-fronted/src/components/chart/chart/legend.vue index 35957f32c..fcbaba4ae 100644 --- a/nezha-fronted/src/components/chart/chart/legend.vue +++ b/nezha-fronted/src/components/chart/chart/legend.vue @@ -174,7 +174,7 @@ export default { }) this.isGrey = this.isGrey.map(() => false) } else { - echarts.setSeries(index + 1, { show: true, focus: false }) + echarts.setSeries(index + 1, { show: this.isGrey[index], focus: false }) this.$set(this.isGrey, index, !this.isGrey[index]) } this.$emit('legendChange', this.isGrey) diff --git a/nezha-fronted/src/components/chart/chart/uplot/chartTimeSeries.vue b/nezha-fronted/src/components/chart/chart/uplot/chartTimeSeries.vue index 30cdb51be..5ddaee577 100644 --- a/nezha-fronted/src/components/chart/chart/uplot/chartTimeSeries.vue +++ b/nezha-fronted/src/components/chart/chart/uplot/chartTimeSeries.vue @@ -181,7 +181,6 @@ export default { }, methods: { initChart (chartOptions = this.chartOption) { - console.log(123123) this.setDataLink() try { this.isStack = !!this.chartInfo.param.stack @@ -197,7 +196,6 @@ export default { const cursLeft = -10 const cursTop = -10 const { seriesData, seriesAll } = this.initSeriesData(this.chartData) - console.log(seriesData) this.isNoData = false if (!seriesData.length || seriesData.length == 1) { this.isNoData = true @@ -420,7 +418,6 @@ export default { if (!dom) { return } - console.log(dom.offsetWidth, dom.offsetHeight) const width = dom.offsetWidth const height = dom.offsetHeight opts.width = width @@ -594,7 +591,6 @@ export default { this.renderYaxis() }, resize () { - console.log(123132123, 'resize') setTimeout(() => { const dom = document.getElementById(`chart-canvas-${this.chartId}`) const width = dom.offsetWidth diff --git a/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue b/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue index 544c6c647..6a7baac08 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue @@ -4088,6 +4088,7 @@ export default { } promqlInputIndexs.push(index) queryExpression.push(item) + this.promqlKeys[index].expression = item if (this.promqlKeys[index].queryType === 2) { requestArr.push(this.$get('/prom/api/v1/query_instant?query=' + encodeURIComponent(item) + '&time=' + this.$stringTimeParseToUnix(bus.formateTimeToTime(this.filterTime[1])))) } else {