From c8085751f9a5eb5d4aeec48607e133baa6eec6d7 Mon Sep 17 00:00:00 2001 From: xudan Date: Tue, 1 Jul 2025 16:02:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9C=A8=E5=8C=BA=E5=9F=9F=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E5=92=8C=E7=BC=96=E8=BE=91=E5=8D=A1=E7=89=87=E4=B8=AD?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=BA=A6=E6=9D=9F=E5=8C=BA=E6=9C=80=E5=A4=A7?= =?UTF-8?q?=E5=8F=AF=E5=AE=B9=E7=BA=B3AMR=E6=95=B0=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=EF=BC=8C=E4=BC=98=E5=8C=96=E5=8C=BA=E5=9F=9F=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/card/area-detail-card.vue | 8 +++++++- src/components/card/area-edit-card.vue | 2 +- src/services/editor.service.ts | 10 +++++----- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/components/card/area-detail-card.vue b/src/components/card/area-detail-card.vue index 7971cde..d96d38c 100644 --- a/src/components/card/area-detail-card.vue +++ b/src/components/card/area-detail-card.vue @@ -63,13 +63,19 @@ const bindRoute = computed( + + + {{ $t('最大可容纳AMR数') }} + {{ pen.area?.maxAmr ?? $t('暂无') }} + + {{ $t('绑定动作点') }} {{ bindAction || $t('暂无') }} - + {{ $t('绑定站点') }} {{ bindPoint || $t('暂无') }} diff --git a/src/components/card/area-edit-card.vue b/src/components/card/area-edit-card.vue index b5e68a2..7591f21 100644 --- a/src/components/card/area-edit-card.vue +++ b/src/components/card/area-edit-card.vue @@ -74,7 +74,7 @@ const routes = computed( class="full" :placeholder="$t('请输入数量')" :min="0" - :max="99" + :max="9999" :value="pen.area?.maxAmr" @change="editor.updateArea(id, { maxAmr: $event as number })" /> diff --git a/src/services/editor.service.ts b/src/services/editor.service.ts index d2d245e..127e2fb 100644 --- a/src/services/editor.service.ts +++ b/src/services/editor.service.ts @@ -146,10 +146,10 @@ export class EditorService extends Meta2d { if (!areas?.length) return; await Promise.all( areas.map(async (v) => { - const { id, name, desc, x, y, w, h, type, points, routes, properties } = v; + const { id, name, desc, x, y, w, h, type, points, routes, maxAmr, properties } = v; await this.addArea({ x, y }, { x: x + w, y: y + h }, type, id); this.setValue( - { id, label: name, desc, properties, area: { type, points, routes } }, + { id, label: name, desc, properties, area: { type, points, routes, maxAmr } }, { render: false, history: false, doEvent: false }, ); }), @@ -241,6 +241,9 @@ export class EditorService extends Meta2d { config: {}, properties, }; + if (type === MapAreaType.约束区) { + area.maxAmr = maxAmr; + } if (MapAreaType.库区 === type) { area.points = points?.filter((v) => this.getPenById(v)?.point?.type === MapPointType.动作点); } @@ -255,9 +258,6 @@ export class EditorService extends Meta2d { if (MapAreaType.互斥区 === type) { area.routes = routes?.filter((v) => !isEmpty(this.getPenById(v)?.area)); } - if (MapAreaType.约束区 === type) { - area.maxAmr = maxAmr; - } return area; } //#endregion