生成库位检测点

This commit is contained in:
yyy 2025-06-26 18:20:18 +08:00
parent cd75476893
commit ceee6eb86e
2 changed files with 88 additions and 40 deletions

View File

@ -881,7 +881,7 @@ onMounted(() => {
robotListTimerRef.value = setInterval(() => { robotListTimerRef.value = setInterval(() => {
if (document.hidden) return // if (document.hidden) return //
getRobotByFloorAndAreaList() getRobotByFloorAndAreaList()
}, 10000) }, 20000)
// //
document.addEventListener('visibilitychange', () => { document.addEventListener('visibilitychange', () => {

View File

@ -449,6 +449,7 @@
v-if="imgBgObj.width && imgBgObj.height" v-if="imgBgObj.width && imgBgObj.height"
> >
<!-- <map-scale-tool :stepLength="50" :width="imgBgObj.width" :height="imgBgObj.height"> --> <!-- <map-scale-tool :stepLength="50" :width="imgBgObj.width" :height="imgBgObj.height"> -->
<!-- transform: `scale(${state.imageChangeMultiple}) rotate(-5deg)`, -->
<div <div
class="map-bg" class="map-bg"
:style="{ :style="{
@ -1317,7 +1318,7 @@ const mapClick = (e) => {
locationWidePx: 8, locationWidePx: 8,
angle: 0, angle: 0,
draggable: true, draggable: true,
resizable: true, resizable: false,
rotatable: false, rotatable: false,
lockAspectRatio: false, lockAspectRatio: false,
mapImageUrl: '', mapImageUrl: '',
@ -2144,25 +2145,33 @@ const deleteSingleNode = () => {
} }
// //
const generateDetectionPoint = () => { const generateDetectionPoint = async () => {
if (state.contextMenu.currentIndex === -1) return if (state.contextMenu.currentIndex === -1) return
const { locationX, locationY } = state.contextMenu.currentItem const { locationX, locationY, locationYaw } = state.contextMenu.currentItem
const radian = 1.57 // const newId = await MapApi.getNodeId()
const distance = 1 / Number(imgBgObj.resolution) // const distance = 1 / Number(imgBgObj.resolution) //
// 使 // 使
const angle = radian * (180 / Math.PI) const angle = locationYaw * (180 / Math.PI)
// //
// 090西180-90 // 090西180-90
const newX = Number((Number(locationX) + distance * Math.cos(radian)).toFixed(2)) const newX = Number((Number(locationX) + distance * Math.cos(locationYaw)).toFixed(2))
const newY = Number((Number(locationY) - distance * Math.sin(radian)).toFixed(2)) const newY = Number((Number(locationY) - distance * Math.sin(locationYaw)).toFixed(2))
//,
const isDuplicate = state.allMapPointInfo.some(
(item) =>
Number(item.locationX).toFixed(1) === Number(newX).toFixed(1) &&
Number(item.locationY).toFixed(1) === Number(newY).toFixed(1)
)
if (!isDuplicate) {
let actualPoint = disposeEventPoint(newX, newY) let actualPoint = disposeEventPoint(newX, newY)
let pointItem = { let pointItem = {
id: newId,
positionMapId: imgBgObj.positionMapId, positionMapId: imgBgObj.positionMapId,
layerSelectionShow: true, layerSelectionShow: true,
locationX: newX, locationX: newX,
@ -2175,7 +2184,7 @@ const generateDetectionPoint = () => {
locationWidePx: 8, locationWidePx: 8,
angle: 0, angle: 0,
draggable: true, draggable: true,
resizable: true, resizable: false,
rotatable: false, rotatable: false,
lockAspectRatio: false, lockAspectRatio: false,
mapImageUrl: '', mapImageUrl: '',
@ -2185,12 +2194,51 @@ const generateDetectionPoint = () => {
dataObj: {} dataObj: {}
} }
//线
let newRoute = {
isSelected: false,
startingPointId: undefined,
endPointId: undefined,
startPointX: undefined,
startPointY: undefined,
endPointX: undefined,
endPointY: undefined,
actualStartPointX: undefined,
actualStartPointY: undefined,
actualEndPointX: undefined,
actualEndPointY: undefined,
actualBeginControlX: '',
actualBeginControlY: '',
actualEndControlX: '',
actualEndControlY: '',
beginControlX: 0,
beginControlY: 0,
endControlX: 0,
endControlY: 0,
expansionZoneFront: 0,
expansionZoneAfter: 0,
expansionZoneLeft: 0,
expansionZoneRight: 0,
method: 0,
direction: 2, //12
forwardSpeedLimit: 1.5,
reverseSpeedLimit: 0.4,
toward: 0,
startingSortNum: undefined,
endPointSortNum: undefined
}
// //
state.allMapPointInfo.push(pointItem) state.allMapPointInfo.push(pointItem)
//线线
// state.mapRouteList.push(newRoute)
addEditHistory() addEditHistory()
// //
hideContextMenu() hideContextMenu()
} else {
message.warning('该点已存在')
}
} }
// //
@ -2318,7 +2366,7 @@ const entryActualNodeFormSubmit = () => {
locationWidePx: 8, locationWidePx: 8,
angle: 0, angle: 0,
draggable: true, draggable: true,
resizable: true, resizable: false,
rotatable: false, rotatable: false,
lockAspectRatio: false, // lockAspectRatio: false, //
mapImageUrl: '', mapImageUrl: '',
@ -2446,7 +2494,7 @@ const markFormSubmit = async () => {
locationWidePx: 8, locationWidePx: 8,
angle: 0, angle: 0,
draggable: true, draggable: true,
resizable: true, resizable: false,
rotatable: false, rotatable: false,
lockAspectRatio: false, // lockAspectRatio: false, //
mapImageUrl: '', mapImageUrl: '',
@ -3299,7 +3347,7 @@ const handleChooseRoute = async (item, index, type, e) => {
locationWidePx: 8, locationWidePx: 8,
angle: 0, angle: 0,
draggable: true, draggable: true,
resizable: true, resizable: false,
rotatable: false, rotatable: false,
lockAspectRatio: false, // lockAspectRatio: false, //
mapImageUrl: '', mapImageUrl: '',