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); + } +}