From 5f999bd8f8e607d722548b5ee2a3c86e634eae8f Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Thu, 21 Sep 2023 09:09:29 +0800 Subject: [PATCH] =?UTF-8?q?uniqueId=E4=BF=A1=E5=8F=B7=E5=B8=83=E7=BD=AE?= =?UTF-8?q?=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/drawApp/commonApp.ts | 15 ++++ src/drawApp/relayCabinetLayoutApp.ts | 4 +- src/layouts/DrawLayout.vue | 58 +++++++++++++- src/layouts/RelayCabinetLayout.vue | 16 ++-- src/protos/stationLayoutGraphics.ts | 116 +++++++++++++++++++++++++++ 5 files changed, 198 insertions(+), 11 deletions(-) diff --git a/src/drawApp/commonApp.ts b/src/drawApp/commonApp.ts index d07fcba..b7da6b4 100644 --- a/src/drawApp/commonApp.ts +++ b/src/drawApp/commonApp.ts @@ -223,12 +223,16 @@ export function initCommonDrawApp(app: IDrawApp) { }; DefaultCanvasMenu.open(e.global); }); + app.on('destroy', async () => { + UniqueIdPrefix = new graphicData.UniqueIdType(); + }); } export function loadCommonDrawDatas( storage: graphicData.RtssGraphicStorage ): GraphicData[] { const datas: GraphicData[] = []; + UniqueIdPrefix = storage.UniqueIdPrefix; storage.Platforms.forEach((platform) => { datas.push(new PlatformData(platform)); }); @@ -349,6 +353,7 @@ export function saveCommonDrawDatas(app: IDrawApp) { storage.curvatures.push((curvatureData as CurvatureData).data); } }); + storage.UniqueIdPrefix = UniqueIdPrefix; return storage; } @@ -392,3 +397,13 @@ export function saveDrawToServer(base64: string) { errorNotify(err.message, err); }); } + +//UniqueId +let UniqueIdPrefix = new graphicData.UniqueIdType(); +export function loadUniqueIdPrefix() { + return UniqueIdPrefix; +} + +export function setUniqueIdPrefix(newUniqueIdPrefix: graphicData.UniqueIdType) { + UniqueIdPrefix = newUniqueIdPrefix; +} diff --git a/src/drawApp/relayCabinetLayoutApp.ts b/src/drawApp/relayCabinetLayoutApp.ts index ce1811f..09c1104 100644 --- a/src/drawApp/relayCabinetLayoutApp.ts +++ b/src/drawApp/relayCabinetLayoutApp.ts @@ -278,11 +278,11 @@ export function deleteDeviceRelateRelay(row: RelateRelaylistItem) { //所属集中站 let UniqueIdPrefix = new relayCabinetGraphicData.UniqueIdType(); -export function loadBelongsStation() { +export function loadUniqueIdPrefix() { return UniqueIdPrefix; } -export function setBelongsStation( +export function setUniqueIdPrefix( newUniqueIdPrefix: relayCabinetGraphicData.UniqueIdType ) { UniqueIdPrefix = newUniqueIdPrefix; diff --git a/src/layouts/DrawLayout.vue b/src/layouts/DrawLayout.vue index f3ea835..4297c3f 100644 --- a/src/layouts/DrawLayout.vue +++ b/src/layouts/DrawLayout.vue @@ -100,13 +100,53 @@ + + + +
UniqueId配置
+
+ + + + + + + + + +
+