一键急停和一键恢复
This commit is contained in:
parent
9cec9dacb1
commit
4c72a79c9c
@ -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
|
||||
|
@ -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
@ -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':
|
||||
// 设备
|
||||
|
@ -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() // 路由
|
||||
|
Loading…
Reference in New Issue
Block a user