From caa4119e394265a770bb08c4c619b021d74d5dee Mon Sep 17 00:00:00 2001 From: aBin Date: Mon, 17 Jan 2022 15:43:27 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=9F=A5=E8=AF=A2=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E4=BF=AE=E6=94=B9=E5=92=8C=E5=9B=9E=E5=88=B0=E9=A1=B6?= =?UTF-8?q?=E9=83=A8=E5=92=8C=E6=BB=9A=E5=8A=A8=E6=9D=A1=E6=AD=A3=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 4 ++-- src/views/Index/Index.vue | 13 +++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/App.vue b/src/App.vue index 03b65cb..93f9455 100644 --- a/src/App.vue +++ b/src/App.vue @@ -45,9 +45,9 @@ body, #app { background: transparent; } -body::-webkit-scrollbar { +/* body::-webkit-scrollbar { width: 0; -} +} */ diff --git a/src/views/Index/Index.vue b/src/views/Index/Index.vue index 1bde55e..b6d255c 100644 --- a/src/views/Index/Index.vue +++ b/src/views/Index/Index.vue @@ -23,6 +23,7 @@ + @@ -43,8 +44,8 @@ export default { disProgress: true, timeObj: { carId: 2, - startTime: Date.parse(new Date()) - 3600 * 24 * 1000, - endTime: Date.parse(new Date()), + startTime: '', + endTime: '', types: [1, 2], }, timer: null, @@ -52,6 +53,12 @@ export default { }; }, async created() { + const startTime = this.$moment().valueOf() - 3600 * 24 * 1000; + const endTime = this.$moment().valueOf(); + const startTimeStr = this.$moment(startTime).format('YYYY-MM-DD') + ' 00:00:00'; + const endTimeStr = this.$moment(endTime).format('YYYY-MM-DD') + ' 23:59:59'; + this.timeObj.startTime = this.$moment(startTimeStr).valueOf(); + this.timeObj.endTime = this.$moment(endTimeStr).valueOf(); if (this.timer) { clearInterval(this.timer); } @@ -63,6 +70,8 @@ export default { this.timer = null; }, methods: { + // 获取默认时间 昨天的00:00:00 到今天的23:59:59 + getDefaultTime() {}, async getData(timeData) { try { if (timeData) {