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"
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<HTMLElement | any> = 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<FormInstance>();
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<seriesVo[]>();
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();

Loading…
Cancel
Save