|
|
@@ -50,6 +50,7 @@
|
|
|
FENCE_ENBALED_STATUS,
|
|
|
CameraAlgoItem,
|
|
|
updateCameraAlgoStatusApi,
|
|
|
+ updateCameraAlgoRelStatus,
|
|
|
} from '@/api/camera/camera-preview';
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
|
|
import AlgoSwitchCard from '../AlgoSwitchCard/AlgoSwitchCard.vue';
|
|
|
@@ -126,8 +127,7 @@
|
|
|
// console.log('detail change', detail);
|
|
|
// const detectionJSON = getDetectionJSON(detail?.detectionFrequency);
|
|
|
const enableCard = detail?.status === ALGO_ENABLED_STATUS.enabled ? true : false;
|
|
|
- const electronicFenceBool =
|
|
|
- detail?.electronicFence === FENCE_ENBALED_STATUS.enabled ? true : false;
|
|
|
+ const electronicFenceBool = detail?.electronicFence === FENCE_ENBALED_STATUS.enabled ? true : false;
|
|
|
|
|
|
// const timeRangeArr = getDetectionTimeJSON(detail?.detectionTime) || [];
|
|
|
const timeRangeArr = getDetectionTime(detail?.detectionTime) || [];
|
|
|
@@ -146,17 +146,13 @@
|
|
|
regionJudge: commonInfo.regionJudge || 0,
|
|
|
judge: commonInfo.judge || commonInfo.judge == 0 ? commonInfo.judge : 1,
|
|
|
eventDurationMinMs:
|
|
|
- commonInfo.eventDurationMinMs || commonInfo.eventDurationMinMs == 0
|
|
|
- ? commonInfo.eventDurationMinMs
|
|
|
- : 1,
|
|
|
+ commonInfo.eventDurationMinMs || commonInfo.eventDurationMinMs == 0 ? commonInfo.eventDurationMinMs : 1,
|
|
|
eventDurationMinFrames:
|
|
|
commonInfo.eventDurationMinFrames || commonInfo.eventDurationMinFrames == 0
|
|
|
? commonInfo.eventDurationMinFrames
|
|
|
: 1,
|
|
|
eventAlarmIntervalMs:
|
|
|
- commonInfo.eventAlarmIntervalMs || commonInfo.eventAlarmIntervalMs == 0
|
|
|
- ? commonInfo.eventAlarmIntervalMs
|
|
|
- : 1,
|
|
|
+ commonInfo.eventAlarmIntervalMs || commonInfo.eventAlarmIntervalMs == 0 ? commonInfo.eventAlarmIntervalMs : 1,
|
|
|
eventAlarmIntervalFrames:
|
|
|
commonInfo.eventAlarmIntervalFrames || commonInfo.eventAlarmIntervalFrames == 0
|
|
|
? commonInfo.eventAlarmIntervalFrames
|
|
|
@@ -201,11 +197,11 @@
|
|
|
detail.status = status;
|
|
|
selectedAlgoId.value = algoId;
|
|
|
algoSettingIsOpen.value = false;
|
|
|
- updateCameraAlgoApi(params)
|
|
|
+ updateCameraAlgoRelStatus(params)
|
|
|
.then(() => {
|
|
|
ElMessage.success(algoStatus ? '算法已开启' : '算法已关闭');
|
|
|
})
|
|
|
- .catch((err) => {
|
|
|
+ .catch(() => {
|
|
|
detail.status = initialStatus;
|
|
|
});
|
|
|
};
|
|
|
@@ -304,16 +300,12 @@
|
|
|
};
|
|
|
|
|
|
const confirmSwitchAlgo = () => {
|
|
|
- return ElMessageBox.confirm(
|
|
|
- '<strong>确认切换算法吗?</strong><br />切换后未保存的算法配置将被丢弃。',
|
|
|
- '',
|
|
|
- {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning',
|
|
|
- dangerouslyUseHTMLString: true,
|
|
|
- },
|
|
|
- );
|
|
|
+ return ElMessageBox.confirm('<strong>确认切换算法吗?</strong><br />切换后未保存的算法配置将被丢弃。', '', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
const handleRemove = (algoId: number) => {
|