Compare commits
2 Commits
f8abe2f791
...
945708ccc9
Author | SHA1 | Date | |
---|---|---|---|
![]() |
945708ccc9 | ||
![]() |
9e0b8f11f4 |
@ -180,9 +180,7 @@
|
|||||||
v-if="item.robotCodeLevel == 1"
|
v-if="item.robotCodeLevel == 1"
|
||||||
>
|
>
|
||||||
<template #content>
|
<template #content>
|
||||||
<span style="font-size: 14px; color: #fff"
|
<span style="font-size: 14px; color: #fff">{{ item.robotCodeMsg || '' }} </span>
|
||||||
>{{ item.robotCodeMsg || '' }}
|
|
||||||
</span>
|
|
||||||
<span
|
<span
|
||||||
style="cursor: pointer; margin-left: 24px; color: #ff4d4f; font-size: 14px"
|
style="cursor: pointer; margin-left: 24px; color: #ff4d4f; font-size: 14px"
|
||||||
@click="goMoreError(item)"
|
@click="goMoreError(item)"
|
||||||
@ -199,9 +197,7 @@
|
|||||||
v-if="item.robotCodeLevel == 2"
|
v-if="item.robotCodeLevel == 2"
|
||||||
>
|
>
|
||||||
<template #content>
|
<template #content>
|
||||||
<span style="font-size: 14px; color: #fff"
|
<span style="font-size: 14px; color: #fff">{{ item.robotCodeMsg || '' }} </span>
|
||||||
>{{ item.robotCodeMsg || '' }}
|
|
||||||
</span>
|
|
||||||
<span
|
<span
|
||||||
style="cursor: pointer; margin-left: 24px; color: #ff4d4f; font-size: 14px"
|
style="cursor: pointer; margin-left: 24px; color: #ff4d4f; font-size: 14px"
|
||||||
@click="goMoreError(item)"
|
@click="goMoreError(item)"
|
||||||
@ -218,9 +214,7 @@
|
|||||||
v-if="item.robotCodeLevel == 3"
|
v-if="item.robotCodeLevel == 3"
|
||||||
>
|
>
|
||||||
<template #content>
|
<template #content>
|
||||||
<span style="font-size: 14px; color: #fff"
|
<span style="font-size: 14px; color: #fff">{{ item.robotCodeMsg || '' }} </span>
|
||||||
>{{ item.robotCodeMsg || '' }}
|
|
||||||
</span>
|
|
||||||
<span
|
<span
|
||||||
style="cursor: pointer; margin-left: 24px; color: #ff4d4f; font-size: 14px"
|
style="cursor: pointer; margin-left: 24px; color: #ff4d4f; font-size: 14px"
|
||||||
@click="goMoreError(item)"
|
@click="goMoreError(item)"
|
||||||
@ -237,9 +231,7 @@
|
|||||||
v-if="item.robotCodeLevel == 4"
|
v-if="item.robotCodeLevel == 4"
|
||||||
>
|
>
|
||||||
<template #content>
|
<template #content>
|
||||||
<span style="font-size: 14px; color: #fff"
|
<span style="font-size: 14px; color: #fff">{{ item.robotCodeMsg || '' }} </span>
|
||||||
>{{ item.robotCodeMsg || '' }}
|
|
||||||
</span>
|
|
||||||
<span
|
<span
|
||||||
style="cursor: pointer; margin-left: 24px; color: #ff4d4f; font-size: 14px"
|
style="cursor: pointer; margin-left: 24px; color: #ff4d4f; font-size: 14px"
|
||||||
@click="goMoreError(item)"
|
@click="goMoreError(item)"
|
||||||
@ -351,7 +343,6 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import JSONBigInt from 'json-bigint'
|
|
||||||
import { ref, reactive, onMounted, onBeforeUnmount } from 'vue'
|
import { ref, reactive, onMounted, onBeforeUnmount } from 'vue'
|
||||||
import * as CarApi from '@/api/car/index'
|
import * as CarApi from '@/api/car/index'
|
||||||
import { onBeforeRouteLeave, onBeforeRouteUpdate } from 'vue-router'
|
import { onBeforeRouteLeave, onBeforeRouteUpdate } from 'vue-router'
|
||||||
@ -479,14 +470,14 @@ const stopCar = (robotNo) => {
|
|||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
CarApi.stopCar({ robotNo }).then((res) => {
|
CarApi.stopCar({ robotNo }).then((res) => {
|
||||||
getCarList()
|
getCarList()
|
||||||
fetchData()
|
fetchData()
|
||||||
message.success('暂停成功')
|
message.success('暂停成功')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch(() => {})
|
||||||
}
|
}
|
||||||
|
|
||||||
const changeRobotStatisticsType = (type) => {
|
const changeRobotStatisticsType = (type) => {
|
||||||
@ -700,9 +691,7 @@ onBeforeRouteLeave((to, from, next) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.new-top-box-left-title {
|
.new-top-box-left-title {
|
||||||
font-family:
|
font-family: PingFangSC, 'PingFang SC';
|
||||||
PingFangSC,
|
|
||||||
"PingFang SC";
|
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
color: #0d162a;
|
color: #0d162a;
|
||||||
@ -711,9 +700,7 @@ onBeforeRouteLeave((to, from, next) => {
|
|||||||
.new-top-box-left-statistics {
|
.new-top-box-left-statistics {
|
||||||
padding: 5px 7px;
|
padding: 5px 7px;
|
||||||
margin-left: 4px;
|
margin-left: 4px;
|
||||||
font-family:
|
font-family: PingFangSC, 'PingFang SC';
|
||||||
PingFangSC,
|
|
||||||
"PingFang SC";
|
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
color: #0d162a;
|
color: #0d162a;
|
||||||
@ -732,9 +719,7 @@ onBeforeRouteLeave((to, from, next) => {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
font-family:
|
font-family: PingFangSC, 'PingFang SC';
|
||||||
PingFangSC,
|
|
||||||
"PingFang SC";
|
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
padding: 5px 10px;
|
padding: 5px 10px;
|
||||||
@ -809,9 +794,7 @@ input::input-placeholder {
|
|||||||
.item-inner-left-name {
|
.item-inner-left-name {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
font-family:
|
font-family: PingFangSC, 'PingFang SC';
|
||||||
PingFangSC,
|
|
||||||
"PingFang SC";
|
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
width: 0;
|
width: 0;
|
||||||
@ -837,9 +820,7 @@ input::input-placeholder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.item-inner-left-bottom-btn {
|
.item-inner-left-bottom-btn {
|
||||||
font-family:
|
font-family: PingFangSC, 'PingFang SC';
|
||||||
PingFangSC,
|
|
||||||
"PingFang SC";
|
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #1677ff;
|
color: #1677ff;
|
||||||
@ -882,9 +863,7 @@ input::input-placeholder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.item-inner-right-msg-item-name {
|
.item-inner-right-msg-item-name {
|
||||||
font-family:
|
font-family: PingFangSC, 'PingFang SC';
|
||||||
PingFangSC,
|
|
||||||
"PingFang SC";
|
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
width: 60px;
|
width: 60px;
|
||||||
|
@ -966,6 +966,7 @@
|
|||||||
@click.stop
|
@click.stop
|
||||||
>
|
>
|
||||||
<div class="context-menu-item" @click="deleteSingleNode">删除</div>
|
<div class="context-menu-item" @click="deleteSingleNode">删除</div>
|
||||||
|
<div class="context-menu-item" @click="contextMenuEditNode">编辑节点</div>
|
||||||
<div
|
<div
|
||||||
class="context-menu-item"
|
class="context-menu-item"
|
||||||
@click="generateDetectionPoint"
|
@click="generateDetectionPoint"
|
||||||
@ -1233,6 +1234,7 @@ const activatedHandle = (item, index) => {
|
|||||||
editNodePropertiesRef.value.open(JSON.parse(JSON.stringify(item)), list)
|
editNodePropertiesRef.value.open(JSON.parse(JSON.stringify(item)), list)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//非选中
|
//非选中
|
||||||
const deactivatedHandle = () => {}
|
const deactivatedHandle = () => {}
|
||||||
|
|
||||||
@ -2126,7 +2128,7 @@ const hideContextMenu = () => {
|
|||||||
state.contextMenu.currentIndex = -1
|
state.contextMenu.currentIndex = -1
|
||||||
}
|
}
|
||||||
|
|
||||||
//删除
|
//右击删除
|
||||||
const deleteSingleNode = () => {
|
const deleteSingleNode = () => {
|
||||||
if (state.contextMenu.currentIndex !== -1) {
|
if (state.contextMenu.currentIndex !== -1) {
|
||||||
let deleteId = state.allMapPointInfo[state.contextMenu.currentIndex].id
|
let deleteId = state.allMapPointInfo[state.contextMenu.currentIndex].id
|
||||||
@ -2144,14 +2146,32 @@ const deleteSingleNode = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//右击编辑
|
||||||
|
const contextMenuEditNode = () => {
|
||||||
|
if (state.contextMenu.currentItem.type !== 7) {
|
||||||
|
let list = state.allMapPointInfo.filter((item) => item.type === 3)
|
||||||
|
removeEventListener() //移除监听
|
||||||
|
editNodePropertiesRef.value.open(
|
||||||
|
JSON.parse(JSON.stringify(state.contextMenu.currentItem)),
|
||||||
|
list
|
||||||
|
)
|
||||||
|
// 隐藏右击菜单
|
||||||
|
hideContextMenu()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//生成检测点
|
//生成检测点
|
||||||
const generateDetectionPoint = async () => {
|
const generateDetectionPoint = async () => {
|
||||||
if (state.contextMenu.currentIndex === -1) return
|
if (state.contextMenu.currentIndex === -1) return
|
||||||
|
if (!state.contextMenu.currentItem.id) {
|
||||||
|
return message.warning('该库位未保存')
|
||||||
|
}
|
||||||
|
|
||||||
const { locationX, locationY, locationYaw } = state.contextMenu.currentItem
|
const { locationX, locationY, locationYaw, id, actualLocationX, actualLocationY } =
|
||||||
|
state.contextMenu.currentItem
|
||||||
|
|
||||||
const newId = await MapApi.getNodeId()
|
const newId = await MapApi.getNodeId()
|
||||||
const distance = 1 / Number(imgBgObj.resolution) //距离米
|
const distance = 2 / Number(imgBgObj.resolution) //距离米
|
||||||
|
|
||||||
// 将弧度转换为角度(用于理解,实际计算仍使用弧度)
|
// 将弧度转换为角度(用于理解,实际计算仍使用弧度)
|
||||||
const angle = locationYaw * (180 / Math.PI)
|
const angle = locationYaw * (180 / Math.PI)
|
||||||
@ -2170,6 +2190,7 @@ const generateDetectionPoint = async () => {
|
|||||||
|
|
||||||
if (!isDuplicate) {
|
if (!isDuplicate) {
|
||||||
let actualPoint = disposeEventPoint(newX, newY)
|
let actualPoint = disposeEventPoint(newX, newY)
|
||||||
|
//检测点
|
||||||
let pointItem = {
|
let pointItem = {
|
||||||
id: newId,
|
id: newId,
|
||||||
positionMapId: imgBgObj.positionMapId,
|
positionMapId: imgBgObj.positionMapId,
|
||||||
@ -2194,19 +2215,19 @@ const generateDetectionPoint = async () => {
|
|||||||
dataObj: {}
|
dataObj: {}
|
||||||
}
|
}
|
||||||
|
|
||||||
//生成监测点和库位之间的路线 不确定开始点是库位还是检测点
|
//生成监测点和库位之间的路线 这里把监测点当开始点 库位当结束点
|
||||||
let newRoute = {
|
let newRoute = {
|
||||||
isSelected: false,
|
isSelected: false,
|
||||||
startingPointId: undefined,
|
startingPointId: newId,
|
||||||
endPointId: undefined,
|
endPointId: id,
|
||||||
startPointX: undefined,
|
startPointX: newX,
|
||||||
startPointY: undefined,
|
startPointY: newY,
|
||||||
endPointX: undefined,
|
actualStartPointX: actualPoint.actualLocationX,
|
||||||
endPointY: undefined,
|
actualStartPointY: actualPoint.actualLocationY,
|
||||||
actualStartPointX: undefined,
|
endPointX: locationX,
|
||||||
actualStartPointY: undefined,
|
endPointY: locationY,
|
||||||
actualEndPointX: undefined,
|
actualEndPointX: actualLocationX,
|
||||||
actualEndPointY: undefined,
|
actualEndPointY: actualLocationY,
|
||||||
actualBeginControlX: '',
|
actualBeginControlX: '',
|
||||||
actualBeginControlY: '',
|
actualBeginControlY: '',
|
||||||
actualEndControlX: '',
|
actualEndControlX: '',
|
||||||
@ -2221,17 +2242,19 @@ const generateDetectionPoint = async () => {
|
|||||||
expansionZoneRight: 0,
|
expansionZoneRight: 0,
|
||||||
method: 0,
|
method: 0,
|
||||||
direction: 2, //1单2双
|
direction: 2, //1单2双
|
||||||
forwardSpeedLimit: 1.5,
|
forwardSpeedLimit: 0.4,
|
||||||
reverseSpeedLimit: 0.4,
|
reverseSpeedLimit: 0.2,
|
||||||
toward: 0,
|
toward: 0,
|
||||||
startingSortNum: undefined,
|
startingSortNum: undefined,
|
||||||
endPointSortNum: undefined
|
endPointSortNum: undefined,
|
||||||
|
startToEndToward: 1, //开始点到结束点
|
||||||
|
endToStartToward: 0 //结束点到开始点
|
||||||
}
|
}
|
||||||
|
|
||||||
// 将新创建的点添加到地图点列表中
|
// 将新创建的点添加到地图点列表中
|
||||||
state.allMapPointInfo.push(pointItem)
|
state.allMapPointInfo.push(pointItem)
|
||||||
//将路线加入到路线列表中
|
//将路线加入到路线列表中
|
||||||
// state.mapRouteList.push(newRoute)
|
state.mapRouteList.push(newRoute)
|
||||||
|
|
||||||
addEditHistory()
|
addEditHistory()
|
||||||
// 隐藏右击菜单
|
// 隐藏右击菜单
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
class="!w-220px"
|
class="!w-220px"
|
||||||
v-model="formData.montageNumber"
|
v-model="formData.montageNumber"
|
||||||
:min="1"
|
:min="1"
|
||||||
:max="10"
|
:max="100"
|
||||||
@change="montageNumberChange"
|
@change="montageNumberChange"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
Loading…
Reference in New Issue
Block a user