|
|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
+ <div id="algoSetting">
|
|
|
<div style="font-size: 14px; font-weight: bold">算法配置</div>
|
|
|
<div style="display: flex">
|
|
|
<div class="algoTagWrapper">
|
|
|
@@ -36,7 +36,7 @@
|
|
|
updateCameraAlgoApi,
|
|
|
FENCE_ENBALED_STATUS,
|
|
|
} from '@/api/camera/camera-preview';
|
|
|
- import { ElMessage } from 'element-plus';
|
|
|
+ import { ElMessage, ElMessageBox } from 'element-plus';
|
|
|
import AlgoTag from './AlgoTag.vue';
|
|
|
import useFenceStore from '../../store/useFenceStore';
|
|
|
import useCameraDetailStore from '../../store/useCameraDetailStore';
|
|
|
@@ -47,6 +47,7 @@
|
|
|
getDetectionJSON,
|
|
|
getDetectionTimeJSON,
|
|
|
getInferCode,
|
|
|
+ getAlgoType,
|
|
|
getMetaValues,
|
|
|
getExtraCommonInfo,
|
|
|
getDetectionTime,
|
|
|
@@ -63,7 +64,29 @@
|
|
|
const cameraDetailStore = useCameraDetailStore();
|
|
|
|
|
|
const handleSelectAlgo = (algoId: number) => {
|
|
|
- if (algoId !== selectedAlgoId.value) {
|
|
|
+ if (selectedAlgoId.value === algoId) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (selectedAlgoId.value) {
|
|
|
+ const el = document.getElementById('algoSetting') as HTMLElement;
|
|
|
+ ElMessageBox.confirm(
|
|
|
+ '<strong>确认切换算法配置吗?</strong><br />切换后未保存的算法配置将被丢弃。',
|
|
|
+ 'warning',
|
|
|
+ {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
+ appendTo: el,
|
|
|
+ },
|
|
|
+ )
|
|
|
+ .then(() => {
|
|
|
+ if (algoId !== selectedAlgoId.value) {
|
|
|
+ selectedAlgoId.value = algoId;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ } else {
|
|
|
selectedAlgoId.value = algoId;
|
|
|
}
|
|
|
};
|
|
|
@@ -103,7 +126,7 @@
|
|
|
});
|
|
|
|
|
|
//是否有窗口时间
|
|
|
- if (commonInfo.timeWindow || commonInfo.timeWindow == 0) {
|
|
|
+ if (commonInfo.timeWindow) {
|
|
|
selectedAlgoDetail.value.timeWindow = commonInfo.timeWindow;
|
|
|
}
|
|
|
});
|
|
|
@@ -116,10 +139,15 @@
|
|
|
inferParams.regionJudge = param.regionJudge;
|
|
|
inferParams.criticalCounts = param.criticalCounts;
|
|
|
inferParams.judge = param.judge;
|
|
|
+ inferParams.algoCode = selectedAlgoDetail.value.algoInfo.code;
|
|
|
+ inferParams.algoType = getAlgoType(selectedAlgoDetail.value.algoInfo.extra);
|
|
|
+ if (param.timeWindow) {
|
|
|
+ inferParams.timeWindow = param.timeWindow;
|
|
|
+ }
|
|
|
const extraValue = {
|
|
|
inferCode: param.inferCode,
|
|
|
inferParams: [inferParams],
|
|
|
- };
|
|
|
+ } as any;
|
|
|
const newParam = {
|
|
|
cameraId: cameraId,
|
|
|
electronicFence: param.electronicFence,
|
|
|
@@ -161,4 +189,9 @@
|
|
|
min-width: 150px;
|
|
|
margin-right: 15px;
|
|
|
}
|
|
|
+
|
|
|
+ :deep(.el-message-box__status.el-icon) {
|
|
|
+ top: 0 !important;
|
|
|
+ transform: none !important;
|
|
|
+ }
|
|
|
</style>
|