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