From c3181d4d373b0961e6c42d57d08b1d51a455fcf3 Mon Sep 17 00:00:00 2001 From: xudan Date: Mon, 14 Jul 2025 16:26:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=BA=93=E4=BD=8D?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E6=94=AF=E6=8C=81=EF=BC=8C=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3=E5=92=8C=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E4=BB=A5=E5=A4=84=E7=90=86=E5=BA=93=E4=BD=8D=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/map/type.ts | 1 + src/apis/scene/type.ts | 1 + src/components/card/point-detail-card.vue | 6 ++++ src/components/card/point-edit-card.vue | 44 +++++++++++++++++++++-- src/services/editor.service.ts | 5 ++- 5 files changed, 54 insertions(+), 3 deletions(-) diff --git a/src/apis/map/type.ts b/src/apis/map/type.ts index 9a938ed..2a02c65 100644 --- a/src/apis/map/type.ts +++ b/src/apis/map/type.ts @@ -28,6 +28,7 @@ export interface MapPointInfo { actions?: Array; // 绑定动作点id集合 isBlock?: boolean; // 是否禁行 isForbidAvoid?: boolean; // 是否禁止避让 + locationNames?: string[]; // 库位名称 } //#endregion diff --git a/src/apis/scene/type.ts b/src/apis/scene/type.ts index f0c4a47..91e3df2 100644 --- a/src/apis/scene/type.ts +++ b/src/apis/scene/type.ts @@ -40,6 +40,7 @@ export interface StandardScenePoint { type: number; // 点位类型 robots?: Array; // 绑定机器人id集合 actions?: Array; // 绑定动作点id集合 + locationNames?: string[]; // 库位名称 config?: object; // 其它属性配置(可按需增加) properties?: unknown; // 附加数据(前端不做任何处理) } diff --git a/src/components/card/point-detail-card.vue b/src/components/card/point-detail-card.vue index 7478b84..516305c 100644 --- a/src/components/card/point-detail-card.vue +++ b/src/components/card/point-detail-card.vue @@ -101,6 +101,12 @@ const storageStatus = computed(() => { {{ coArea1 || $t('暂无') }} + + + {{ $t('库位') }} + {{ point.locationNames.join('、') }} + + +import { PlusOutlined } from '@ant-design/icons-vue'; import { MAP_POINT_TYPES, MapAreaType, type MapPen, type MapPointInfo, MapPointType, type Rect } from '@api/map'; import type { RobotInfo } from '@api/robot'; import type { PointBindModalRef } from '@common/modal/point-bind-modal.vue'; @@ -56,6 +57,25 @@ const actions = computed( const coArea1 = computed(() => editor.value.getBoundAreas(props.id, 'point', MapAreaType.库区)); const coArea2 = computed(() => editor.value.getBoundAreas(props.id, 'point', MapAreaType.互斥区)); + +function onAddLocation() { + const p = point.value!; + if (!p.locationNames) p.locationNames = []; + p.locationNames.push(''); + editor.value.updatePen(props.id!, { point: { ...p } }, false); +} +function onRemoveLocation(i: number) { + const p = point.value!; + p.locationNames?.splice(i, 1); + editor.value.updatePen(props.id!, { point: { ...p } }, false); +} +function onChangeLocation(i: number, v: string) { + const p = point.value!; + if (p.locationNames) { + p.locationNames[i] = v; + editor.value.updatePen(props.id!, { point: { ...p } }, false); + } +}