一键急停和一键恢复

This commit is contained in:
yyy 2025-04-17 11:18:21 +08:00
parent 9cec9dacb1
commit 4c72a79c9c
5 changed files with 58 additions and 3195 deletions

View File

@ -4,9 +4,9 @@ NODE_ENV=development
VITE_DEV=true
# 请求路径
# VITE_BASE_URL='http://192.168.0.74:48080'
VITE_BASE_URL='http://192.168.0.74:48080'
# VITE_BASE_URL='http://192.168.0.153:48080'
VITE_BASE_URL='http://192.168.0.45:48080'
# VITE_BASE_URL='http://192.168.0.45:48080'
# 文件上传类型server - 后端上传, client - 前端直连上传,仅支持 S3 服务
VITE_UPLOAD_TYPE=server

View File

@ -187,3 +187,17 @@ export const getNodeId = async () => {
url: `/system/position-map-item/getUUid`
})
}
//一键急停or一键恢复地图上所有AGV
export const emergencyStopOrRecovery = async (params) => {
return await request.get({
url: `/system/position-map/emergencyStopOrRecovery`,
params
})
}
// 根据地图id获取暂停的地图
export const getMapIsStop = async (params) => {
return await request.get({
url: `/system/robot/map-stop/getByMapId`,
params
})
}

File diff suppressed because it is too large Load Diff

View File

@ -363,6 +363,7 @@
>
<el-form-item label="路线宽度">
<el-select v-model="state.routeWidthForm.routeWidth" placeholder="选择">
<el-option label="1" :value="1" />
<el-option label="2" :value="2" />
<el-option label="3" :value="3" />
<el-option label="4" :value="4" />
@ -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':
//

View File

@ -10,7 +10,12 @@
<div class="line"></div>
<el-button @click="createTask" icon="CirclePlus" style="color: #536387"> 新建任务 </el-button>
<el-button @click="editMap" icon="EditPen" style="color: #536387">地图编辑</el-button>
<el-button type="danger" @click="emergencyStop" icon="Remove">一键急停</el-button>
<el-button type="danger" @click="emergencyStop" icon="Remove" v-if="stopOrRestore === 0">
一键急停
</el-button>
<el-button type="success" @click="emergencyStop" icon="Remove" v-if="stopOrRestore === 1">
一键恢复
</el-button>
</div>
<div class="main-content">
@ -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() //