From 34eec55d4b864bbf793dd910ac2d62a2c8d471bb Mon Sep 17 00:00:00 2001 From: zyh Date: Mon, 18 Jul 2022 16:25:02 +0800 Subject: [PATCH] =?UTF-8?q?perf=EF=BC=9Achart=E6=98=BE=E7=A4=BA=E9=9A=90?= =?UTF-8?q?=E8=97=8F=E4=B8=8B=E6=8B=89=E9=80=89=E6=8B=A9=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/chart/chartList.vue | 10 +++++----- .../common/rightBox/chart/chartConfig.vue | 20 +++++++++---------- .../common/rightBox/chart/chartRightBox.vue | 16 +++++++-------- .../rightBox/chart/otherChartConfig.vue | 20 +++++++++---------- .../rightBox/chart/systemChartConfig.vue | 12 +++++------ .../src/components/page/dashboard/panel.vue | 4 ++-- 6 files changed, 41 insertions(+), 41 deletions(-) diff --git a/nezha-fronted/src/components/chart/chartList.vue b/nezha-fronted/src/components/chart/chartList.vue index 7cf54b364..9ea56f579 100644 --- a/nezha-fronted/src/components/chart/chartList.vue +++ b/nezha-fronted/src/components/chart/chartList.vue @@ -330,12 +330,12 @@ export default { let top = dom.style.top top = Number(top.substring(0, top.length - 2)) + groupTop if (item.type === 'group' && item.loaded) { - 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) + this.$refs['chart' + item.id] && 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) return } if (item.type === 'group' && !item.loaded) { item.loaded = true - this.$refs['chart' + item.id][0].getChartData() + this.$refs['chart' + item.id] && this.$refs['chart' + item.id][0].getChartData() } if (item.loaded) { return @@ -367,11 +367,11 @@ export default { this.init() this.copyDataList.forEach(item => { if (item.type === 'group') { - this.$refs['chart' + item.id][0] && this.$refs['chart' + item.id][0].groupShow(item.param.collapse) - 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.resize() + this.$refs['chart' + item.id] && this.$refs['chart' + item.id][0].groupShow(item.param.collapse) + this.$refs['chart' + item.id] && 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.resize() } try { - this.$refs['chart' + item.id][0] && this.$refs['chart' + item.id][0].resize() + this.$refs['chart' + item.id] && this.$refs['chart' + item.id][0].resize() } catch (error) { } }) diff --git a/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue b/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue index ce21262f9..ca66684f1 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/chartConfig.vue @@ -968,9 +968,9 @@ export default { showHeader: this.chartConfig.param.showHeader, visibility: { varName: '', - operator: '', + operator: 'equal', varValue: '', - result: '' + result: 'show' } } this.$nextTick(() => { @@ -1000,9 +1000,9 @@ export default { showHeader: this.chartConfig.param.showHeader, visibility: { varName: '', - operator: '', + operator: 'equal', varValue: '', - result: '' + result: 'show' } } break @@ -1030,9 +1030,9 @@ export default { showHeader: this.chartConfig.param.showHeader, visibility: { varName: '', - operator: '', + operator: 'equal', varValue: '', - result: '' + result: 'show' } } break @@ -1057,9 +1057,9 @@ export default { showHeader: this.chartConfig.param.showHeader, visibility: { varName: '', - operator: '', + operator: 'equal', varValue: '', - result: '' + result: 'show' } } break @@ -1079,9 +1079,9 @@ export default { showHeader: this.chartConfig.param.showHeader, visibility: { varName: '', - operator: '', + operator: 'equal', varValue: '', - result: '' + result: 'show' } } break diff --git a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue index f14c1c199..be7953f70 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/chartRightBox.vue @@ -383,9 +383,9 @@ export default { showHeader: this.editChart.param.showHeader, visibility: { varName: '', - operator: '', + operator: 'equal', varValue: '', - result: '' + result: 'show' } } } @@ -409,9 +409,9 @@ export default { showHeader: this.editChart.param.showHeader, visibility: { varName: '', - operator: '', + operator: 'equal', varValue: '', - result: '' + result: 'show' } } } @@ -452,9 +452,9 @@ export default { showHeader: this.editChart.param.showHeader, visibility: { varName: '', - operator: '', + operator: 'equal', varValue: '', - result: '' + result: 'show' } } } @@ -477,9 +477,9 @@ export default { showHeader: this.editChart.param.showHeader, visibility: { varName: '', - operator: '', + operator: 'equal', varValue: '', - result: '' + result: 'show' } } } diff --git a/nezha-fronted/src/components/common/rightBox/chart/otherChartConfig.vue b/nezha-fronted/src/components/common/rightBox/chart/otherChartConfig.vue index 5e7f34c45..a16287e83 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/otherChartConfig.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/otherChartConfig.vue @@ -324,9 +324,9 @@ export default { showHeader: this.chartConfig.param.showHeader, visibility: { varName: '', - operator: '', + operator: 'equal', varValue: '', - result: '' + result: 'show' } } break @@ -340,9 +340,9 @@ export default { showHeader: this.chartConfig.param.showHeader, visibility: { varName: '', - operator: '', + operator: 'equal', varValue: '', - result: '' + result: 'show' } } break @@ -356,9 +356,9 @@ export default { showHeader: this.chartConfig.param.showHeader, visibility: { varName: '', - operator: '', + operator: 'equal', varValue: '', - result: '' + result: 'show' } } break @@ -372,9 +372,9 @@ export default { showHeader: this.chartConfig.param.showHeader, visibility: { varName: '', - operator: '', + operator: 'equal', varValue: '', - result: '' + result: 'show' } } break @@ -388,9 +388,9 @@ export default { showHeader: this.chartConfig.param.showHeader, visibility: { varName: '', - operator: '', + operator: 'equal', varValue: '', - result: '' + result: 'show' } } break diff --git a/nezha-fronted/src/components/common/rightBox/chart/systemChartConfig.vue b/nezha-fronted/src/components/common/rightBox/chart/systemChartConfig.vue index b003ed624..76f88a86e 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/systemChartConfig.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/systemChartConfig.vue @@ -920,9 +920,9 @@ export default { showHeader: this.chartConfig.param.showHeader, visibility: { varName: '', - operator: '', + operator: 'equal', varValue: '', - result: '' + result: 'show' } } break @@ -951,9 +951,9 @@ export default { showHeader: this.chartConfig.param.showHeader, visibility: { varName: '', - operator: '', + operator: 'equal', varValue: '', - result: '' + result: 'show' } } break @@ -978,9 +978,9 @@ export default { showHeader: this.chartConfig.param.showHeader, visibility: { varName: '', - operator: '', + operator: 'equal', varValue: '', - result: '' + result: 'show' } } break diff --git a/nezha-fronted/src/components/page/dashboard/panel.vue b/nezha-fronted/src/components/page/dashboard/panel.vue index c23afca46..4e1879896 100644 --- a/nezha-fronted/src/components/page/dashboard/panel.vue +++ b/nezha-fronted/src/components/page/dashboard/panel.vue @@ -235,9 +235,9 @@ export default { showHeader: 1, visibility: { varName: '', - operator: '', + operator: 'equal', varValue: '', - result: '' + result: 'show' } }, elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1 }],