+
@@ -218,7 +218,12 @@ export default {
// 时间轴红点的点击事件,添加防抖处理
onChange: throttle(function (e, index) {
this.activeCircle = index
- this.$emit('change', e.eventId)
+ const param = {
+ eventId: e.eventId,
+ startTime: e.startTime,
+ endTime: e.endTime / 1000
+ }
+ this.$emit('change', param)
}, 500),
// onChange (e, index) {
// this.activeCircle = index
@@ -236,8 +241,8 @@ export default {
this.myTimeData = this.$_.cloneDeep(this.timeData)
this.activeCircle = this.myTimeData.length - 1
this.myTimeData.forEach((item, index) => {
- item.statTime = getMillisecond(item.statTime)
- item.lastTime = this.$_.cloneDeep(item.statTime)
+ item.endTime = getMillisecond(item.endTime)
+ item.lastTime = this.$_.cloneDeep(item.endTime)
let minutes = new Date(item.lastTime).getMinutes()
let hours = new Date(item.lastTime).getHours()
minutes = minutes < 10 ? '0' + minutes : minutes
@@ -248,7 +253,7 @@ export default {
if (index === 0) {
let marginLeft = this.lineWidth - ((item.itemDiffTime / item.diffTime) * this.lineWidth)
- marginLeft = Math.round(marginLeft) + 27 + 'px' // 20px的左边距+小球半径7px
+ marginLeft = Math.round(marginLeft) + 34 + 'px' // 20px的左边距+小球直径14px
item.marginLeft = marginLeft
} else {
// 从第二个开始计算距离上一个球的距离,并减去上一个球的直径
@@ -336,5 +341,9 @@ export default {
.margin-l-30 {
margin-left: 30px;
}
+
+ .margin-l-25 {
+ margin-left: 25px;
+ }
}
diff --git a/src/views/detections/overview/IndicatorMatchOverview.vue b/src/views/detections/overview/IndicatorMatchOverview.vue
index be94bff8..c26efb5d 100644
--- a/src/views/detections/overview/IndicatorMatchOverview.vue
+++ b/src/views/detections/overview/IndicatorMatchOverview.vue
@@ -26,7 +26,7 @@
{{ $t('overall.duration') }}
- {{ unitConvert(parseInt(detection.durationS), 'time', 's', null, 0).join(' ') || '-' }}
+ {{ unitConvert(parseInt(myDetection.durationS), 'time', 's', null, 0).join(' ') || '-' }}
diff --git a/src/views/detections/overview/detectionDetailMixin.js b/src/views/detections/overview/detectionDetailMixin.js
index 2cefed92..73b9846e 100644
--- a/src/views/detections/overview/detectionDetailMixin.js
+++ b/src/views/detections/overview/detectionDetailMixin.js
@@ -82,7 +82,7 @@ export default {
axios.get(api.detection.event.detailTimeDistribution, { params: timeParams }).then(res => {
if (res.status === 200) {
const timeData = res.data.data.result
- timeData.sort((a, b) => a.statTime - b.statTime)
+ timeData.sort((a, b) => a.endTime - b.endTime)
this.timeData = timeData
}
}).catch(e => {
@@ -133,7 +133,7 @@ export default {
const params = {
startTime: getSecond(this.timeFilter.startTime),
endTime: getSecond(this.timeFilter.endTime),
- eventId: e,
+ eventId: e.eventId,
ruleType: this.detection.ruleType,
resource: this.q,
isGroup: this.isGroup
@@ -149,6 +149,11 @@ export default {
if (detailData?.eventInfo) {
detailData.eventInfoList = JSON.parse(detailData.eventInfo)
}
+ if (!detailData.startTime) {
+ detailData.startTime = e.startTime
+ detailData.endTime = e.endTime
+ detailData.durationS = e.endTime - e.startTime
+ }
this.myDetection = { ...this.myDetection, ...detailData }
}
}
@@ -165,7 +170,7 @@ export default {
const seriesData = []
const markLineData = []
data.forEach(item => {
- seriesData.push([getMillisecond(JSON.parse(item.startTime)), item.recordsNum])
+ seriesData.push([getMillisecond(JSON.parse(item.startTime)), item.recordsNum, getSeverityNumberColor(item.severity)])
const obj = markLineData.find(d => d.yAxis === item.thresholdNum)
if (!obj) {
markLineData.push({