|
|
@@ -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,
|
|
|
};
|
|
|
};
|
|
|
|