This commit is contained in:
parent
b0c844b5a4
commit
353bfba3b4
|
|
@ -257,14 +257,9 @@ const onHandleConfirm = () => {
|
||||||
puId: deviceInfo.value?.puId,
|
puId: deviceInfo.value?.puId,
|
||||||
type: '2',
|
type: '2',
|
||||||
}).then(async (res) => {
|
}).then(async (res) => {
|
||||||
console.log(res.data, 'res?.data')
|
|
||||||
|
|
||||||
const { Robot_x, Robot_y, PTZ_x, PTZ_y, PTZ_zoom, Robot_theta } = res?.data.data
|
const { Robot_x, Robot_y, PTZ_x, PTZ_y, PTZ_zoom, Robot_theta } = res?.data.data
|
||||||
|
|
||||||
// 如果是修改时判断当前位置是否与点位一致
|
// 如果是修改时判断当前位置是否与点位一致
|
||||||
// if (markerParams.value.type === '修改') {
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
Math.abs(Robot_x - markerParams.value.xCount) > 2 ||
|
Math.abs(Robot_x - markerParams.value.xCount) > 2 ||
|
||||||
|
|
@ -309,6 +304,13 @@ const onHandleConfirm = () => {
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
dialog.warning({
|
||||||
|
title: '温馨提示',
|
||||||
|
content: '机器人当前位置与预置点位不一致,确定新增吗?',
|
||||||
|
positiveText: '确定新增',
|
||||||
|
negativeText: '取消',
|
||||||
|
onPositiveClick: () => {},
|
||||||
|
onNegativeClick: async () => {
|
||||||
markerParams.value.xCount = Robot_x
|
markerParams.value.xCount = Robot_x
|
||||||
markerParams.value.yCount = Robot_y
|
markerParams.value.yCount = Robot_y
|
||||||
markerParams.value.PTZ_x = PTZ_x
|
markerParams.value.PTZ_x = PTZ_x
|
||||||
|
|
@ -332,6 +334,34 @@ const onHandleConfirm = () => {
|
||||||
message.success('新增点位成功')
|
message.success('新增点位成功')
|
||||||
onHandleCloseAddModal()
|
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,
|
||||||
|
}
|
||||||
|
|
||||||
|
addMarkerParams.id = markerParams.value.id
|
||||||
|
const { data: result } = await addMarkerApi(addMarkerParams)
|
||||||
|
|
||||||
|
if (result.code == 200) {
|
||||||
|
message.success('修改点位成功')
|
||||||
|
onHandleCloseAddModal()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue