|
@@ -50,7 +50,7 @@
|
|
|
import { createAlgoSubmitParams, cameraAlgoToJSON } from '@/modules/algo/algo-params-edit/utils';
|
|
import { createAlgoSubmitParams, cameraAlgoToJSON } from '@/modules/algo/algo-params-edit/utils';
|
|
|
|
|
|
|
|
import { ALGO_ENABLED_STATUS } from '@/api/camera/camera-preview';
|
|
import { ALGO_ENABLED_STATUS } from '@/api/camera/camera-preview';
|
|
|
- import { ref, watchEffect } from 'vue';
|
|
|
|
|
|
|
+ import { ref, watch, watchEffect } from 'vue';
|
|
|
|
|
|
|
|
const cameraAlgoStore = useCameraAlgoStore();
|
|
const cameraAlgoStore = useCameraAlgoStore();
|
|
|
const fenceStore = useFenceStore();
|
|
const fenceStore = useFenceStore();
|
|
@@ -113,18 +113,24 @@
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- watchEffect(() => {
|
|
|
|
|
- const algoId = selectedAlgoId.value;
|
|
|
|
|
- if (!algoId) return;
|
|
|
|
|
- const detail = getAlgoDetail(algoId);
|
|
|
|
|
- if (!detail) return;
|
|
|
|
|
- selectedAlgoDetail.value = cameraAlgoToJSON(detail);
|
|
|
|
|
- fenceStore.getFence({
|
|
|
|
|
- algoId: algoId,
|
|
|
|
|
- cameraId: cameraDetailStore.cameraId,
|
|
|
|
|
- presetToken: presetStore.currentPresetToken,
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ watch(
|
|
|
|
|
+ () => selectedAlgoId.value,
|
|
|
|
|
+ (nextAlgoId) => {
|
|
|
|
|
+ const algoId = nextAlgoId;
|
|
|
|
|
+ if (!algoId) return;
|
|
|
|
|
+ const detail = getAlgoDetail(algoId);
|
|
|
|
|
+ if (!detail) return;
|
|
|
|
|
+ selectedAlgoDetail.value = cameraAlgoToJSON(detail);
|
|
|
|
|
+ fenceStore.getFence({
|
|
|
|
|
+ algoId: algoId,
|
|
|
|
|
+ cameraId: cameraDetailStore.cameraId,
|
|
|
|
|
+ presetToken: presetStore.currentPresetToken,
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ immediate: true,
|
|
|
|
|
+ },
|
|
|
|
|
+ );
|
|
|
|
|
|
|
|
const toggleFenceTool = () => {
|
|
const toggleFenceTool = () => {
|
|
|
const nextShowFenceTool = !fenceStore.showFenceTool;
|
|
const nextShowFenceTool = !fenceStore.showFenceTool;
|