bug修复
This commit is contained in:
parent
50c14ae22c
commit
b0c844b5a4
|
|
@ -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)
|
||||
|
||||
// 停止机器人
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue