diff --git a/src/apis/map/type.ts b/src/apis/map/type.ts
index 73c993b..8cd60c0 100644
--- a/src/apis/map/type.ts
+++ b/src/apis/map/type.ts
@@ -32,6 +32,7 @@ export interface MapPointInfo {
deviceId?: string; // 设备ID
enabled?: 0 | 1; // 是否启用(仅停靠点使用,0=禁用,1=启用)
deviceStatus?: number; // 设备状态(仅自动门点使用,0=关门,1=开门)
+ isConnected?: boolean; // 连接状态(仅自动门点使用,true=已连接,false=未连接)
active?: boolean; // 是否激活状态,用于控制光圈显示
}
//#endregion
diff --git a/src/components/card/point-detail-card.vue b/src/components/card/point-detail-card.vue
index cbc8218..a011ae2 100644
--- a/src/components/card/point-detail-card.vue
+++ b/src/components/card/point-detail-card.vue
@@ -198,6 +198,19 @@ const binTaskData = computed(() => {
{{ $t('设备ID') }}
{{ point.deviceId }}
+
+ {{ $t('连接状态') }}
+
+
+
+ {{ point.isConnected ? $t('已连接') : $t('未连接') }}
+
+
+
{{ $t('扩展类型') }}
{{ $t(MapPointType[point.extensionType]) }}
@@ -315,6 +328,24 @@ const binTaskData = computed(() => {
@use '/src/assets/themes/theme' as *;
@include themed {
+ .conn-status {
+ .status-dot {
+ width: 8px;
+ height: 8px;
+ border-radius: 50%;
+ display: inline-block;
+ box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
+ &.online {
+ background-color: get-color(success);
+ box-shadow: 0 0 0 2px rgba(82, 196, 26, 0.15);
+ }
+ &.offline {
+ background-color: get-color(error);
+ box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.15);
+ }
+ }
+ }
+
.storage-locations {
.storage-item {
display: flex;
diff --git a/src/pages/movement-supervision.vue b/src/pages/movement-supervision.vue
index 1767974..0f26059 100644
--- a/src/pages/movement-supervision.vue
+++ b/src/pages/movement-supervision.vue
@@ -312,6 +312,11 @@ const handleAutoSaveAndRestoreViewState = async () => {
//#region UI状态管理
const show = ref(true);
//#endregion
+
+// 返回到父级 iframe 的场景卡片
+const backToCards = () => {
+ window.parent?.postMessage({ type: 'scene_return_to_cards' }, '*');
+};
@@ -319,7 +324,10 @@ const show = ref(true);
{{ title }}--{{ isMonitorMode ? '场景监控' : '场景仿真' }}
- 保存比例
+
+
+ 保存比例
+
diff --git a/src/pages/scene-editor.vue b/src/pages/scene-editor.vue
index bc2c510..3cf3be4 100644
--- a/src/pages/scene-editor.vue
+++ b/src/pages/scene-editor.vue
@@ -157,6 +157,10 @@ const handleAutoSaveAndRestoreViewState = async () => {
await autoSaveAndRestoreViewState(editor.value, props.id);
};
+// 返回到父级 iframe 的场景卡片
+const backToCards = () => {
+ window.parent?.postMessage({ type: 'scene_return_to_cards' }, '*');
+};
@@ -165,6 +169,7 @@ const handleAutoSaveAndRestoreViewState = async () => {
{{ title }} --场景编辑
+
保存比例
diff --git a/src/services/auto-door-simulation.service.ts b/src/services/auto-door-simulation.service.ts
index daa08d6..2039ba9 100644
--- a/src/services/auto-door-simulation.service.ts
+++ b/src/services/auto-door-simulation.service.ts
@@ -88,7 +88,10 @@ export class AutoDoorService {
private timers = new Map();
private statusMap = new Map();
private editorService: EditorService | null = null;
- private latestAutoDoorData = new Map();
+ private latestAutoDoorData = new Map<
+ string,
+ { deviceId: string; deviceStatus: number; active: boolean; isConnected: boolean }
+ >();
// 设备ID到自动门点ID的映射缓存,避免每次都遍历查找
private deviceIdToPointIdMap = new Map();
@@ -250,7 +253,7 @@ export class AutoDoorService {
* @param data WebSocket推送的数据
*/
handleWebSocketData(data: AutoDoorWebSocketData): void {
- const { label: deviceId, deviceStatus, active = true } = data;
+ const { label: deviceId, deviceStatus, active = true, isConnected = true } = data;
if (!deviceId || deviceStatus === undefined) {
console.warn('⚠️ 自动门点数据格式不正确', data);
@@ -258,7 +261,7 @@ export class AutoDoorService {
}
// 缓存最新数据
- this.latestAutoDoorData.set(deviceId, { deviceId, deviceStatus, active });
+ this.latestAutoDoorData.set(deviceId, { deviceId, deviceStatus, active, isConnected });
console.log(
`🚪 收到自动门点WebSocket数据: ${deviceStatus === 0 ? '关门(红色)' : '开门(蓝色)'} (deviceId: ${deviceId})`,
@@ -291,7 +294,13 @@ export class AutoDoorService {
// 更新自动门点状态(使用pointId直接更新,避免查找)
if (this.editorService) {
- this.editorService.updateAutoDoorByDeviceId(data.deviceId, data.deviceStatus, data.active, pointId);
+ this.editorService.updateAutoDoorByDeviceId(
+ data.deviceId,
+ data.deviceStatus,
+ data.isConnected,
+ data.active,
+ pointId,
+ );
}
}
diff --git a/src/services/editor.service.ts b/src/services/editor.service.ts
index 92c54fe..c79398c 100644
--- a/src/services/editor.service.ts
+++ b/src/services/editor.service.ts
@@ -866,7 +866,6 @@ export class EditorService extends Meta2d {
public updatePointBorderColor(pointId: string, color: string): void {
const pen = this.getPenById(pointId);
if (!pen || pen.name !== 'point') return;
-
this.updatePen(pointId, { statusStyle: color }, false);
}
@@ -874,10 +873,17 @@ export class EditorService extends Meta2d {
* 根据设备ID更新自动门点状态
* @param deviceId 设备ID
* @param deviceStatus 设备状态(0=关门,1=开门)
+ * @param isConnected 连接状态(true=已连接,false=未连接)
* @param active 是否显示光圈
* @param pointId 可选的点位ID,如果提供则直接使用,避免查找
*/
- public updateAutoDoorByDeviceId(deviceId: string, deviceStatus: number, active = true, pointId?: string): void {
+ public updateAutoDoorByDeviceId(
+ deviceId: string,
+ deviceStatus: number,
+ isConnected: boolean,
+ active = true,
+ pointId?: string,
+ ): void {
let autoDoorPointId = pointId;
// 如果没有提供pointId,则通过deviceId查找
@@ -912,6 +918,7 @@ export class EditorService extends Meta2d {
point: {
...autoDoorPoint.point,
deviceStatus,
+ isConnected,
active,
},
},