From 5aa046dc6aed1ddea88b7b6dae02b11f19c1fae8 Mon Sep 17 00:00:00 2001 From: hyx Date: Fri, 22 Apr 2022 17:40:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?CN-497=20DNS=20Dashboard=E6=95=B4=E5=B1=8F?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E6=9B=B4=E6=8D=A2=E6=96=B9=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/charts/Chart.vue | 4 + src/views/charts/Panel.vue | 305 +++++++++++++++++- src/views/charts/PanelChart.vue | 25 +- src/views/charts/PanelChartList.vue | 113 ++++--- src/views/charts/charts/ChartMap.vue | 114 +++---- .../charts/charts/ChartTablePagination.vue | 5 +- .../charts/wholeScreenScroll/DnsScreen.vue | 12 +- 7 files changed, 453 insertions(+), 125 deletions(-) diff --git a/src/views/charts/Chart.vue b/src/views/charts/Chart.vue index 9e85538e..62cd54ef 100644 --- a/src/views/charts/Chart.vue +++ b/src/views/charts/Chart.vue @@ -21,6 +21,7 @@ :entity="entity" @getChartData="getChartData" @showLoading="showLoading" + @finishOneMap="finishOneMap" > -
+
+ +
@@ -20,11 +48,11 @@
@@ -35,7 +63,7 @@ + + diff --git a/src/views/charts/PanelChart.vue b/src/views/charts/PanelChart.vue index bdec56cd..028a2852 100644 --- a/src/views/charts/PanelChart.vue +++ b/src/views/charts/PanelChart.vue @@ -41,6 +41,7 @@ :time-filter="timeFilter" @getChartData="getChartData" @showLoading="showLoading" + @handleSpecialChartFinishState="handleSpecialChartFinishState" :tabHandleClickType="tabHandleClickType" >
@@ -150,7 +151,8 @@ export default { } ] // table的所有数据 }, - tabHandleClickType: '' + tabHandleClickType: '', + isFinish: false } }, computed: { @@ -264,21 +266,38 @@ export default { } }).finally(() => { this.loading = false + this.handleFinishState() }) } else if (this.isGroup || this.isTabs) { this.$refs.chart.$refs.chart.reload() + this.handleFinishState() } else if (this.isBlock) { if (!this.chartInfo.firstShow) { this.chartInfo.firstShow = true } else { this.$refs.chart.$refs.chart.reload() } + this.handleFinishState() } } catch (e) { console.error(e) setTimeout(() => { this.loading = false + this.handleFinishState() }, 200) + } finally { + this.handleFinishState() + } + }, + handleSpecialChartFinishState () { + this.$emit('finishOne') + }, + handleFinishState () { + if (!this.isMap) { + if (!this.isFinish) { + this.isFinish = true + this.$emit('finishOne') + } } }, handleQueryParams () { @@ -400,9 +419,9 @@ export default { const dateRangeValue = 60 const { startTime, endTime } = getNowTime(dateRangeValue) const chartTimeFilter = ref({ startTime, endTime, dateRangeValue }) - const table = ref({}) + let table = {} if (isBasicTable(props.chartInfo.type)) { - table.value = { + table = { pageSize: chartTableDefaultPageSize, limit: chartTableTopOptions[0], // top-n orderBy: props.chartInfo.params.columns.order[0], diff --git a/src/views/charts/PanelChartList.vue b/src/views/charts/PanelChartList.vue index d3c226b3..5d110976 100644 --- a/src/views/charts/PanelChartList.vue +++ b/src/views/charts/PanelChartList.vue @@ -1,14 +1,16 @@