|
@@ -19,7 +19,7 @@
|
|
|
:canvas-size="{ width: canvasWidth, height: canvasHeight }"
|
|
:canvas-size="{ width: canvasWidth, height: canvasHeight }"
|
|
|
:line-points="fenceStore.allFences"
|
|
:line-points="fenceStore.allFences"
|
|
|
:fence-id="fenceStore.currentFenceId"
|
|
:fence-id="fenceStore.currentFenceId"
|
|
|
- @save="handleSaveFence"
|
|
|
|
|
|
|
+ @save="handleSaveFenceToLocal"
|
|
|
@select="handleSelectFencePolygon"
|
|
@select="handleSelectFencePolygon"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
@@ -54,6 +54,8 @@
|
|
|
@toggle-range="toggleRange"
|
|
@toggle-range="toggleRange"
|
|
|
@select="handleSelectFenceList"
|
|
@select="handleSelectFenceList"
|
|
|
@toggle-fence-status="paramsSettingFn.toggleFenceStatus"
|
|
@toggle-fence-status="paramsSettingFn.toggleFenceStatus"
|
|
|
|
|
+ @save="handleSaveFenceToServer"
|
|
|
|
|
+ @cancel="handleCancelFenceEdit"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -151,14 +153,22 @@
|
|
|
fenceStore.currentFenceId = nextFenceId;
|
|
fenceStore.currentFenceId = nextFenceId;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const handleSaveFence = (data: { fenceId?: number; polygon: FencePolygonPoints }) => {
|
|
|
|
|
|
|
+ const handleSaveFenceToServer = () => {
|
|
|
|
|
+ paramsSettingFn.saveFenceToServer();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handleCancelFenceEdit = () => {
|
|
|
|
|
+ paramsSettingFn.reset();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ /** 将数据保存到前端本地 */
|
|
|
|
|
+ const handleSaveFenceToLocal = (data: { fenceId?: number; polygon: FencePolygonPoints }) => {
|
|
|
console.log('提交的fenceId', data);
|
|
console.log('提交的fenceId', data);
|
|
|
const { fenceId, polygon } = data;
|
|
const { fenceId, polygon } = data;
|
|
|
|
|
|
|
|
const cameraId = cameraDetailStore.cameraId;
|
|
const cameraId = cameraDetailStore.cameraId;
|
|
|
const algoId = cameraAlgoStore.selectedAlgoId;
|
|
const algoId = cameraAlgoStore.selectedAlgoId;
|
|
|
const presetToken = presetStore.currentPresetToken;
|
|
const presetToken = presetStore.currentPresetToken;
|
|
|
- const fenceGroupId = fenceStore.currentFenceGroupId;
|
|
|
|
|
if (!cameraId) {
|
|
if (!cameraId) {
|
|
|
ElMessage.error('未选中相机');
|
|
ElMessage.error('未选中相机');
|
|
|
return;
|
|
return;
|
|
@@ -171,7 +181,6 @@
|
|
|
ElMessage.error('未选中预置位');
|
|
ElMessage.error('未选中预置位');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- const param = { cameraId: cameraId, algoId: algoId, presetToken };
|
|
|
|
|
|
|
|
|
|
if (!fenceId) {
|
|
if (!fenceId) {
|
|
|
// 不存在的话,就新建电子围栏
|
|
// 不存在的话,就新建电子围栏
|