From f8ffc31cd5e2b7c542c1c18ec8fd4d7329b80eb2 Mon Sep 17 00:00:00 2001 From: chenjinsong <523037378@qq.com> Date: Thu, 10 Oct 2024 10:52:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20detection=E4=B8=AA=E5=88=AB=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=AD=97=E6=AE=B5=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mock/detection.js | 4 ++-- src/views/detections/overview/detectionDetailMixin.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mock/detection.js b/src/mock/detection.js index 8d9caf94..0d2c1bed 100644 --- a/src/mock/detection.js +++ b/src/mock/detection.js @@ -316,8 +316,8 @@ if (openMock) { severity: 'high', keyFields: 'domain', keyValues: 'test.com', - thresholdNum: 3, - recordsNum: 5, + thresholdValue: 3, + metricValue: 5, reset: 60, startTime: 169780543432, endTime: 169790486213 diff --git a/src/views/detections/overview/detectionDetailMixin.js b/src/views/detections/overview/detectionDetailMixin.js index c61535d1..bba848dc 100644 --- a/src/views/detections/overview/detectionDetailMixin.js +++ b/src/views/detections/overview/detectionDetailMixin.js @@ -229,8 +229,8 @@ export default { const seriesData = [] const markLineData = [] data.forEach(item => { - seriesData.push([getMillisecond(JSON.parse(item.startTime)), item.recordsNum, getSeverityNumberColor(item.severity)]) - const obj = markLineData.find(d => d.yAxis === item.thresholdNum) + seriesData.push([getMillisecond(JSON.parse(item.startTime)), item.metricValue, getSeverityNumberColor(item.severity)]) + const obj = markLineData.find(d => d.yAxis === item.thresholdValue) if (!obj) { markLineData.push({ yAxis: item.thresholdNum, @@ -255,7 +255,7 @@ export default { }) // 计算折线图左侧宽度 - const maxValue = Math.max(...data.map(obj => obj.recordsNum)) + const maxValue = Math.max(...data.map(obj => obj.metricValue)) if (maxValue >= 1000) { let yAxisLabel = '' // y轴显示的值 if ((maxValue / (1000)) >= 1) {