From 17851f57540f078396a6d248aef90a17bde9495d Mon Sep 17 00:00:00 2001 From: hyx Date: Mon, 21 Mar 2022 11:01:55 +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?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DetectionPerformanceEventAppOverview.vue | 82 ++++++++++++++++++- ...etectionPerformanceEventDomainOverview.vue | 8 +- .../DetectionPerformanceEventIpOverview.vue | 9 +- 3 files changed, 88 insertions(+), 11 deletions(-) diff --git a/src/views/detections/overview/DetectionPerformanceEventAppOverview.vue b/src/views/detections/overview/DetectionPerformanceEventAppOverview.vue index 808b9686..2d481770 100644 --- a/src/views/detections/overview/DetectionPerformanceEventAppOverview.vue +++ b/src/views/detections/overview/DetectionPerformanceEventAppOverview.vue @@ -61,8 +61,14 @@ diff --git a/src/views/detections/overview/DetectionPerformanceEventDomainOverview.vue b/src/views/detections/overview/DetectionPerformanceEventDomainOverview.vue index 1e3506dd..469d0eaf 100644 --- a/src/views/detections/overview/DetectionPerformanceEventDomainOverview.vue +++ b/src/views/detections/overview/DetectionPerformanceEventDomainOverview.vue @@ -190,13 +190,13 @@ export default { this.chartOptionMetric = _.cloneDeep(this.chartOption) this.metricList.sort(reverseSortBy(0))//将返回的数据按时间降序排序,方便找到实线和虚线的交点 - let endIndex = (this.metricList). findIndex ((item) => item[0] <= 1435781434781 ); + //let endIndex = (this.metricList). findIndex ((item) => item[0] <= 1435781434781 ); + let endIndex = (this.metricList). findIndex ((item) => item[0] <= this.detection.endTime*1000 ); endIndex = this.metricList.length-endIndex - //let endIndex = (this.metricList). findIndex ((item) => item[0] <= this.detection.endTime*1000 ); this.metricList.sort(sortBy(0))//将返回的数据按时间升序排序,方便找到实线和虚线的交点 - let startIndex = (this.metricList). findIndex ((item) => item[0] >= 1435781432781 ); - //let startIndex = (this.metricList). findIndex ((item) => item[0] >= this.detection.startTime*1000 ); + //let startIndex = (this.metricList). findIndex ((item) => item[0] >= 1435781432781 ); + let startIndex = (this.metricList). findIndex ((item) => item[0] >= this.detection.startTime*1000 ); if(startIndex >-1 && endIndex >-1){ this.chartOptionMetric.series[0].data = this.metricList.slice(0,startIndex).map(v => [Number(v[0]), Number(v[1]), unitTypes.number]) diff --git a/src/views/detections/overview/DetectionPerformanceEventIpOverview.vue b/src/views/detections/overview/DetectionPerformanceEventIpOverview.vue index a2d49981..adee696e 100644 --- a/src/views/detections/overview/DetectionPerformanceEventIpOverview.vue +++ b/src/views/detections/overview/DetectionPerformanceEventIpOverview.vue @@ -153,13 +153,14 @@ export default { this.chartOptionMetric = _.cloneDeep(this.chartOption) this.metricList.sort(reverseSortBy(0))//将返回的数据按时间降序排序,方便找到实线和虚线的交点 - let endIndex = (this.metricList). findIndex ((item) => item[0] <= 1435781434781 ); + //let endIndex = (this.metricList). findIndex ((item) => item[0] <= 1435781434781 ); + let endIndex = (this.metricList). findIndex ((item) => item[0] <= this.detection.endTime*1000 ); endIndex = this.metricList.length-endIndex - //let endIndex = (this.metricList). findIndex ((item) => item[0] <= this.detection.endTime*1000 ); + this.metricList.sort(sortBy(0))//将返回的数据按时间升序排序,方便找到实线和虚线的交点 - let startIndex = (this.metricList). findIndex ((item) => item[0] >= 1435781432781 ); - //let startIndex = (this.metricList). findIndex ((item) => item[0] >= this.detection.startTime*1000 ); + //let startIndex = (this.metricList). findIndex ((item) => item[0] >= 1435781432781 ); + let startIndex = (this.metricList). findIndex ((item) => item[0] >= this.detection.startTime*1000 ); if(startIndex >-1 && endIndex >-1){ this.chartOptionMetric.series[0].data = this.metricList.slice(0,startIndex).map(v => [Number(v[0]), Number(v[1]), unitTypes.number])