From 5ee09bf9db54d6e3d919071bd9a32dbec7799e95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B4=AA=E6=B4=AA?= <2498601771@qq.com> Date: Thu, 22 Sep 2022 15:18:00 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BA=8B=E4=BB=B6=E5=88=86?= =?UTF-8?q?=E5=B8=83=E5=9B=BE=E6=A8=A1=E5=9D=97=E6=B7=BB=E5=8A=A0no=20data?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../charts/dnsInsight/DnsEventChart.vue | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/views/charts2/charts/dnsInsight/DnsEventChart.vue b/src/views/charts2/charts/dnsInsight/DnsEventChart.vue index 087be5d5..def741ce 100644 --- a/src/views/charts2/charts/dnsInsight/DnsEventChart.vue +++ b/src/views/charts2/charts/dnsInsight/DnsEventChart.vue @@ -1,11 +1,14 @@ @@ -17,6 +20,7 @@ import chartMixin from '@/views/charts2/chart-mixin' import dnsEventChartByPie from './DnsEventChartByPie' import dnsEventChartByBar from './DnsEventChartByBar' import { getSecond } from '@/utils/date-util' +import ChartNoData from '@/views/charts/charts/ChartNoData' export default { name: 'DnsEventChart', @@ -24,6 +28,7 @@ export default { type: String }, components: { + ChartNoData, dnsEventChartByPie, dnsEventChartByBar }, @@ -62,6 +67,7 @@ export default { this.pieData = [] if (data !== undefined && data.length > 0) { + this.isNoData = false const series = [] data.forEach((item, index) => { this.pieData.push({ @@ -83,7 +89,12 @@ export default { }) }) this.series = series + } else { + this.isNoData = true } + }).catch(e => { + console.error(e) + this.isNoData = true }).finally(() => { this.toggleLoading(false) })