|
|
@@ -32,11 +32,11 @@
|
|
|
import { storeToRefs } from 'pinia';
|
|
|
import { OptionType } from './constants';
|
|
|
import { useGlobSetting } from '@/hooks/setting';
|
|
|
+ import { FenceDisplayStatus } from '@/types/camera/constant';
|
|
|
const valuePreset = ref<[string, string]>();
|
|
|
const cameraDetailStore = useCameraDetailStore();
|
|
|
const { isShowFence, detail } = storeToRefs(cameraDetailStore);
|
|
|
|
|
|
-
|
|
|
const options = ref([]);
|
|
|
|
|
|
const { appPCUrl } = useGlobSetting();
|
|
|
@@ -54,9 +54,8 @@
|
|
|
options.value = renameKeys(res.algoInfoVOList);
|
|
|
});
|
|
|
|
|
|
- // FIXME: 该 api 还没有提供
|
|
|
getAppCameraAlgoPreset(newId).then((res) => {
|
|
|
- valuePreset.value = [res.algoCode, res.presetToken];
|
|
|
+ valuePreset.value = [res.algoId, res.presetToken];
|
|
|
});
|
|
|
},
|
|
|
);
|
|
|
@@ -65,7 +64,7 @@
|
|
|
return data.map((item) => {
|
|
|
const newItem: OptionType = {
|
|
|
label: item.name,
|
|
|
- value: item.code,
|
|
|
+ value: item.id,
|
|
|
};
|
|
|
|
|
|
if (item.presetInfoList) {
|
|
|
@@ -80,26 +79,19 @@
|
|
|
};
|
|
|
|
|
|
const changeShowFence = async () => {
|
|
|
- if (isShowFence.value) {
|
|
|
- const params = {
|
|
|
- cameraCode: cameraDetailStore.detail?.code!,
|
|
|
- status: 0,
|
|
|
- };
|
|
|
- await updateFenceDisplayStatus(params);
|
|
|
- } else {
|
|
|
- const params = {
|
|
|
- cameraCode: cameraDetailStore.detail?.code!,
|
|
|
- status: 1,
|
|
|
- };
|
|
|
- updateFenceDisplayStatus(params);
|
|
|
- }
|
|
|
+ const params = {
|
|
|
+ cameraCode: cameraDetailStore.detail?.code!,
|
|
|
+ isDisplayFence: isShowFence.value ? FenceDisplayStatus.enabled : FenceDisplayStatus.disabled,
|
|
|
+ };
|
|
|
+
|
|
|
+ updateFenceDisplayStatus(params);
|
|
|
};
|
|
|
|
|
|
const changePreset = (value) => {
|
|
|
console.log('value', value);
|
|
|
const params = {
|
|
|
- algoCode: value[0],
|
|
|
- cameraCode: cameraDetailStore.detail?.code!,
|
|
|
+ algoId: value[0],
|
|
|
+ cameraId: cameraDetailStore.detail?.id!,
|
|
|
presetToken: value[1],
|
|
|
};
|
|
|
choosePreset(params);
|