diff --git a/src/api/car/index.ts b/src/api/car/index.ts index 0261bef2..a1100d59 100644 --- a/src/api/car/index.ts +++ b/src/api/car/index.ts @@ -61,3 +61,12 @@ export const robotPositionGetMapAllNew = async (params) => { export const getRobotInformationList = async (params) => { return await request.get({ url: `/system/robot/information/list`, params }) } + +// 清除交管 +export const cleanTrafficManagement = async (data) => { + return await request.post({ url: `/system/robot/information/cleanTrafficManagement?robotNo=${data.robotNo}`, data }) +} +// 恢复任务 +export const doTaskContinue = async (data) => { + return await request.post({ url: `/system/robot/information/doTaskContinue?robotNo=${data.robotNo}`, data }) +} diff --git a/src/views/board/carBoard/index.vue b/src/views/board/carBoard/index.vue index 2845f639..c290ae78 100644 --- a/src/views/board/carBoard/index.vue +++ b/src/views/board/carBoard/index.vue @@ -136,6 +136,8 @@ item.robotTaskModel == 0 ? '解锁' : '锁定' }} 删除 + 清除交管 + 恢复任务 @@ -399,6 +401,44 @@ const goMoreError = (item) => { }) } +//清除交管 +const clearCar = (robotNo) => { + ElMessageBox.confirm('您确定要清除交管吗?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }) + .then(() => { + CarApi.cleanTrafficManagement({robotNo}).then((res) => { + getCarList() + getRobotInformationStatistics() + message.success('清除成功') + }) + }) + .catch(() => { + + }) +} + +// 恢复任务 +const recoveryTask = (robotNo) => { + ElMessageBox.confirm('您确定要恢复任务吗?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }) + .then(() => { + CarApi.doTaskContinue({robotNo}).then((res) => { + getCarList() + getRobotInformationStatistics() + message.success('恢复成功') + }) + }) + .catch(() => { + + }) + } + const changeRobotStatisticsType = (type) => { queryParams.robotStatisticsType = type getCarList()