diff --git a/src/views/detections/overview/DetectionPerformanceEventAppOverview.vue b/src/views/detections/overview/DetectionPerformanceEventAppOverview.vue index 260746e1..9fba4d89 100644 --- a/src/views/detections/overview/DetectionPerformanceEventAppOverview.vue +++ b/src/views/detections/overview/DetectionPerformanceEventAppOverview.vue @@ -56,6 +56,33 @@
+ +
+
+
{{$t('detections.metric')}}
+
+
{{detection.appName || '-'}}
+
+
+
+
{{$t('detections.value')}}
+
+
+
+
+
+
{{$t('detections.startTime')}}
+
+
{{dayJs.tz(detection.startTime*1000).format('YYYY-MM-DD HH:mm:ss') || '-'}}
+
+
+
+
{{$t('detections.endTime')}}
+
+
{{dayJs.tz(detection.endTime*1000).format('YYYY-MM-DD HH:mm:ss') || '-'}}
+
+
+
@@ -115,11 +142,13 @@ export default { if(this.metricList.length>0){ this.initChart() }else { - let chartDom = document.getElementById('detectionMetricChartDomain') + let chartDom = document.getElementById('detectionMetricChartApp') chartDom.innerHTML = '-' } }).catch(error => { console.log(error) + let chartDom = document.getElementById('detectionMetricChartApp') + chartDom.innerHTML = '-' }).finally(() => { setTimeout(() => { try { @@ -132,22 +161,22 @@ export default { }, initChart(){ - this.metricChart = markRaw(echarts.init(document.getElementById('detectionMetricChartDomain'))) + this.metricChart = markRaw(echarts.init(document.getElementById('detectionMetricChartApp'))) 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] <= this.detection.endTime*1000 ); + let endIndex = (this.metricList). findIndex ((item) => item[0] <= this.detection.endTime ); endIndex = this.metricList.length-endIndex 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] >= this.detection.startTime ); 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]) - this.chartOptionMetric.series[1].data = this.metricList.slice(startIndex-1,endIndex).map(v => [Number(v[0]), Number(v[1]), unitTypes.number]) - this.chartOptionMetric.series[2].data = this.metricList.slice(endIndex-1,this.metricList.length).map(v => [Number(v[0]), Number(v[1]), unitTypes.number]) + this.chartOptionMetric.series[0].data = this.metricList.slice(0,startIndex).map(v => [Number(v[0])*1000, Number(v[1]), unitTypes.number]) + this.chartOptionMetric.series[1].data = this.metricList.slice(startIndex-1,endIndex).map(v => [Number(v[0])*1000, Number(v[1]), unitTypes.number]) + this.chartOptionMetric.series[2].data = this.metricList.slice(endIndex-1,this.metricList.length).map(v => [Number(v[0])*1000, Number(v[1]), unitTypes.number]) } this.chartOptionMetric && this.metricChart.setOption(this.chartOptionMetric) diff --git a/src/views/detections/overview/DetectionPerformanceEventDomainOverview.vue b/src/views/detections/overview/DetectionPerformanceEventDomainOverview.vue index 08c28c47..2e9e7259 100644 --- a/src/views/detections/overview/DetectionPerformanceEventDomainOverview.vue +++ b/src/views/detections/overview/DetectionPerformanceEventDomainOverview.vue @@ -179,6 +179,8 @@ } }).catch(error => { console.log(error) + let chartDom = document.getElementById('detectionMetricChartDomain') + chartDom.innerHTML = '-' }).finally(() => { setTimeout(() => { try { @@ -196,17 +198,17 @@ this.metricList.sort(reverseSortBy(0))//将返回的数据按时间降序排序,方便找到实线和虚线的交点 //let endIndex = (this.metricList). findIndex ((item) => item[0] <= 1435781434781 ); - let endIndex = (this.metricList). findIndex ((item) => item[0] <= this.detection.endTime*1000 ); + let endIndex = (this.metricList). findIndex ((item) => item[0] <= this.detection.endTime ); endIndex = this.metricList.length-endIndex 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] >= this.detection.startTime ); 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]) - this.chartOptionMetric.series[1].data = this.metricList.slice(startIndex-1,endIndex).map(v => [Number(v[0]), Number(v[1]), unitTypes.number]) - this.chartOptionMetric.series[2].data = this.metricList.slice(endIndex-1,this.metricList.length).map(v => [Number(v[0]), Number(v[1]), unitTypes.number]) + this.chartOptionMetric.series[0].data = this.metricList.slice(0,startIndex).map(v => [Number(v[0])*1000, Number(v[1]), unitTypes.number]) + this.chartOptionMetric.series[1].data = this.metricList.slice(startIndex-1,endIndex).map(v => [Number(v[0])*1000, Number(v[1]), unitTypes.number]) + this.chartOptionMetric.series[2].data = this.metricList.slice(endIndex-1,this.metricList.length).map(v => [Number(v[0])*1000, Number(v[1]), unitTypes.number]) } this.chartOptionMetric && this.metricChart.setOption(this.chartOptionMetric) diff --git a/src/views/detections/overview/DetectionPerformanceEventIpOverview.vue b/src/views/detections/overview/DetectionPerformanceEventIpOverview.vue index 02ca3efa..f3a458a6 100644 --- a/src/views/detections/overview/DetectionPerformanceEventIpOverview.vue +++ b/src/views/detections/overview/DetectionPerformanceEventIpOverview.vue @@ -137,11 +137,13 @@ export default { if(this.metricList.length>0){ this.initChart() }else { - let chartDom = document.getElementById('detectionMetricChartDomain') + let chartDom = document.getElementById('detectionMetricChartIp') chartDom.innerHTML = '-' } }).catch(error => { console.log(error) + let chartDom = document.getElementById('detectionMetricChartIp') + chartDom.innerHTML = '-' }).finally(() => { setTimeout(() => { try { @@ -159,18 +161,19 @@ export default { this.metricList.sort(reverseSortBy(0))//将返回的数据按时间降序排序,方便找到实线和虚线的交点 //let endIndex = (this.metricList). findIndex ((item) => item[0] <= 1435781434781 ); - let endIndex = (this.metricList). findIndex ((item) => item[0] <= this.detection.endTime*1000 ); + console.log(this.detection) + let endIndex = (this.metricList). findIndex ((item) => item[0] <= this.detection.endTime ); endIndex = this.metricList.length-endIndex 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] >= this.detection.startTime ); 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]) - this.chartOptionMetric.series[1].data = this.metricList.slice(startIndex-1,endIndex).map(v => [Number(v[0]), Number(v[1]), unitTypes.number]) - this.chartOptionMetric.series[2].data = this.metricList.slice(endIndex-1,this.metricList.length).map(v => [Number(v[0]), Number(v[1]), unitTypes.number]) + this.chartOptionMetric.series[0].data = this.metricList.slice(0,startIndex).map(v => [Number(v[0])*1000, Number(v[1]), unitTypes.number]) + this.chartOptionMetric.series[1].data = this.metricList.slice(startIndex-1,endIndex).map(v => [Number(v[0])*1000, Number(v[1]), unitTypes.number]) + this.chartOptionMetric.series[2].data = this.metricList.slice(endIndex-1,this.metricList.length).map(v => [Number(v[0])*1000, Number(v[1]), unitTypes.number]) } this.chartOptionMetric && this.metricChart.setOption(this.chartOptionMetric)