From 7f8259b287c2730ce24562df84a9b4a360ace798 Mon Sep 17 00:00:00 2001 From: lhy <1424913779@qq.com> Date: Mon, 30 Jun 2025 14:23:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=81=A2=E5=A4=8D=E8=BD=A6?= =?UTF-8?q?=E8=BE=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/car/index.ts | 4 ++++ src/views/board/carBoard/index.vue | 32 +++++++++++++++++++++++++++--- 2 files changed, 33 insertions(+), 3 deletions(-) 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(() => {})