From 05c837be66be8675464826d04da3c8432fa7f01c Mon Sep 17 00:00:00 2001 From: "@changcode" Date: Mon, 25 Oct 2021 14:38:43 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-1077=20fix:=20panel=20=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=9D=A1=E4=BB=B6=20=EF=BC=8C=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E7=AC=A6=E5=90=88=E6=9D=A1=E4=BB=B6chart=20nodata?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/charts/chart-list.vue | 19 +++++++++++------ .../common/bottomBox/tabs/logBottomTab.vue | 4 ++-- .../components/page/alert/alertMessage.vue | 1 + .../src/components/page/alert/alertRule.vue | 1 + .../components/page/alert/alertSilence.vue | 1 + .../src/components/page/asset/asset.vue | 1 + .../page/config/system/apiKeyTable.vue | 5 +++-- .../page/config/system/linkTable.vue | 5 +++-- .../page/config/system/notifyMethodTable.vue | 5 +++-- .../page/config/template/chartTemp.vue | 1 + .../page/config/template/exprTemp.vue | 1 + .../page/dashboard/explore/exploreItem.vue | 9 ++++++++ .../page/dashboard/explore/logTab.vue | 21 +++++++++++++++++-- 13 files changed, 58 insertions(+), 16 deletions(-) diff --git a/nezha-fronted/src/components/charts/chart-list.vue b/nezha-fronted/src/components/charts/chart-list.vue index 521d0edb0..c2775694a 100644 --- a/nezha-fronted/src/components/charts/chart-list.vue +++ b/nezha-fronted/src/components/charts/chart-list.vue @@ -263,7 +263,7 @@ -
+
@@ -304,7 +304,7 @@ export default { obj: Object, panelLock: { type: Boolean, default: false }, hasGroup: { type: Boolean, default: true }, - panelDataList: Array, + panelDataList: Array }, components: { @@ -333,7 +333,7 @@ export default { start: '', end: '' }, - panelLoading: false, + chartListNoData: false, extraMarginBottom: 0, // dom额外的margin panelId: '', timer: null, @@ -548,13 +548,20 @@ export default { this.dataTotalListBak.forEach((item) => { item.isLoaded = false item.isHide = false + this.chartListNoData = false chartListTmp.push(item) }) } this.dataTotalList = [...chartListTmp] this.dataList = [...this.dataTotalList] - + let isAllHide = true + this.dataList.map(item => { + if (!item.isHide) { + isAllHide = false + } + }) + this.chartListNoData = isAllHide this.$nextTick(() => { if (this.dataList.length > 0) { this.dataList.forEach((item, index) => { @@ -719,10 +726,10 @@ export default { // chart数据存在dataTotalListBak中 if (response.data.list.length > 0) { this.dataTotalListBak = response.data.list - this.panelLoading = false + this.chartListNoData = false } else { this.dataTotalListBak = response.data - this.panelLoading = true + this.chartListNoData = true } let chartListTmp = [] // 查询条件带name diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/logBottomTab.vue b/nezha-fronted/src/components/common/bottomBox/tabs/logBottomTab.vue index abfe66f8e..cff18d55c 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/logBottomTab.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/logBottomTab.vue @@ -23,8 +23,8 @@ diff --git a/nezha-fronted/src/components/page/alert/alertMessage.vue b/nezha-fronted/src/components/page/alert/alertMessage.vue index 93655a5c9..8c8374cba 100644 --- a/nezha-fronted/src/components/page/alert/alertMessage.vue +++ b/nezha-fronted/src/components/page/alert/alertMessage.vue @@ -32,6 +32,7 @@ :height="mainTableHeight" :now-time="nowTime" :table-data="tableData" + :loading="tools.loading" @del="del" @edit="edit" @showText="showText" diff --git a/nezha-fronted/src/components/page/alert/alertRule.vue b/nezha-fronted/src/components/page/alert/alertRule.vue index 1afafe1dc..d0fcb7e03 100644 --- a/nezha-fronted/src/components/page/alert/alertRule.vue +++ b/nezha-fronted/src/components/page/alert/alertRule.vue @@ -111,6 +111,7 @@
- diff --git a/nezha-fronted/src/components/page/config/system/linkTable.vue b/nezha-fronted/src/components/page/config/system/linkTable.vue index abc351417..c959e9f4c 100644 --- a/nezha-fronted/src/components/page/config/system/linkTable.vue +++ b/nezha-fronted/src/components/page/config/system/linkTable.vue @@ -77,13 +77,14 @@
- diff --git a/nezha-fronted/src/components/page/config/system/notifyMethodTable.vue b/nezha-fronted/src/components/page/config/system/notifyMethodTable.vue index 4a7441d7a..20f128d05 100644 --- a/nezha-fronted/src/components/page/config/system/notifyMethodTable.vue +++ b/nezha-fronted/src/components/page/config/system/notifyMethodTable.vue @@ -87,13 +87,14 @@ - diff --git a/nezha-fronted/src/components/page/config/template/chartTemp.vue b/nezha-fronted/src/components/page/config/template/chartTemp.vue index 181ddef93..67705c48b 100644 --- a/nezha-fronted/src/components/page/config/template/chartTemp.vue +++ b/nezha-fronted/src/components/page/config/template/chartTemp.vue @@ -68,6 +68,7 @@ + -
No Data
+ @@ -98,7 +106,8 @@ export default { showSwitch: { type: Boolean, default: true - } + }, + loading: Boolean }, computed: { tableTimeFormat () { @@ -559,6 +568,14 @@ export default { .log-table{ position: relative; min-height: 200px; + .right-no-data { + position: absolute; + top: 50%; + left: 50%; + margin-top: -35px; + margin-left: -50px; + text-align: center; + } } .log-table .nz-table2 { padding: 10px 0 0 0;