From 650d0688f3318a3b43991eb80239ac3ba6725d5a Mon Sep 17 00:00:00 2001 From: zyh Date: Fri, 26 Apr 2024 14:45:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dexplore=20metric?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=BC=82=E5=B8=B8=20=E5=87=BA=E7=8E=B0no=20d?= =?UTF-8?q?ata?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/page/dashboard/explore/exploreItem.vue | 5 ++++- .../components/page/dashboard/explore/exploreItemHtml.vue | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue b/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue index d0dabca20..12b5a2b7e 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/exploreItem.vue @@ -4212,6 +4212,7 @@ export default { const tData = [] let tLabels = [] if (res.length > 0) { + this.pageObj.pageNo = 1 this.storedTableData = [] this.rowData = [] this.tableData = [] @@ -4228,6 +4229,9 @@ export default { if (data) { data.forEach((result, i) => { const metrics = Object.assign({}, result.metric) + if (!Array.isArray(result.values) && Array.isArray(result.value)) { + result.values = [result.value] + } this.$set(metrics, 'value#' + index, chartDataFormat.getUnit(this.chartUnit || 2).compute(result.values[0][1], null, 2)) this.$set(metrics, 'time', bus.timeFormate(bus.computeTimezone(result.values[0][0] * 1000))) for (const key in metrics) { @@ -4296,7 +4300,6 @@ export default { } else { // this.defaultTableVisible = false; this.pageObj.total = 0 - this.pageObj.pageNo = 1 } } this.tools.loading = false diff --git a/nezha-fronted/src/components/page/dashboard/explore/exploreItemHtml.vue b/nezha-fronted/src/components/page/dashboard/explore/exploreItemHtml.vue index eb2a0b812..afaadbab8 100644 --- a/nezha-fronted/src/components/page/dashboard/explore/exploreItemHtml.vue +++ b/nezha-fronted/src/components/page/dashboard/explore/exploreItemHtml.vue @@ -325,6 +325,7 @@ export default { const tData = [] let tLabels = [] if (res.length > 0) { + this.pageObj.pageNo = 1 this.storedTableData = [] this.rowData = [] this.tableData = [] @@ -424,7 +425,6 @@ export default { } else { // this.defaultTableVisible = false; this.pageObj.total = 0 - this.pageObj.pageNo = 1 } } this.tools.loading = false