From 3a4239d3516a56beda9196aee2df407e2797b99c Mon Sep 17 00:00:00 2001 From: zhangyu Date: Tue, 29 Mar 2022 17:23:14 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-1749=20fix=EF=BC=9Agroup=E6=8A=98=E5=8F=A0?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E5=AF=BC=E8=87=B4=E4=B8=8B=E9=9D=A2=E9=A1=B6?= =?UTF-8?q?=E4=B8=8A=E6=9D=A5=E7=9A=84=E6=B2=A1=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/chart/chart/chartGroup.vue | 7 +++---- nezha-fronted/src/components/chart/chartList.vue | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/nezha-fronted/src/components/chart/chart/chartGroup.vue b/nezha-fronted/src/components/chart/chart/chartGroup.vue index 7265d10a1..9aade87df 100644 --- a/nezha-fronted/src/components/chart/chart/chartGroup.vue +++ b/nezha-fronted/src/components/chart/chart/chartGroup.vue @@ -54,9 +54,8 @@ export default { setTimeout(() => { this.dataList = this.dataList.map(item => { return { - ...item, + ...item // hide: item.name.indexOf(this.filter.searchName) === -1, // 搜索条件 - loaded: false } }) }, 100) @@ -70,9 +69,9 @@ export default { const arr = JSON.parse(JSON.stringify(n)) this.dataList = arr.map(item => { return { - ...item, + ...item // hide: item.name.indexOf(this.filter.searchName) === -1, // 搜索条件 - loaded: false + // loaded: false } }) }) diff --git a/nezha-fronted/src/components/chart/chartList.vue b/nezha-fronted/src/components/chart/chartList.vue index 4be18f26b..4505c721e 100644 --- a/nezha-fronted/src/components/chart/chartList.vue +++ b/nezha-fronted/src/components/chart/chartList.vue @@ -47,6 +47,7 @@ :chart-info="item" :from="from" :time-range="timeRange" + @groupShow="groupShow" :chart-detail-info="chartDetailInfo" @refreshPanel="refreshPanel" @showFullscreen="showFullscreen" @@ -298,14 +299,21 @@ export default { this.scrollTopTimer = setTimeout(() => { this.copyDataList.forEach(item => { if (!this.$refs['grid-item' + item.id] || !this.$refs['grid-item' + item.id][0]) { - return; + return } const dom = this.$refs['grid-item' + item.id][0].$el if (dom) { let top = dom.style.top top = Number(top.substring(0, top.length - 2)) + groupTop + if (item.type === 'group' && !item.loaded) { + item.loaded = true + this.$refs['chart' + item.id][0].getChartData() + } if (item.type === 'group') { - this.$refs['chart' + item.id][0] && this.$refs['chart' + item.id][0].$refs.chart && this.$refs['chart' + item.id][0].$refs.chart.$refs['chart' + item.id] && this.$refs['chart' + item.id][0].$refs.chart.$refs['chart' + item.id].$refs.chartList.onScroll(scrollTop, top) + setTimeout(() => { + this.$refs['chart' + item.id][0] && this.$refs['chart' + item.id][0].$refs.chart && this.$refs['chart' + item.id][0].$refs.chart.$refs['chart' + item.id] && this.$refs['chart' + item.id][0].$refs.chart.$refs['chart' + item.id].$refs.chartList.onScroll(scrollTop, top) + },100) + return } if (item.loaded) { return @@ -397,7 +405,9 @@ export default { this.copyDataList = JSON.parse(JSON.stringify(tempList)) setTimeout(() => { this.gridLayoutShow = true - this.onScroll() + if (!this.isGroup) { + this.onScroll() + } }) setTimeout(() => { this.firstInit = false