fix: 追踪页底部时间轴初始化时添加最后一分钟时间反馈

This commit is contained in:
刘洪洪
2024-03-05 11:58:02 +08:00
parent 32e455c6eb
commit 95b2cb33c3
2 changed files with 10 additions and 3 deletions

View File

@@ -43,10 +43,10 @@ export default {
}
},
mounted () {
this.getDate()
this.getDate('init')
},
methods: {
getDate () {
getDate (e) {
// 切换页面进来时timeFilter时间戳为秒而非毫秒
const timeFilter = {
startTime: getMillisecond(this.timeFilter.startTime),
@@ -91,6 +91,13 @@ export default {
}
this.timeLine = myTimeRange
if (e === 'init') {
const timeObj = {
startTime: this.timeLine.slice(-1)[0].stamp - 60 * 1000,
endTime: this.timeLine.slice(-1)[0].stamp
}
this.$emit('change', timeObj)
}
},
// 按时间间隔格式化时间
formatTime (timestamp, showTimeInterval, timeInterval) {