巡视任务页面优化
This commit is contained in:
parent
1f97edd413
commit
6e407d15cd
|
|
@ -620,12 +620,19 @@ const handleChangeMap = (value) => {
|
||||||
// 途径点的change事件
|
// 途径点的change事件
|
||||||
const handleChangePointName = (event, index) => {
|
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) {
|
if (event) {
|
||||||
const isRepeat = routeList.value.some((item) => item.pointId == event)
|
const isRepeat = routeList.value.some((item) => item.pointId == event)
|
||||||
if (isRepeat) {
|
if (isRepeat && routeList.value[index].pointId !== event) {
|
||||||
message.warning('该点位已存在,不可重复添加')
|
message.warning('该点位已存在,不可重复添加')
|
||||||
routeList.value.splice(index, 1)
|
routeList.value[index].pointName = null
|
||||||
|
// routeList.value.splice(index, 1)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -640,7 +647,7 @@ const handleChangePointName = (event, index) => {
|
||||||
routeList.value[index].ptzy = ptzy
|
routeList.value[index].ptzy = ptzy
|
||||||
routeList.value[index].ptzz = ptzz
|
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 svgRect = svgMapRef.value.getBoundingClientRect()
|
||||||
const clientY = svgHeight.value - yScale.value * Robot_y + svgRect.top
|
const clientY = svgHeight.value - yScale.value * Robot_y + svgRect.top
|
||||||
const logicalY1 = (clientY - svgRect.top) / yScale.value
|
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) {
|
if (devicePoints.value.length > 1) {
|
||||||
animatePath()
|
animatePath()
|
||||||
|
|
@ -1000,6 +1007,8 @@ watch(
|
||||||
routeList.value[index].interval = item.actions[0].interval
|
routeList.value[index].interval = item.actions[0].interval
|
||||||
routeList.value[index].actionType = item.actions[0].type
|
routeList.value[index].actionType = item.actions[0].type
|
||||||
}
|
}
|
||||||
|
|
||||||
|
markPoints(item.x, item.y, item.positionId, index)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue