+
@@ -1077,15 +1078,15 @@ const rotateEnd = (angle, item, index) => {
//节点选中
const editNodePropertiesRef = ref()
const activatedHandle = (item, index) => {
- state.currentItemIndex = index
+ if (toolbarSwitchType.value === 'editRoute') return
+ state.currentItemIndex = index
//让路线不选中
state.selectedCurve = ''
if (state.mapRouteList.length > 0 && state.currentDragTarget.index !== null) {
state.mapRouteList[state.currentDragTarget.index].isSelected = false
state.currentDragTarget = { index: null, type: null }
}
-
//显示出可走路线
state.isCanTakeRoutes = state.mapRouteList.forEach((route) => {
if (
@@ -1097,7 +1098,6 @@ const activatedHandle = (item, index) => {
route.isSelected = false
}
})
-
//节点编辑
if (toolbarSwitchType.value === 'editNode' && item.type !== 7) {
let list = state.allMapPointInfo.filter((item) => item.type === 3)
@@ -1654,7 +1654,8 @@ const toolbarClick = async (item) => {
toolbarSwitchType.value === 'drawRoute' ||
toolbarSwitchType.value === 'createLineLibrary' ||
toolbarSwitchType.value === 'createRegion' ||
- toolbarSwitchType.value === 'bulkDelete'
+ toolbarSwitchType.value === 'bulkDelete' ||
+ toolbarSwitchType.value === 'editRoute'
) {
state.prohibitedOperation = true
} else {
@@ -1839,6 +1840,7 @@ const toolbarClick = async (item) => {
break
case 'editRoute':
// 编辑路线
+
break
case 'equipment':
// 设备
diff --git a/src/views/mapPage/realTimeMap/index.vue b/src/views/mapPage/realTimeMap/index.vue
index 63ae3a02..12be6ea2 100644
--- a/src/views/mapPage/realTimeMap/index.vue
+++ b/src/views/mapPage/realTimeMap/index.vue
@@ -10,7 +10,12 @@
新建任务
地图编辑
- 一键急停
+
+ 一键急停
+
+
+ 一键恢复
+
@@ -36,13 +41,16 @@ import * as MapApi from '@/api/map/map'
import download from '@/utils/download'
import { ElMessage, ElMessageBox } from 'element-plus'
+defineOptions({ name: 'MapPageRealTimeMap' })
+
const message = useMessage() // 消息弹窗
const route = useRoute()
const { push } = useRouter()
-defineOptions({ name: 'MapPageRealTimeMap' })
+
const mapValue = ref([])
const list = ref([])
const indexPageRef = ref(null)
+const stopOrRestore = ref(0) // 地图暂停/恢复 (0:未暂停, 1:暂停)
const downAgv = async () => {
const data = await MapApi.agvDownload()
@@ -112,7 +120,6 @@ const getList = async () => {
}
})
}
-
list.value = mapList
if (query.mapId) {
@@ -126,6 +133,8 @@ const getList = async () => {
mapValue.value = [list.value[0].value, list.value[0].children[0].value]
indexPageRef.value.getMapData(JSON.parse(JSON.stringify(list.value[0].children[0])))
}
+
+ await getStopOrRestore()
}
const handleChangeMap = async (e) => {
let item = findChildrenByValues(list.value, e)
@@ -157,7 +166,30 @@ const createTask = async () => {
}
//一键急停
-const emergencyStop = () => {}
+const emergencyStop = async () => {
+ await getStopOrRestore()
+ let res = await MapApi.emergencyStopOrRecovery({
+ id: mapValue.value[1],
+ type: stopOrRestore.value === 0 ? 1 : 0
+ })
+ if (res === true) {
+ message.success('操作成功')
+ await getStopOrRestore()
+ }
+}
+
+const getStopOrRestore = async () => {
+ let res = await MapApi.getMapIsStop({
+ id: mapValue.value[1]
+ })
+ if (res && res.length > 0) {
+ //暂停状态
+ stopOrRestore.value = 1
+ } else {
+ //正常状态
+ stopOrRestore.value = 0
+ }
+}
//地图编辑
const router = useRouter() // 路由