diff --git a/src/components/common/TimeLine.vue b/src/components/common/TimeLine.vue index c72bc0c7..a8a7732e 100644 --- a/src/components/common/TimeLine.vue +++ b/src/components/common/TimeLine.vue @@ -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) { diff --git a/src/views/location/Index.vue b/src/views/location/Index.vue index 58661f89..e72d88f3 100644 --- a/src/views/location/Index.vue +++ b/src/views/location/Index.vue @@ -1177,7 +1177,7 @@ export default { }, // 时间轴改变时,重新查询人marker async minuteTimeFilter (n) { - this.debounceFunc() + this.debounceFunc?.() }, // 切换追踪的用户 currentShowSubscriber (n) {