From 4379bcc533bd000995175045739aef9448e846a6 Mon Sep 17 00:00:00 2001 From: xudan Date: Mon, 14 Jul 2025 15:55:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=BA=93=E4=BD=8D?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E7=9B=91=E6=8E=A7=E5=8A=9F=E8=83=BD=EF=BC=8C?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3=E3=80=81?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E5=92=8C=E7=BB=84=E4=BB=B6=E4=BB=A5=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E7=8A=B6=E6=80=81=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/map/type.ts | 3 ++ src/apis/scene/api.ts | 12 ++++++ src/assets/themes/editor-dark.json | 9 +++- src/assets/themes/editor-light.json | 9 +++- src/components/card/point-detail-card.vue | 13 ++++++ src/pages/movement-supervision.vue | 50 +++++++++++++++++++++++ src/services/editor.service.ts | 20 ++++++++- 7 files changed, 112 insertions(+), 4 deletions(-) diff --git a/src/apis/map/type.ts b/src/apis/map/type.ts index 473fc85..9a938ed 100644 --- a/src/apis/map/type.ts +++ b/src/apis/map/type.ts @@ -16,6 +16,9 @@ export interface MapPen extends Pen { activeAttrs?: Array; // 已激活的额外属性 properties?: unknown; // 第三方附加参数 + storageStatus?: Record; // 库位状态 + statusStyle?: string; // 状态颜色 + strokeStyle?: string; // 边框颜色 } //#region 点位 diff --git a/src/apis/scene/api.ts b/src/apis/scene/api.ts index c434190..2fa7c17 100644 --- a/src/apis/scene/api.ts +++ b/src/apis/scene/api.ts @@ -14,6 +14,7 @@ const enum API { 实时监控场景 = '/scene/monitor/:id', 实时监控真实场景 = '/scene/monitor/real/:id', + 实时监控库位状态 = '/scene/monitor/storage/:id', } export async function getSceneById(id: SceneInfo['id']): Promise { @@ -89,6 +90,17 @@ export async function saveSceneByGroupId(id: RobotGroup['id'], sid: RobotGroup[' } } +export async function monitorStorageStatusById(id: SceneInfo['id']): Promise { + if (!id) return null; + try { + const socket = await ws.create(API.实时监控库位状态.replace(':id', id)); + return socket; + } catch (error) { + console.debug(error); + return null; + } +} + export async function monitorSceneById(id: SceneInfo['id']): Promise { if (!id) return null; try { diff --git a/src/assets/themes/editor-dark.json b/src/assets/themes/editor-dark.json index 5145c90..4660f63 100644 --- a/src/assets/themes/editor-dark.json +++ b/src/assets/themes/editor-dark.json @@ -12,7 +12,14 @@ }, "point-l": { "stroke": "#595959", - "strokeActive": "#FCC947" + "strokeActive": "#FCC947", + "stroke-occupied": "#ff4d4f", + "stroke-unoccupied": "#52c41a", + "stroke-empty": "#1890ff", + "stroke-disabled": "#bfbfbf", + "stroke-enabled": "#52c41a", + "stroke-locked": "#faad14", + "stroke-unlocked": "#52c41a" }, "route": { "strokeActive": "#FCC947", diff --git a/src/assets/themes/editor-light.json b/src/assets/themes/editor-light.json index 262cc2a..4676a68 100644 --- a/src/assets/themes/editor-light.json +++ b/src/assets/themes/editor-light.json @@ -12,7 +12,14 @@ }, "point-l": { "stroke": "#595959", - "strokeActive": "#EBB214" + "strokeActive": "#EBB214", + "stroke-occupied": "#ff4d4f", + "stroke-unoccupied": "#52c41a", + "stroke-empty": "#1890ff", + "stroke-disabled": "#bfbfbf", + "stroke-enabled": "#52c41a", + "stroke-locked": "#faad14", + "stroke-unlocked": "#52c41a" }, "route": { "strokeActive": "#EBB214", diff --git a/src/components/card/point-detail-card.vue b/src/components/card/point-detail-card.vue index 5849a73..7478b84 100644 --- a/src/components/card/point-detail-card.vue +++ b/src/components/card/point-detail-card.vue @@ -52,6 +52,13 @@ const mapAreas = (type: MapAreaType): string => { }; const coArea1 = computed(() => mapAreas(MapAreaType.库区)); const coArea2 = computed(() => mapAreas(MapAreaType.互斥区)); +const storageStatus = computed(() => { + const status = pen.value?.storageStatus; + if (!status) return '暂无'; + return Object.entries(status) + .map(([key, value]) => `${key}: ${value}`) + .join(', '); +}); diff --git a/src/pages/movement-supervision.vue b/src/pages/movement-supervision.vue index 5c65a81..38bf262 100644 --- a/src/pages/movement-supervision.vue +++ b/src/pages/movement-supervision.vue @@ -1,4 +1,5 @@