diff --git a/src/utils/constants.js b/src/utils/constants.js index 241fdb86..e6e448d5 100644 --- a/src/utils/constants.js +++ b/src/utils/constants.js @@ -6,7 +6,6 @@ export const storageKey = { i18n: 'cn-i18n', languages: 'cn-languages', language: 'cn-language', - timezone: 'cn-timezone', theme: 'cn-theme', dateFormat: 'cn-date-format', timezoneOffset: 'cn-timezone-offset', 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 @@