Browse Source

增加默认时间

develop
fuguobin 1 year ago
parent
commit
989c567c96
  1. 12
      src/views/details/index.vue

12
src/views/details/index.vue

@ -25,7 +25,7 @@
type="datetimerange" type="datetimerange"
start-placeholder="开始时间" start-placeholder="开始时间"
end-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" value-format="YYYY-MM-DD HH:mm:ss"
:default-time="defaultTime" :default-time="defaultTime"
@change="timeChange" @change="timeChange"
@ -109,6 +109,7 @@
import * as echarts from 'echarts'; import * as echarts from 'echarts';
import { Ref } from 'vue'; import { Ref } from 'vue';
import { useRoute, useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import { useDateFormat, useNow, useTransition, TransitionPresets } from '@vueuse/core';
import { randomColor } from '@/utils/index'; import { randomColor } from '@/utils/index';
const stackedRef: Ref<HTMLElement | any> = ref(null); const stackedRef: Ref<HTMLElement | any> = ref(null);
import type { FormInstance, FormRules } from 'element-plus'; import type { FormInstance, FormRules } from 'element-plus';
@ -119,6 +120,8 @@ import { deetsVo, partitionVo, parameterVo, seriesVo } from '@/api/device/types'
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const currentTime = useDateFormat(useNow(), 'YYYY-MM-DD');
const currentSecond = useDateFormat(useNow(), 'YYYY-MM-DD HH:mm:ss');
const searchRef = ref<FormInstance>(); const searchRef = ref<FormInstance>();
const defaultTime: [Date, Date] = [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 12, 0, 0)]; 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 parameterLimit = ref(0);
const deptId = ref(0); const deptId = ref(0);
// const seriesData = ref<seriesVo[]>(); // const seriesData = ref<seriesVo[]>();
const searchForm = reactive({ const searchForm: any = reactive({
time: '', time: [],
device: '', device: '',
parameter: [], parameter: [],
partition: '', partition: '',
@ -1107,6 +1110,9 @@ const options2 = {
onMounted(() => { onMounted(() => {
deptId.value = sessionStorage.getItem('deptId') === null ? 0 : Number(sessionStorage.getItem('deptId')); 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(); getDevice();
getParam(); getParam();
getPortion(); getPortion();

Loading…
Cancel
Save