From 892a8be7c1b102b40dfe1dac8221b5859048bd2f Mon Sep 17 00:00:00 2001 From: hanyuxia Date: Tue, 22 Mar 2022 09:39:52 +0800 Subject: [PATCH] =?UTF-8?q?CN-399=20Detection--=E6=9C=8D=E5=8A=A1=E8=B4=A8?= =?UTF-8?q?=E9=87=8F=E4=BA=8B=E4=BB=B6=20=E6=8C=87=E6=A0=87=E5=8F=98?= =?UTF-8?q?=E5=8C=96=E6=9B=B2=E7=BA=BF=E5=BC=80=E5=8F=91:metric=20?= =?UTF-8?q?=E6=9B=B2=E7=BA=BF=E5=9B=BE=E6=97=A0=E6=95=B0=E6=8D=AE=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E4=BD=BF=E7=94=A8'-'=E4=BB=A3=E6=9B=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../overview/DetectionPerformanceEventAppOverview.vue | 11 +++++++---- .../DetectionPerformanceEventDomainOverview.vue | 11 +++++++---- .../overview/DetectionPerformanceEventIpOverview.vue | 11 +++++++---- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/views/detections/overview/DetectionPerformanceEventAppOverview.vue b/src/views/detections/overview/DetectionPerformanceEventAppOverview.vue index d96596e1..260746e1 100644 --- a/src/views/detections/overview/DetectionPerformanceEventAppOverview.vue +++ b/src/views/detections/overview/DetectionPerformanceEventAppOverview.vue @@ -79,7 +79,7 @@ export default { return { eventSeverityColor, basicInfo: {}, - metricList:[[1435781430781, "1"], [1435781431781, "5"],[1435781432781, "5"], [1435781433781, "3"],[1435781434781, "4"], [1435781435781, "5"]], + metricList:[], } }, computed: { @@ -112,14 +112,18 @@ export default { }) this.queryMetric().then(responses => { responses && (this.metricList = responses.values) - this.initChart() + if(this.metricList.length>0){ + this.initChart() + }else { + let chartDom = document.getElementById('detectionMetricChartDomain') + chartDom.innerHTML = '-' + } }).catch(error => { console.log(error) }).finally(() => { setTimeout(() => { try { this.$nextTick(() => { - console.log(this.metricChart) this.metricChart && this.metricChart.resize() }) } catch (e) {} @@ -147,7 +151,6 @@ export default { } this.chartOptionMetric && this.metricChart.setOption(this.chartOptionMetric) - console.log(this.chartOptionMetric) }, queryMetric() { diff --git a/src/views/detections/overview/DetectionPerformanceEventDomainOverview.vue b/src/views/detections/overview/DetectionPerformanceEventDomainOverview.vue index 008f2b04..08c28c47 100644 --- a/src/views/detections/overview/DetectionPerformanceEventDomainOverview.vue +++ b/src/views/detections/overview/DetectionPerformanceEventDomainOverview.vue @@ -108,7 +108,7 @@ return { eventSeverityColor, basicInfo: {}, - metricList:[[1435781430781, "1"], [1435781431781, "5"],[1435781432781, "5"], [1435781433781, "3"],[1435781434781, "4"], [1435781435781, "5"]], + metricList:[], metricChart: null, searchStartTime:null, searchEndTime:null @@ -171,14 +171,18 @@ this.queryMetric().then(responses => { responses && (this.metricList = responses.values) - this.initChart() + if(this.metricList.length>0){ + this.initChart() + }else { + let chartDom = document.getElementById('detectionMetricChartDomain') + chartDom.innerHTML = '-' + } }).catch(error => { console.log(error) }).finally(() => { setTimeout(() => { try { this.$nextTick(() => { - console.log(this.metricChart) this.metricChart && this.metricChart.resize() }) } catch (e) {} @@ -206,7 +210,6 @@ } this.chartOptionMetric && this.metricChart.setOption(this.chartOptionMetric) - console.log(this.chartOptionMetric) }, queryMetric() { diff --git a/src/views/detections/overview/DetectionPerformanceEventIpOverview.vue b/src/views/detections/overview/DetectionPerformanceEventIpOverview.vue index c84e80f1..02ca3efa 100644 --- a/src/views/detections/overview/DetectionPerformanceEventIpOverview.vue +++ b/src/views/detections/overview/DetectionPerformanceEventIpOverview.vue @@ -98,7 +98,7 @@ export default { data () { return { basicInfo: {}, - metricList:[[1435781430781, "1"], [1435781431781, "5"],[1435781432781, "5"], [1435781433781, "3"],[1435781434781, "4"], [1435781435781, "5"]], + metricList:[], metricChart: null, searchStartTime:null, searchEndTime:null @@ -134,14 +134,18 @@ export default { }) this.queryMetric().then(responses => { responses && (this.metricList = responses.values) - this.initChart() + if(this.metricList.length>0){ + this.initChart() + }else { + let chartDom = document.getElementById('detectionMetricChartDomain') + chartDom.innerHTML = '-' + } }).catch(error => { console.log(error) }).finally(() => { setTimeout(() => { try { this.$nextTick(() => { - console.log(this.metricChart) this.metricChart && this.metricChart.resize() }) } catch (e) {} @@ -170,7 +174,6 @@ export default { } this.chartOptionMetric && this.metricChart.setOption(this.chartOptionMetric) - console.log(this.chartOptionMetric) }, queryMetric() {