diff --git a/src/views/detections/overview/DetectionPerformanceEventAppOverview.vue b/src/views/detections/overview/DetectionPerformanceEventAppOverview.vue index f2e2f619..7f379a88 100644 --- a/src/views/detections/overview/DetectionPerformanceEventAppOverview.vue +++ b/src/views/detections/overview/DetectionPerformanceEventAppOverview.vue @@ -67,7 +67,7 @@
{{$t('detections.value')}}
-
+
@@ -142,12 +142,12 @@ export default { if(this.metricList.length>0){ this.initChart() }else { - let chartDom = document.getElementById('detectionMetricChartApp') + let chartDom = document.getElementById(`detectionMetricChartApp${this.detection.appName}`) chartDom.innerHTML = '-' } }).catch(error => { console.log(error) - let chartDom = document.getElementById('detectionMetricChartApp') + let chartDom = document.getElementById(`detectionMetricChartApp${this.detection.appName}`) chartDom.innerHTML = '-' }).finally(() => { setTimeout(() => { @@ -161,7 +161,7 @@ export default { }, initChart(){ - this.metricChart = markRaw(echarts.init(document.getElementById('detectionMetricChartApp'))) + this.metricChart = markRaw(echarts.init(document.getElementById(`detectionMetricChartApp${this.detection.appName}`))) this.chartOptionMetric = _.cloneDeep(this.chartOption) this.metricList.sort(reverseSortBy(0))//将返回的数据按时间降序排序,方便找到实线和虚线的交点 diff --git a/src/views/detections/overview/DetectionPerformanceEventDomainOverview.vue b/src/views/detections/overview/DetectionPerformanceEventDomainOverview.vue index 5ebf67d4..76883237 100644 --- a/src/views/detections/overview/DetectionPerformanceEventDomainOverview.vue +++ b/src/views/detections/overview/DetectionPerformanceEventDomainOverview.vue @@ -69,7 +69,7 @@
{{$t('detections.value')}}
-
+
@@ -174,12 +174,12 @@ if(this.metricList.length>0){ this.initChart() }else { - let chartDom = document.getElementById('detectionMetricChartDomain') + let chartDom = document.getElementById(`detectionMetricChartDomain${this.detection.domain}`) chartDom.innerHTML = '-' } }).catch(error => { console.log(error) - let chartDom = document.getElementById('detectionMetricChartDomain') + let chartDom = document.getElementById(`detectionMetricChartDomain${this.detection.domain}`) chartDom.innerHTML = '-' }).finally(() => { setTimeout(() => { @@ -193,7 +193,7 @@ }, initChart(){ - this.metricChart = markRaw(echarts.init(document.getElementById('detectionMetricChartDomain')))//使用markRaw的原因:vue3+echart5 遇到的坑 Cannot read properties of undefined (reading 'type') + this.metricChart = markRaw(echarts.init(document.getElementById(`detectionMetricChartDomain${this.detection.domain}`)))//使用markRaw的原因:vue3+echart5 遇到的坑 Cannot read properties of undefined (reading 'type') this.chartOptionMetric = _.cloneDeep(this.chartOption) this.metricList.sort(reverseSortBy(0))//将返回的数据按时间降序排序,方便找到实线和虚线的交点 diff --git a/src/views/detections/overview/DetectionPerformanceEventIpOverview.vue b/src/views/detections/overview/DetectionPerformanceEventIpOverview.vue index 2f75bb96..46554cb1 100644 --- a/src/views/detections/overview/DetectionPerformanceEventIpOverview.vue +++ b/src/views/detections/overview/DetectionPerformanceEventIpOverview.vue @@ -60,7 +60,7 @@
{{$t('detections.value')}}
-
+
@@ -136,12 +136,12 @@ export default { if(this.metricList.length>0){ this.initChart() }else { - let chartDom = document.getElementById('detectionMetricChartIp') + let chartDom = document.getElementById(`detectionMetricChartIp${this.detection.serverIp}`) chartDom.innerHTML = '-' } }).catch(error => { console.log(error) - let chartDom = document.getElementById('detectionMetricChartIp') + let chartDom = document.getElementById(`detectionMetricChartIp${this.detection.serverIp}`) chartDom.innerHTML = '-' }).finally(() => { setTimeout(() => { @@ -155,7 +155,7 @@ export default { }, initChart(){ - this.metricChart = markRaw(echarts.init(document.getElementById('detectionMetricChartIp'))) + this.metricChart = markRaw(echarts.init(document.getElementById(`detectionMetricChartIp${this.detection.serverIp}`))) this.chartOptionMetric = _.cloneDeep(this.chartOption) this.metricList.sort(reverseSortBy(0))//将返回的数据按时间降序排序,方便找到实线和虚线的交点