生成库位检测点

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(() => {
if (document.hidden) return //
getRobotByFloorAndAreaList()
}, 10000)
}, 20000)
//
document.addEventListener('visibilitychange', () => {

View File

@ -449,6 +449,7 @@
v-if="imgBgObj.width && imgBgObj.height"
>
<!-- <map-scale-tool :stepLength="50" :width="imgBgObj.width" :height="imgBgObj.height"> -->
<!-- transform: `scale(${state.imageChangeMultiple}) rotate(-5deg)`, -->
<div
class="map-bg"
:style="{
@ -1317,7 +1318,7 @@ const mapClick = (e) => {
locationWidePx: 8,
angle: 0,
draggable: true,
resizable: true,
resizable: false,
rotatable: false,
lockAspectRatio: false,
mapImageUrl: '',
@ -2144,53 +2145,100 @@ const deleteSingleNode = () => {
}
//
const generateDetectionPoint = () => {
const generateDetectionPoint = async () => {
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 angle = radian * (180 / Math.PI)
const angle = locationYaw * (180 / Math.PI)
//
// 090西180-90
const newX = Number((Number(locationX) + distance * Math.cos(radian)).toFixed(2))
const newY = Number((Number(locationY) - distance * Math.sin(radian)).toFixed(2))
const newX = Number((Number(locationX) + distance * Math.cos(locationYaw)).toFixed(2))
const newY = Number((Number(locationY) - distance * Math.sin(locationYaw)).toFixed(2))
let actualPoint = disposeEventPoint(newX, newY)
//,
const isDuplicate = state.allMapPointInfo.some(
(item) =>
Number(item.locationX).toFixed(1) === Number(newX).toFixed(1) &&
Number(item.locationY).toFixed(1) === Number(newY).toFixed(1)
)
let pointItem = {
positionMapId: imgBgObj.positionMapId,
layerSelectionShow: true,
locationX: newX,
locationY: newY,
actualLocationX: actualPoint.actualLocationX,
actualLocationY: actualPoint.actualLocationY,
locationDeep: 40,
locationWide: 40,
locationDeepPx: 8,
locationWidePx: 8,
angle: 0,
draggable: true,
resizable: true,
rotatable: false,
lockAspectRatio: false,
mapImageUrl: '',
locationYaw: 0,
type: 1,
dataList: [],
dataObj: {}
if (!isDuplicate) {
let actualPoint = disposeEventPoint(newX, newY)
let pointItem = {
id: newId,
positionMapId: imgBgObj.positionMapId,
layerSelectionShow: true,
locationX: newX,
locationY: newY,
actualLocationX: actualPoint.actualLocationX,
actualLocationY: actualPoint.actualLocationY,
locationDeep: 40,
locationWide: 40,
locationDeepPx: 8,
locationWidePx: 8,
angle: 0,
draggable: true,
resizable: false,
rotatable: false,
lockAspectRatio: false,
mapImageUrl: '',
locationYaw: 0,
type: 1,
dataList: [],
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.mapRouteList.push(newRoute)
addEditHistory()
//
hideContextMenu()
} else {
message.warning('该点已存在')
}
//
state.allMapPointInfo.push(pointItem)
addEditHistory()
//
hideContextMenu()
}
//
@ -2318,7 +2366,7 @@ const entryActualNodeFormSubmit = () => {
locationWidePx: 8,
angle: 0,
draggable: true,
resizable: true,
resizable: false,
rotatable: false,
lockAspectRatio: false, //
mapImageUrl: '',
@ -2446,7 +2494,7 @@ const markFormSubmit = async () => {
locationWidePx: 8,
angle: 0,
draggable: true,
resizable: true,
resizable: false,
rotatable: false,
lockAspectRatio: false, //
mapImageUrl: '',
@ -3299,7 +3347,7 @@ const handleChooseRoute = async (item, index, type, e) => {
locationWidePx: 8,
angle: 0,
draggable: true,
resizable: true,
resizable: false,
rotatable: false,
lockAspectRatio: false, //
mapImageUrl: '',