From 7e1e05a15fd6d135a4ff58918a2f7df797a5ed6e Mon Sep 17 00:00:00 2001 From: quanyawei <401863037@qq.com> Date: Mon, 22 Apr 2024 10:20:12 +0800 Subject: [PATCH] fix: 单位修改 --- src/views/onlineRate/detailBox.vue | 27 +++++++++++++++++++-------- 1 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/views/onlineRate/detailBox.vue b/src/views/onlineRate/detailBox.vue index 999e7fd..27e06ea 100644 --- a/src/views/onlineRate/detailBox.vue +++ b/src/views/onlineRate/detailBox.vue @@ -140,30 +140,37 @@ pickerOptions: { shortcuts: [{ + text: '������', + onClick (picker) { + const end = dayjs() + const start = new Date(dayjs().startOf('day')) + picker.$emit('pick', [new Date(start), new Date(end)]) + } + }, { text: '���1���', onClick (picker) { - const end = dayjs().subtract(1, 'hour') + const end = dayjs() const start = dayjs().subtract(1, 'day') picker.$emit('pick', [new Date(start), new Date(end)]) } }, { text: '���3���', onClick (picker) { - const end = dayjs().subtract(1, 'hour') + const end = dayjs() const start = dayjs().subtract(3, 'day') picker.$emit('pick', [new Date(start), new Date(end)]) } }, { text: '���5���', onClick (picker) { - const end = dayjs().subtract(1, 'hour') + const end = dayjs() const start = dayjs().subtract(5, 'day') picker.$emit('pick', [new Date(start), new Date(end)]) } }, { text: '���7���', onClick (picker) { - const end = dayjs().subtract(1, 'hour') + const end = dayjs() const start = dayjs().subtract(7, 'day') picker.$emit('pick', [new Date(start), new Date(end)]) } @@ -217,8 +224,8 @@ }, mounted () { this.title = `${this.macDate.name}������` - this.startTime = this.macDate.startTime - this.endTime = this.macDate.endTime + this.startTime = dayjs(this.macDate.startTime).format('YYYY-MM-DD HH:mm') + this.endTime = dayjs(this.macDate.endTime).format('YYYY-MM-DD HH:mm') this.$set(this.selectTime, 0, new Date(this.macDate.startTime)) this.$set(this.selectTime, 1, new Date(this.macDate.endTime)) this.getLineData() @@ -238,8 +245,12 @@ this.startTime = !this.selectTime ? '' : dayjs(this.selectTime[0]).format('YYYY-MM-DD HH:mm') this.endTime = !this.selectTime ? '' : dayjs(this.selectTime[1]).format('YYYY-MM-DD HH:mm') this.getMacDetail() - if (this.type !== 'minute') { - this.getLineData() + if (this.type === 'minute') { + this.lineType = 'hour' + this.getLineData(this.startTime, this.endTime, 'hour') + } else { + this.lineType = this.type + this.getLineData(this.startTime, this.endTime, this.type) } }, initPieChart (pieChartData) { -- Gitblit v1.8.0