diff --git a/src/apis/map/type.ts b/src/apis/map/type.ts index 54307c2..7489331 100644 --- a/src/apis/map/type.ts +++ b/src/apis/map/type.ts @@ -29,6 +29,7 @@ export interface MapPointInfo { isBlock?: boolean; // 是否禁行 isForbidAvoid?: boolean; // 是否禁止避让 associatedStorageLocations?: string[]; // 库位名称 + deviceId?: string; // 设备ID } //#endregion diff --git a/src/apis/scene/type.ts b/src/apis/scene/type.ts index 5b9fd4c..930e7cf 100644 --- a/src/apis/scene/type.ts +++ b/src/apis/scene/type.ts @@ -44,6 +44,7 @@ export interface StandardScenePoint { associatedStorageLocations?: string[]; // 库位名称 config?: object; // 其它属性配置(可按需增加) properties?: unknown; // 附加数据(前端不做任何处理) + deviceId?: string; // 设备ID } export interface StandardSceneRoute { id: string; diff --git a/src/components/card/point-detail-card.vue b/src/components/card/point-detail-card.vue index 5284b31..8004804 100644 --- a/src/components/card/point-detail-card.vue +++ b/src/components/card/point-detail-card.vue @@ -109,6 +109,10 @@ const getStorageStatusTag = (location: StorageLocationInfo) => { {{ $t('站点坐标') }} ({{ rect.x?.toFixed() }},{{ rect.y?.toFixed() }}) + + {{ $t('设备ID') }} + {{ point.deviceId }} + {{ $t('扩展类型') }} {{ $t(MapPointType[point.extensionType]) }} diff --git a/src/components/card/point-edit-card.vue b/src/components/card/point-edit-card.vue index 7f06d1e..bb0eca5 100644 --- a/src/components/card/point-edit-card.vue +++ b/src/components/card/point-edit-card.vue @@ -109,6 +109,19 @@ function onChangeLocation(i: number, v: string) { + + + {{ $t('设备ID') }}: + + + + + + {{ $t('描述') }}: diff --git a/src/services/editor.service.ts b/src/services/editor.service.ts index bc8d246..dbf80dc 100644 --- a/src/services/editor.service.ts +++ b/src/services/editor.service.ts @@ -110,10 +110,10 @@ export class EditorService extends Meta2d { if (!points?.length) return; await Promise.all( points.map(async (v) => { - const { id, name, desc, x, y, type, extensionType, robots, actions, properties } = v; + const { id, name, desc, x, y, type, extensionType, robots, actions, properties, deviceId } = v; await this.addPoint({ x, y }, type, id); this.setValue( - { id, label: name, desc, properties, point: { type, extensionType, robots, actions } }, + { id, label: name, desc, properties, point: { type, extensionType, robots, actions, deviceId } }, { render: false, history: false, doEvent: false }, ); }), @@ -199,7 +199,7 @@ export class EditorService extends Meta2d { #mapScenePoint(pen?: MapPen): StandardScenePoint | null { if (!pen?.id || isEmpty(pen?.point)) return null; const { id, label, desc, properties } = pen; - const { type, extensionType, robots, actions, associatedStorageLocations } = pen.point; + const { type, extensionType, robots, actions, associatedStorageLocations, deviceId } = pen.point; const { x = 0, y = 0 } = this.getPointRect(pen) ?? {}; // 进行坐标转换:左上角原点 -> 中心点原点,同时应用ratio缩放 @@ -225,6 +225,9 @@ export class EditorService extends Meta2d { if (MapPointType.动作点 === type) { point.associatedStorageLocations = associatedStorageLocations; } + if (MapPointType.自动门点 === type) { + point.deviceId = deviceId; + } return point; } #mapSceneRoute(pen?: MapPen): StandardSceneRoute | null {