Explorar el Código

相机参数设置增加默认值

louhangfei hace 2 años
padre
commit
d7a30fd1bd
Se han modificado 1 ficheros con 5 adiciones y 4 borrados
  1. 5 4
      src/views/cameras/preview/store/useCameraDetailStore.ts

+ 5 - 4
src/views/cameras/preview/store/useCameraDetailStore.ts

@@ -5,6 +5,7 @@ import { useRouteQuery } from '@vueuse/router';
 import dayjs from 'dayjs';
 import { defineStore } from 'pinia';
 import { ref } from 'vue';
+import { VideoResolution } from '../components/CameraParams/types';
 
 interface CameraParams {
   startAt: string;
@@ -21,8 +22,8 @@ export const BASE_RESOLUTION = 1920;
 const defaultParams: CameraParams = {
   startAt: '',
   endAt: '',
-  resolution: 1,
-  period: 0,
+  resolution: VideoResolution.HIGH_RESOLUTION,
+  period: 30,
 };
 
 const formatDateTime = (time: string) => {
@@ -43,8 +44,8 @@ const useCameraDetailStore = defineStore('cameraDetail', () => {
     params.value = {
       startAt: formatDateTime(newDetail.nvrStartAt || '00:00:00'),
       endAt: formatDateTime(newDetail.nvrEndAt || '23:59:59'),
-      resolution: newDetail.resolution,
-      period: newDetail.nvrPeriod,
+      resolution: newDetail.resolution || VideoResolution.HIGH_RESOLUTION,
+      period: newDetail.nvrPeriod || 30,
     };
   };