From 989c567c9610ac9895fadcbf4b6857c127206f74 Mon Sep 17 00:00:00 2001 From: fuguobin Date: Mon, 6 Nov 2023 09:54:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=BB=98=E8=AE=A4=E6=97=B6?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/details/index.vue | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/views/details/index.vue b/src/views/details/index.vue index b3a8e56..7ae92ce 100644 --- a/src/views/details/index.vue +++ b/src/views/details/index.vue @@ -25,7 +25,7 @@ type="datetimerange" start-placeholder="开始时间" end-placeholder="结束时间" - format="YYYY/MM/DD HH:mm:ss" + format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" :default-time="defaultTime" @change="timeChange" @@ -109,6 +109,7 @@ import * as echarts from 'echarts'; import { Ref } from 'vue'; import { useRoute, useRouter } from 'vue-router'; +import { useDateFormat, useNow, useTransition, TransitionPresets } from '@vueuse/core'; import { randomColor } from '@/utils/index'; const stackedRef: Ref = ref(null); import type { FormInstance, FormRules } from 'element-plus'; @@ -119,6 +120,8 @@ import { deetsVo, partitionVo, parameterVo, seriesVo } from '@/api/device/types' const router = useRouter(); const route = useRoute(); +const currentTime = useDateFormat(useNow(), 'YYYY-MM-DD'); +const currentSecond = useDateFormat(useNow(), 'YYYY-MM-DD HH:mm:ss'); const searchRef = ref(); const defaultTime: [Date, Date] = [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 12, 0, 0)]; @@ -126,8 +129,8 @@ const defaultTime: [Date, Date] = [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, const parameterLimit = ref(0); const deptId = ref(0); // const seriesData = ref(); -const searchForm = reactive({ - time: '', +const searchForm: any = reactive({ + time: [], device: '', parameter: [], partition: '', @@ -1107,6 +1110,9 @@ const options2 = { onMounted(() => { deptId.value = sessionStorage.getItem('deptId') === null ? 0 : Number(sessionStorage.getItem('deptId')); + searchForm.time = [currentTime.value + ' 00:00:00', currentSecond.value]; + filterForm.startTime = currentTime.value + ' 00:00:00'; + filterForm.endTime = currentSecond.value; getDevice(); getParam(); getPortion();