From 1b0f6866a5c3a5fc14f8ab742d72cf2a494c9308 Mon Sep 17 00:00:00 2001 From: xudan Date: Mon, 8 Dec 2025 17:51:05 +0800 Subject: [PATCH] =?UTF-8?q?feat(editor):=20=E5=88=A0=E9=99=A4=E9=97=A8?= =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E6=97=B6=E6=B8=85=E7=A9=BA=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E8=B7=AF=E6=AE=B5=E7=9A=84=E8=AE=BE=E5=A4=87ID=E4=BB=A5?= =?UTF-8?q?=E4=BF=9D=E6=8C=81=E6=95=B0=E6=8D=AE=E4=B8=80=E8=87=B4=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/editor.service.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/services/editor.service.ts b/src/services/editor.service.ts index 2af6310..263532e 100644 --- a/src/services/editor.service.ts +++ b/src/services/editor.service.ts @@ -11,6 +11,7 @@ import { type Point, type Rect, } from '@api/map'; +import { DOOR_AREA_TYPE } from '@api/map/door-area'; import type { RobotGroup, RobotInfo, RobotLabel } from '@api/robot'; import type { GroupSceneDetail, @@ -1291,6 +1292,26 @@ export class EditorService extends Meta2d { case 'point': this.delete(this.getLines(pen), true, false); break; + case 'area': + // 删除门区域时,清空绑定路段的设备ID + if (pen.area?.type === DOOR_AREA_TYPE && pen.area?.routes) { + pen.area.routes.forEach((routeId: string) => { + const routePen = this.getPenById(routeId) as MapPen | undefined; + if (routePen?.route?.deviceId) { + // 清空路段的设备ID + const updatedRoute = { ...routePen.route }; + delete updatedRoute.deviceId; + this.setValue( + { + id: routeId, + route: updatedRoute + }, + { render: true, history: true, doEvent: false } + ); + } + }); + } + break; default: break; }