From 7f96abf20e80c016b52aae3d20fd35f6dac851bf Mon Sep 17 00:00:00 2001 From: Yuan Date: Thu, 12 Oct 2023 16:21:55 +0800 Subject: [PATCH 1/2] =?UTF-8?q?ibp=E7=BC=96=E8=BE=91UniqueID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bj-rtss-message | 2 +- src/drawApp/ibpDrawApp.ts | 19 +- src/layouts/IBPDrawLayout.vue | 69 ++- src/protos/ibpGraphics.ts | 139 ++++++ src/protos/pslGraphics.ts | 228 +++++++++- src/protos/stationLayoutGraphics.ts | 656 ++++++++++++++++++++++++---- src/stores/ibp-draw-store.ts | 3 +- 7 files changed, 1021 insertions(+), 95 deletions(-) diff --git a/bj-rtss-message b/bj-rtss-message index a8fa6fe..5604ad8 160000 --- a/bj-rtss-message +++ b/bj-rtss-message @@ -1 +1 @@ -Subproject commit a8fa6fec188ad3df19952e298a1f846d581ca200 +Subproject commit 5604ad84ed5c6af4206937f5bbba9b2debfbfb6f diff --git a/src/drawApp/ibpDrawApp.ts b/src/drawApp/ibpDrawApp.ts index 81bc9cc..60cac6d 100644 --- a/src/drawApp/ibpDrawApp.ts +++ b/src/drawApp/ibpDrawApp.ts @@ -32,7 +32,6 @@ import { TextContentDraw } from 'src/graphics/textContent/TextContentDrawAssista import { IbpTextData } from './graphics/IbpTextInteraction'; import { MenuItemOptions } from 'src/jl-graphic/ui/Menu'; import { ContextMenu } from 'src/jl-graphic/ui/ContextMenu'; -import { savePslDrawToServer } from './pslApp'; let drawApp: IDrawApp | null = null; const UndoOptions: MenuItemOptions = { @@ -107,6 +106,18 @@ export function initIBPDrawApp() { return drawApp; } +//所属集中站 +let uniqueIdPrefix = new ibpGraphicData.UniqueIdType(); +export function loadUniqueIdPrefix() { + return uniqueIdPrefix; +} + +export function setUniqueIdPrefix( + newUniqueIdPrefix: ibpGraphicData.UniqueIdType +) { + uniqueIdPrefix = newUniqueIdPrefix; +} + export function saveIBPDrawToServer(app: IDrawApp) { const base64 = saveIBPDrawDatas(app); const ibpDrawStore = useIBPDrawStore(); @@ -123,7 +134,7 @@ export function saveIBPDrawToServer(app: IDrawApp) { }); } -function saveIBPDrawDatas(app: IDrawApp) { +export function saveIBPDrawDatas(app: IDrawApp) { const storage = new ibpGraphicData.IBPGraphicStorage(); const canvasData = app.canvas.saveData(); storage.canvas = new graphicData.Canvas({ @@ -145,6 +156,7 @@ function saveIBPDrawDatas(app: IDrawApp) { storage.IBPTexts.push(g.saveData().data); } }); + storage.UniqueIdPrefix = uniqueIdPrefix; const base64 = fromUint8Array(storage.serialize()); return base64; } @@ -176,6 +188,9 @@ async function IBPDrawDataLoader() { storage.IBPTexts.forEach((ibpText) => { datas.push(new IbpTextData(ibpText)); }); + if (storage.UniqueIdPrefix) { + setUniqueIdPrefix(storage.UniqueIdPrefix); + } return { canvasProperty: storage.canvas, datas: datas, diff --git a/src/layouts/IBPDrawLayout.vue b/src/layouts/IBPDrawLayout.vue index f01daa7..8ed67b9 100644 --- a/src/layouts/IBPDrawLayout.vue +++ b/src/layouts/IBPDrawLayout.vue @@ -1,5 +1,5 @@