diff --git a/src/apis/map/type.ts b/src/apis/map/type.ts
index 7489331..786cf95 100644
--- a/src/apis/map/type.ts
+++ b/src/apis/map/type.ts
@@ -30,6 +30,7 @@ export interface MapPointInfo {
isForbidAvoid?: boolean; // 是否禁止避让
associatedStorageLocations?: string[]; // 库位名称
deviceId?: string; // 设备ID
+ enabled?: 0 | 1; // 是否启用(仅停靠点使用,0=禁用,1=启用)
}
//#endregion
diff --git a/src/apis/scene/type.ts b/src/apis/scene/type.ts
index 930e7cf..61527e7 100644
--- a/src/apis/scene/type.ts
+++ b/src/apis/scene/type.ts
@@ -45,6 +45,7 @@ export interface StandardScenePoint {
config?: object; // 其它属性配置(可按需增加)
properties?: unknown; // 附加数据(前端不做任何处理)
deviceId?: string; // 设备ID
+ enabled?: 0 | 1; // 是否启用(仅停靠点使用,0=禁用,1=启用)
}
export interface StandardSceneRoute {
id: string;
diff --git a/src/components/card/point-detail-card.vue b/src/components/card/point-detail-card.vue
index 8004804..98b55b4 100644
--- a/src/components/card/point-detail-card.vue
+++ b/src/components/card/point-detail-card.vue
@@ -123,6 +123,10 @@ const getStorageStatusTag = (location: StorageLocationInfo) => {
{{ bindRobot || $t('暂无') }}
+
+ {{ $t('启用状态') }}
+ {{ point.enabled === 1 ? $t('已启用') : $t('已禁用') }}
+
{{ $t('绑定动作点') }}
diff --git a/src/components/card/point-edit-card.vue b/src/components/card/point-edit-card.vue
index bb0eca5..1e10c72 100644
--- a/src/components/card/point-edit-card.vue
+++ b/src/components/card/point-edit-card.vue
@@ -198,6 +198,20 @@ function onChangeLocation(i: number, v: string) {
+
+
+
+
+ {{ $t('是') }}
+ {{ $t('否') }}
+
+
+
+
+
diff --git a/src/services/editor.service.ts b/src/services/editor.service.ts
index de7ec54..feec60d 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, deviceId } = v;
+ const { id, name, desc, x, y, type, extensionType, robots, actions, properties, deviceId, enabled } = v;
await this.addPoint({ x, y }, type, id);
this.setValue(
- { id, label: name, desc, properties, point: { type, extensionType, robots, actions, deviceId } },
+ { id, label: name, desc, properties, point: { type, extensionType, robots, actions, deviceId, enabled } },
{ render: false, history: false, doEvent: false },
);
}),
@@ -204,7 +204,7 @@ export class EditorService extends Meta2d {
return null;
}
const { id, label, desc, properties } = pen;
- const { type, extensionType, robots, actions, associatedStorageLocations, deviceId } = pen.point;
+ const { type, extensionType, robots, actions, associatedStorageLocations, deviceId, enabled } = pen.point;
const { x = 0, y = 0 } = this.getPointRect(pen) ?? {};
// 进行坐标转换:左上角原点 -> 中心点原点,同时应用ratio缩放
@@ -233,6 +233,9 @@ export class EditorService extends Meta2d {
if (MapPointType.自动门点 === type) {
point.deviceId = deviceId;
}
+ if (MapPointType.停靠点 === type) {
+ point.enabled = enabled;
+ }
return point;
}
#mapSceneRoute(pen?: MapPen): StandardSceneRoute | null {
@@ -719,6 +722,13 @@ export class EditorService extends Meta2d {
*/
public async addPoint(p: Point, type = MapPointType.普通点, id?: string): Promise {
id ||= s8();
+ const pointInfo: MapPointInfo = { type };
+
+ // 为停靠点设置默认启用状态
+ if (type === MapPointType.停靠点) {
+ pointInfo.enabled = 1;
+ }
+
const pen: MapPen = {
...p,
...this.#mapPoint(type),
@@ -727,7 +737,7 @@ export class EditorService extends Meta2d {
name: 'point',
tags: ['point'],
label: `P${id}`,
- point: { type },
+ point: pointInfo,
locked: LockState.DisableEdit,
};
pen.x! -= pen.width! / 2;
@@ -746,6 +756,13 @@ export class EditorService extends Meta2d {
const rect = this.getPointRect(pen);
if (isNil(rect)) return;
const point = this.#mapPoint(type);
+ const pointInfo: MapPointInfo = { type };
+
+ // 为停靠点设置默认启用状态
+ if (type === MapPointType.停靠点) {
+ pointInfo.enabled = 1;
+ }
+
this.setValue(
{
id,
@@ -753,7 +770,7 @@ export class EditorService extends Meta2d {
y: rect.y - point.height / 2,
...point,
...this.#mapPointImage(type),
- point: { type },
+ point: pointInfo,
},
{ render: true, history: true, doEvent: true },
);