From 95b2cb33c3d0b37d7cbf43d2b2702ba718b08399 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B4=AA=E6=B4=AA?= <2498601771@qq.com> Date: Tue, 5 Mar 2024 11:58:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=BF=BD=E8=B8=AA=E9=A1=B5=E5=BA=95?= =?UTF-8?q?=E9=83=A8=E6=97=B6=E9=97=B4=E8=BD=B4=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E6=97=B6=E6=B7=BB=E5=8A=A0=E6=9C=80=E5=90=8E=E4=B8=80=E5=88=86?= =?UTF-8?q?=E9=92=9F=E6=97=B6=E9=97=B4=E5=8F=8D=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/TimeLine.vue | 11 +++++++++-- src/views/location/Index.vue | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) 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) {