diff --git a/src/pages/movement-supervision.vue b/src/pages/movement-supervision.vue index 449767e..1286708 100644 --- a/src/pages/movement-supervision.vue +++ b/src/pages/movement-supervision.vue @@ -89,6 +89,8 @@ const isArea = computed(() => current.value?.type === 'area'); const selectRobot = (id: string) => { current.value = { type: 'robot', id }; editor.value?.inactive(); + // 聚焦到机器人位置 + editor.value?.gotoById(id); }; // 视图状态管理 diff --git a/src/services/editor.service.ts b/src/services/editor.service.ts index 04b5614..8c6b10a 100644 --- a/src/services/editor.service.ts +++ b/src/services/editor.service.ts @@ -527,6 +527,8 @@ export class EditorService extends Meta2d { public gotoById(id: string): void { const pen = this.getPenById(id); if (isNil(pen)) return; + // 判断机器人是否可见,如果不可见直接返回 + if (pen.visible === false && pen.tags?.includes('robot')) return; this.gotoView(pen); }