From 284fce187356fb5c5b7d762a46678f749c93e1e7 Mon Sep 17 00:00:00 2001 From: xudan Date: Mon, 8 Dec 2025 11:18:11 +0800 Subject: [PATCH] =?UTF-8?q?feat(context-menu):=20=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E6=9C=BA=E5=99=A8=E4=BA=BA=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E9=99=90=E5=88=B6=E5=B9=B6=E8=B0=83=E6=95=B4=E5=AF=BC=E8=88=AA?= =?UTF-8?q?=E5=8F=82=E6=95=B0=EF=BC=8C=E5=B0=86=E6=9C=BA=E5=99=A8=E4=BA=BA?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E9=80=BB=E8=BE=91=E5=AE=8C=E5=85=A8=E4=BA=A4?= =?UTF-8?q?=E7=94=B1=E5=90=8E=E7=AB=AF=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/context-menu/point-menu.vue | 9 ++---- src/components/modal/robot-selector-modal.vue | 29 ++++--------------- .../context-menu/point-menu.service.ts | 2 +- 3 files changed, 9 insertions(+), 31 deletions(-) diff --git a/src/components/context-menu/point-menu.vue b/src/components/context-menu/point-menu.vue index 702cfec..2cf8416 100644 --- a/src/components/context-menu/point-menu.vue +++ b/src/components/context-menu/point-menu.vue @@ -114,7 +114,7 @@ const handleRobotSelected = async (data: { robot: RobotInfo; targetPointName: st const result = await executeNavigateToPoint( pointInfo.value.id, pointInfo.value.name, - data.robot.id, + data.robot.label, data.robot.label ); @@ -129,12 +129,7 @@ const handleRobotSelected = async (data: { robot: RobotInfo; targetPointName: st // 显示结果提示 if (result.success) { message.success(`已为机器人 ${data.robot.label} 下发导航任务到 ${data.targetPointName}`); - } else { - // 如果API返回了错误信息,让全局错误处理显示 - if (!result.message) { - message.error('导航任务下发失败'); - } - } + } } catch (error) { console.error('导航操作失败:', error); diff --git a/src/components/modal/robot-selector-modal.vue b/src/components/modal/robot-selector-modal.vue index 86582ea..d5e740a 100644 --- a/src/components/modal/robot-selector-modal.vue +++ b/src/components/modal/robot-selector-modal.vue @@ -14,9 +14,8 @@ v-for="robot in robotList" :key="robot.id" class="robot-item" - :class="{ disabled: !isRobotSelectable(robot) }" > - +
{{ robot.label }}
@@ -113,21 +112,10 @@ const loadRobotList = async () => { } }; -// 判断机器人是否可选择 -const isRobotSelectable = (robot: RobotInfo): boolean => { - // 根据接口文档要求,机器人必须满足以下条件: - // 1. 机器人必须在线 (isConnected === true) - // 2. 机器人必须开启接单 (canOrder === true) - // 3. 机器人状态必须为空闲 (state === RobotState.空闲中) - // 4. 机器人当前没有正在执行的任务(通过目标点位判断) - - return ( - robot.isConnected === true && - robot.canOrder === true && - robot.state === RobotState.空闲中 && - !robot.targetPoint // 没有目标点位表示没有正在执行的任务 - ); -}; +// 判断机器人是否可选择(前端暂不做限制,由后端控制) +// const isRobotSelectable = (robot: RobotInfo): boolean => { +// return true; +// }; // 获取机器人状态文本 const getRobotStatusText = (state?: RobotState): string => { @@ -222,16 +210,11 @@ onMounted(() => { transition: all 0.3s; } -.robot-item:hover:not(.disabled) { +.robot-item:hover { border-color: #1890ff; background-color: #f5f5f5; } -.robot-item.disabled { - opacity: 0.6; - cursor: not-allowed; -} - .robot-info { width: 100%; } diff --git a/src/services/context-menu/point-menu.service.ts b/src/services/context-menu/point-menu.service.ts index 53eee3e..cf14c31 100644 --- a/src/services/context-menu/point-menu.service.ts +++ b/src/services/context-menu/point-menu.service.ts @@ -62,7 +62,7 @@ export async function executeNavigateToPoint( } else { return { success: false, - message: result.message || '路径导航任务下发失败', + message: '', }; }