|
@@ -11,7 +11,7 @@
|
|
|
:label="item.algoInfo?.name"
|
|
:label="item.algoInfo?.name"
|
|
|
:is-active="item.algoId === selectedAlgoId"
|
|
:is-active="item.algoId === selectedAlgoId"
|
|
|
@click="handleSelectAlgo(item.algoId)"
|
|
@click="handleSelectAlgo(item.algoId)"
|
|
|
- :is-open="item.status === AlgoStatus.enabled"
|
|
|
|
|
|
|
+ :is-open="item.status === ALGO_ENABLED_STATUS.enabled"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
@@ -30,7 +30,11 @@
|
|
|
import useCameraAlgoStore from '../../store/useCameraAlgoStore';
|
|
import useCameraAlgoStore from '../../store/useCameraAlgoStore';
|
|
|
import AlgoSettingCard from './AlgoSettingCard.vue';
|
|
import AlgoSettingCard from './AlgoSettingCard.vue';
|
|
|
import { storeToRefs } from 'pinia';
|
|
import { storeToRefs } from 'pinia';
|
|
|
- import { deleteCameraAlgoApi, updateCameraAlgoApi } from '@/api/camera/camera-preview';
|
|
|
|
|
|
|
+ import {
|
|
|
|
|
+ deleteCameraAlgoApi,
|
|
|
|
|
+ updateCameraAlgoApi,
|
|
|
|
|
+ FENCE_ENBALED_STATUS,
|
|
|
|
|
+ } from '@/api/camera/camera-preview';
|
|
|
import { ElMessage } from 'element-plus';
|
|
import { ElMessage } from 'element-plus';
|
|
|
import AlgoTag from './AlgoTag.vue';
|
|
import AlgoTag from './AlgoTag.vue';
|
|
|
import useFenceStore from '../../store/useFenceStore';
|
|
import useFenceStore from '../../store/useFenceStore';
|
|
@@ -38,7 +42,7 @@
|
|
|
import usePresetListStore from '../../store/usePresetListStore';
|
|
import usePresetListStore from '../../store/usePresetListStore';
|
|
|
import AddAlgoDialog from './AddAlgoDialog.vue';
|
|
import AddAlgoDialog from './AddAlgoDialog.vue';
|
|
|
import { createDefaultTime, getDetectionJSON, getDetectionTimeJSON } from './utils';
|
|
import { createDefaultTime, getDetectionJSON, getDetectionTimeJSON } from './utils';
|
|
|
- import { AlgoStatus } from '@/api/camera/camera-preview';
|
|
|
|
|
|
|
+ import { ALGO_ENABLED_STATUS } from '@/api/camera/camera-preview';
|
|
|
import { watchEffect } from 'vue';
|
|
import { watchEffect } from 'vue';
|
|
|
|
|
|
|
|
const cameraAlgoStore = useCameraAlgoStore();
|
|
const cameraAlgoStore = useCameraAlgoStore();
|
|
@@ -67,8 +71,9 @@
|
|
|
if (!detail) return;
|
|
if (!detail) return;
|
|
|
console.log('detail change', detail);
|
|
console.log('detail change', detail);
|
|
|
const detectionJSON = getDetectionJSON(detail?.detectionFrequency);
|
|
const detectionJSON = getDetectionJSON(detail?.detectionFrequency);
|
|
|
- const enableCard = Boolean(detail?.status);
|
|
|
|
|
- const electronicFenceBool = Boolean(detail?.electronicFence);
|
|
|
|
|
|
|
+ const enableCard = detail?.status === ALGO_ENABLED_STATUS.enabled ? true : false;
|
|
|
|
|
+ const electronicFenceBool =
|
|
|
|
|
+ detail?.electronicFence === FENCE_ENBALED_STATUS.enabled ? true : false;
|
|
|
|
|
|
|
|
const timeRangeArr = getDetectionTimeJSON(detail?.detectionTime) || [createDefaultTime()];
|
|
const timeRangeArr = getDetectionTimeJSON(detail?.detectionTime) || [createDefaultTime()];
|
|
|
|
|
|