一键急停和一键恢复
This commit is contained in:
parent
9cec9dacb1
commit
4c72a79c9c
@ -4,9 +4,9 @@ NODE_ENV=development
|
|||||||
VITE_DEV=true
|
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.153:48080'
|
||||||
VITE_BASE_URL='http://192.168.0.45:48080'
|
# VITE_BASE_URL='http://192.168.0.45:48080'
|
||||||
|
|
||||||
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
|
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
|
||||||
VITE_UPLOAD_TYPE=server
|
VITE_UPLOAD_TYPE=server
|
||||||
|
@ -187,3 +187,17 @@ export const getNodeId = async () => {
|
|||||||
url: `/system/position-map-item/getUUid`
|
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-form-item label="路线宽度">
|
||||||
<el-select v-model="state.routeWidthForm.routeWidth" placeholder="选择">
|
<el-select v-model="state.routeWidthForm.routeWidth" placeholder="选择">
|
||||||
|
<el-option label="1" :value="1" />
|
||||||
<el-option label="2" :value="2" />
|
<el-option label="2" :value="2" />
|
||||||
<el-option label="3" :value="3" />
|
<el-option label="3" :value="3" />
|
||||||
<el-option label="4" :value="4" />
|
<el-option label="4" :value="4" />
|
||||||
@ -1077,15 +1078,15 @@ const rotateEnd = (angle, item, index) => {
|
|||||||
//节点选中
|
//节点选中
|
||||||
const editNodePropertiesRef = ref()
|
const editNodePropertiesRef = ref()
|
||||||
const activatedHandle = (item, index) => {
|
const activatedHandle = (item, index) => {
|
||||||
state.currentItemIndex = index
|
if (toolbarSwitchType.value === 'editRoute') return
|
||||||
|
|
||||||
|
state.currentItemIndex = index
|
||||||
//让路线不选中
|
//让路线不选中
|
||||||
state.selectedCurve = ''
|
state.selectedCurve = ''
|
||||||
if (state.mapRouteList.length > 0 && state.currentDragTarget.index !== null) {
|
if (state.mapRouteList.length > 0 && state.currentDragTarget.index !== null) {
|
||||||
state.mapRouteList[state.currentDragTarget.index].isSelected = false
|
state.mapRouteList[state.currentDragTarget.index].isSelected = false
|
||||||
state.currentDragTarget = { index: null, type: null }
|
state.currentDragTarget = { index: null, type: null }
|
||||||
}
|
}
|
||||||
|
|
||||||
//显示出可走路线
|
//显示出可走路线
|
||||||
state.isCanTakeRoutes = state.mapRouteList.forEach((route) => {
|
state.isCanTakeRoutes = state.mapRouteList.forEach((route) => {
|
||||||
if (
|
if (
|
||||||
@ -1097,7 +1098,6 @@ const activatedHandle = (item, index) => {
|
|||||||
route.isSelected = false
|
route.isSelected = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
//节点编辑
|
//节点编辑
|
||||||
if (toolbarSwitchType.value === 'editNode' && item.type !== 7) {
|
if (toolbarSwitchType.value === 'editNode' && item.type !== 7) {
|
||||||
let list = state.allMapPointInfo.filter((item) => item.type === 3)
|
let list = state.allMapPointInfo.filter((item) => item.type === 3)
|
||||||
@ -1654,7 +1654,8 @@ const toolbarClick = async (item) => {
|
|||||||
toolbarSwitchType.value === 'drawRoute' ||
|
toolbarSwitchType.value === 'drawRoute' ||
|
||||||
toolbarSwitchType.value === 'createLineLibrary' ||
|
toolbarSwitchType.value === 'createLineLibrary' ||
|
||||||
toolbarSwitchType.value === 'createRegion' ||
|
toolbarSwitchType.value === 'createRegion' ||
|
||||||
toolbarSwitchType.value === 'bulkDelete'
|
toolbarSwitchType.value === 'bulkDelete' ||
|
||||||
|
toolbarSwitchType.value === 'editRoute'
|
||||||
) {
|
) {
|
||||||
state.prohibitedOperation = true
|
state.prohibitedOperation = true
|
||||||
} else {
|
} else {
|
||||||
@ -1839,6 +1840,7 @@ const toolbarClick = async (item) => {
|
|||||||
break
|
break
|
||||||
case 'editRoute':
|
case 'editRoute':
|
||||||
// 编辑路线
|
// 编辑路线
|
||||||
|
|
||||||
break
|
break
|
||||||
case 'equipment':
|
case 'equipment':
|
||||||
// 设备
|
// 设备
|
||||||
|
@ -10,7 +10,12 @@
|
|||||||
<div class="line"></div>
|
<div class="line"></div>
|
||||||
<el-button @click="createTask" icon="CirclePlus" style="color: #536387"> 新建任务 </el-button>
|
<el-button @click="createTask" icon="CirclePlus" style="color: #536387"> 新建任务 </el-button>
|
||||||
<el-button @click="editMap" icon="EditPen" 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>
|
||||||
|
|
||||||
<div class="main-content">
|
<div class="main-content">
|
||||||
@ -36,13 +41,16 @@ import * as MapApi from '@/api/map/map'
|
|||||||
import download from '@/utils/download'
|
import download from '@/utils/download'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
|
||||||
|
defineOptions({ name: 'MapPageRealTimeMap' })
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const { push } = useRouter()
|
const { push } = useRouter()
|
||||||
defineOptions({ name: 'MapPageRealTimeMap' })
|
|
||||||
const mapValue = ref([])
|
const mapValue = ref([])
|
||||||
const list = ref([])
|
const list = ref([])
|
||||||
const indexPageRef = ref(null)
|
const indexPageRef = ref(null)
|
||||||
|
const stopOrRestore = ref(0) // 地图暂停/恢复 (0:未暂停, 1:暂停)
|
||||||
|
|
||||||
const downAgv = async () => {
|
const downAgv = async () => {
|
||||||
const data = await MapApi.agvDownload()
|
const data = await MapApi.agvDownload()
|
||||||
@ -112,7 +120,6 @@ const getList = async () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
list.value = mapList
|
list.value = mapList
|
||||||
|
|
||||||
if (query.mapId) {
|
if (query.mapId) {
|
||||||
@ -126,6 +133,8 @@ const getList = async () => {
|
|||||||
mapValue.value = [list.value[0].value, list.value[0].children[0].value]
|
mapValue.value = [list.value[0].value, list.value[0].children[0].value]
|
||||||
indexPageRef.value.getMapData(JSON.parse(JSON.stringify(list.value[0].children[0])))
|
indexPageRef.value.getMapData(JSON.parse(JSON.stringify(list.value[0].children[0])))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await getStopOrRestore()
|
||||||
}
|
}
|
||||||
const handleChangeMap = async (e) => {
|
const handleChangeMap = async (e) => {
|
||||||
let item = findChildrenByValues(list.value, 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() // 路由
|
const router = useRouter() // 路由
|
||||||
|
Loading…
Reference in New Issue
Block a user