diff --git a/src/api/car/index.ts b/src/api/car/index.ts index 1a7cfc45..f8234857 100644 --- a/src/api/car/index.ts +++ b/src/api/car/index.ts @@ -74,3 +74,7 @@ export const doTaskContinue = async (data) => { export const stopCar = async (data) => { return await request.post({ url: `/system/robot/information/stopRobot?robotNo=${data.robotNo}`, data }) } +// 恢复车辆 +export const recoveryCar = async (data) => { + return await request.post({ url: `/system/robot/information/continueRobot?robotNo=${data.robotNo}`, data }) +} diff --git a/src/views/board/carBoard/index.vue b/src/views/board/carBoard/index.vue index aead7e93..eb76ed91 100644 --- a/src/views/board/carBoard/index.vue +++ b/src/views/board/carBoard/index.vue @@ -162,6 +162,12 @@ v-hasPermi="['carBoard:index:stop']" >暂停车辆 + 恢复车辆 @@ -471,9 +477,29 @@ const stopCar = (robotNo) => { }) .then(() => { CarApi.stopCar({ robotNo }).then((res) => { - getCarList() - fetchData() - message.success('暂停成功') + if(res){ + getCarList() + fetchData() + message.success('暂停成功') + } + }) + }) + .catch(() => {}) +} +// 恢复车辆 +const recoveryCar = (robotNo) => { + ElMessageBox.confirm('您确定要恢复车辆吗?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }) + .then(() => { + CarApi.recoveryCar({ robotNo }).then((res) => { + if(res){ + getCarList() + fetchData() + message.success('恢复成功') + } }) }) .catch(() => {})