From b0c844b5a452984eb641656d97d35a0eab682968 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Wed, 16 Jul 2025 13:42:25 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/home/components/control-deck.vue | 6 +++ .../modal-content/add-or-edit-marker-form.vue | 49 +++++++++++++------ 2 files changed, 41 insertions(+), 14 deletions(-) diff --git a/src/views/home/components/control-deck.vue b/src/views/home/components/control-deck.vue index aebf108..50cd8f1 100644 --- a/src/views/home/components/control-deck.vue +++ b/src/views/home/components/control-deck.vue @@ -640,6 +640,12 @@ const handleChangeRobot = debounce(async (type) => { const res = await handleRobotActionApi(params) console.log(res, '操控机器人---') + if (res.code == 200 && type != 9) { + isStopRight.value = true + } + if (res.code == 200 && type == 9) { + isStopRight.value = false + } }, 1000) // 停止机器人 diff --git a/src/views/home/components/modal-content/add-or-edit-marker-form.vue b/src/views/home/components/modal-content/add-or-edit-marker-form.vue index 5153aaf..3dc463d 100644 --- a/src/views/home/components/modal-content/add-or-edit-marker-form.vue +++ b/src/views/home/components/modal-content/add-or-edit-marker-form.vue @@ -262,11 +262,15 @@ const onHandleConfirm = () => { const { Robot_x, Robot_y, PTZ_x, PTZ_y, PTZ_zoom, Robot_theta } = res?.data.data // 如果是修改时判断当前位置是否与点位一致 - if (markerParams.value.type === '修改') { - if ( - Math.abs(Robot_x - markerParams.value.xCount) > 2 || - Math.abs(Robot_y - markerParams.value.yCount) > 2 - ) { + // if (markerParams.value.type === '修改') { + + // } + + if ( + Math.abs(Robot_x - markerParams.value.xCount) > 2 || + Math.abs(Robot_y - markerParams.value.yCount) > 2 + ) { + if (markerParams.value.type === '修改') { dialog.warning({ title: '温馨提示', content: @@ -295,22 +299,39 @@ const onHandleConfirm = () => { pointName: markerParams.value.markerName, } - if (markerParams.value.type === '修改') { - addMarkerParams.id = markerParams.value.id - } - + addMarkerParams.id = markerParams.value.id const { data: result } = await addMarkerApi(addMarkerParams) if (result.code == 200) { - message.success( - markerParams.value.type === '新增' - ? '新增点位成功' - : '修改点位成功', - ) + message.success('修改点位成功') onHandleCloseAddModal() } }, }) + } else { + markerParams.value.xCount = Robot_x + markerParams.value.yCount = Robot_y + markerParams.value.PTZ_x = PTZ_x + markerParams.value.PTZ_y = PTZ_y + markerParams.value.markerAngle = Robot_theta + markerParams.value.PTZ_zoom = PTZ_zoom + + const addMarkerParams = { + ptzz: markerParams.value.PTZ_zoom, + theta: markerParams.value.markerAngle, + ptzx: markerParams.value.PTZ_x, + ptzy: markerParams.value.PTZ_y, + positionX: Math.ceil(markerParams.value.xCount), + positionY: Math.ceil(markerParams.value.yCount), + mapId: markerParams.value.mapId, + pointName: markerParams.value.markerName, + } + + const { data: result } = await addMarkerApi(addMarkerParams) + if (result.code == 200) { + message.success('新增点位成功') + onHandleCloseAddModal() + } } } })