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