巡视任务页面优化

This commit is contained in:
BianLzhaoMin 2025-07-01 10:54:12 +08:00
parent 1f97edd413
commit 6e407d15cd
1 changed files with 15 additions and 6 deletions

View File

@ -620,12 +620,19 @@ const handleChangeMap = (value) => {
// change
const handleChangePointName = (event, index) => {
//
if (!event) return
if (!event) {
routeList.value[index].pointName = null
routeList.value[index].pointId = null
routeList.value[index].theta = null
devicePoints.value.splice(index, 1)
return
}
if (event) {
const isRepeat = routeList.value.some((item) => item.pointId == event)
if (isRepeat) {
if (isRepeat && routeList.value[index].pointId !== event) {
message.warning('该点位已存在,不可重复添加')
routeList.value.splice(index, 1)
routeList.value[index].pointName = null
// routeList.value.splice(index, 1)
return
}
@ -640,7 +647,7 @@ const handleChangePointName = (event, index) => {
routeList.value[index].ptzy = ptzy
routeList.value[index].ptzz = ptzz
markPoints(positionX, positionY, pointInfo?.value)
markPoints(positionX, positionY, pointInfo?.value, index)
}
}
@ -789,11 +796,11 @@ const getRobotId = async (puId) => {
}
//
const markPoints = (Robot_x, Robot_y, pointId) => {
const markPoints = (Robot_x, Robot_y, pointId, index) => {
const svgRect = svgMapRef.value.getBoundingClientRect()
const clientY = svgHeight.value - yScale.value * Robot_y + svgRect.top
const logicalY1 = (clientY - svgRect.top) / yScale.value
devicePoints.value.push({ x: Robot_x, y: logicalY1, pointId })
devicePoints.value[index] = { x: Robot_x, y: logicalY1, pointId }
if (devicePoints.value.length > 1) {
animatePath()
@ -1000,6 +1007,8 @@ watch(
routeList.value[index].interval = item.actions[0].interval
routeList.value[index].actionType = item.actions[0].type
}
markPoints(item.x, item.y, item.positionId, index)
})
}
})