From 8f5f6e1d7e5b461b71151583655368eafe1f2608 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Thu, 2 Nov 2023 17:09:47 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E6=97=B6=E9=97=B4=E8=8C=83=E5=9B=B4?= =?UTF-8?q?=E9=A2=84=E8=AE=BE=E5=8F=AF=E9=80=89=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/monitor/monitor/index.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/views/monitor/monitor/index.vue b/src/views/monitor/monitor/index.vue index 7ff8d0eb..03b0c81f 100644 --- a/src/views/monitor/monitor/index.vue +++ b/src/views/monitor/monitor/index.vue @@ -12,10 +12,12 @@ import { parseStrToDate, } from '@/utils/date-utils'; import { parseSizeFromKBs } from '@/utils/parse-utils'; +import dayjs, { Dayjs } from 'dayjs'; const { t } = useI18n(); /**开始结束时间类型 */ type RangePickerType = { + ranges: Record; /**全局时间 */ all: [string, string]; /**平均负载 */ @@ -32,6 +34,15 @@ type RangePickerType = { /**开始结束时间 */ let rangePicker = reactive({ + ranges: { + 昨天: [ + dayjs().subtract(1, 'day').startOf('day'), + dayjs().subtract(1, 'day').endOf('day'), + ], + 今天: [dayjs().startOf('day'), dayjs()], + 本周: [dayjs().startOf('week'), dayjs().endOf('week')], + 本月: [dayjs().startOf('month'), dayjs().endOf('month')], + }, all: ['', ''], load: ['', ''], cpu: ['', ''], @@ -425,6 +436,7 @@ onMounted(() => { format="YYYY-MM-DD HH:mm:ss" show-time :placeholder="['开始时间', '结束时间']" + :ranges="rangePicker.ranges" style="width: 100%" >