From 8e01da8ed57e987d0d183ac675313d2b7923176a Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Wed, 18 Sep 2024 09:32:56 +0800 Subject: [PATCH] =?UTF-8?q?=E7=81=AB=E7=81=BE=E6=8A=A5=E8=AD=A6=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/drawApp/{fireAlarmApp.ts => fasApp.ts} | 12 +- src/graphics/FAS/fasPngDevice/FasPngDevice.ts | 0 .../fasPngDevice/FasPngDeviceDrawAssistant.ts | 0 .../FAS/png/fire-alarm-device-data.json | 0 src/graphics/FAS/png/fire-alarm-device.png | Bin 0 -> 6819 bytes ...eAlarmDrawLayout.vue => FASDrawLayout.vue} | 0 src/protos/fire_alarm_graphic_data.ts | 148 ------------------ src/router/routes.ts | 6 +- src/stores/draw-store.ts | 14 +- 9 files changed, 16 insertions(+), 164 deletions(-) rename src/drawApp/{fireAlarmApp.ts => fasApp.ts} (84%) create mode 100644 src/graphics/FAS/fasPngDevice/FasPngDevice.ts create mode 100644 src/graphics/FAS/fasPngDevice/FasPngDeviceDrawAssistant.ts create mode 100644 src/graphics/FAS/png/fire-alarm-device-data.json create mode 100644 src/graphics/FAS/png/fire-alarm-device.png rename src/layouts/{FireAlarmDrawLayout.vue => FASDrawLayout.vue} (100%) delete mode 100644 src/protos/fire_alarm_graphic_data.ts diff --git a/src/drawApp/fireAlarmApp.ts b/src/drawApp/fasApp.ts similarity index 84% rename from src/drawApp/fireAlarmApp.ts rename to src/drawApp/fasApp.ts index a02eead..4bbd13a 100644 --- a/src/drawApp/fireAlarmApp.ts +++ b/src/drawApp/fasApp.ts @@ -6,7 +6,7 @@ import { KeyListener, newDrawApp, } from 'jl-graphic'; -import { FireAlarmGraphicData } from 'src/protos/fire_alarm_graphic_data'; +import { FASGraphicData } from 'src/protos/fas_graphic_data'; import { fromUint8Array } from 'js-base64'; import { initCommonDrawApp, @@ -17,18 +17,18 @@ import { useDrawStore } from 'src/stores/draw-store'; let drawApp: IDrawApp | null = null; -export function getFireAlarmDrawApp(): IDrawApp | null { +export function getFASDrawApp(): IDrawApp | null { return drawApp; } -export function destroyFireAlarmDrawApp(): void { +export function destroyFASDrawApp(): void { if (drawApp) { drawApp.destroy(); drawApp = null; } } -export function initFireAlarmDrawApp(): IDrawApp { +export function initFASDrawApp(): IDrawApp { const isSupportDeletion = (g: JlGraphic) => { console.log(g); return true; @@ -72,11 +72,11 @@ export async function loadDrawDatas(): Promise { } export function saveDrawDatas(app: IDrawApp) { - let storage = new FireAlarmGraphicData.FireAlarmGraphicStorage(); + let storage = new FASGraphicData.FASGraphicStorage(); storage = saveCommonDrawDatas( app, storage - ) as FireAlarmGraphicData.FireAlarmGraphicStorage; + ) as FASGraphicData.FASGraphicStorage; const graphics = app.queryStore.getAllGraphics(); /* graphics.forEach((g) => { if (TrackSection.Type === g.type) { diff --git a/src/graphics/FAS/fasPngDevice/FasPngDevice.ts b/src/graphics/FAS/fasPngDevice/FasPngDevice.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/graphics/FAS/fasPngDevice/FasPngDeviceDrawAssistant.ts b/src/graphics/FAS/fasPngDevice/FasPngDeviceDrawAssistant.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/graphics/FAS/png/fire-alarm-device-data.json b/src/graphics/FAS/png/fire-alarm-device-data.json new file mode 100644 index 0000000..e69de29 diff --git a/src/graphics/FAS/png/fire-alarm-device.png b/src/graphics/FAS/png/fire-alarm-device.png new file mode 100644 index 0000000000000000000000000000000000000000..4fa3a21ea1ee37dd868aa83dd165bbcd9385d8a2 GIT binary patch literal 6819 zcmd5>2UJtpy50%Z&=DO(!4NDUgjCWX8l(s+hyqfK11TpEfg~iMsu)pG5D`Ye3L@A` zL{!RH0C7M81>2wwDu{xLiYN#Q!acz<-uq_m%zE#>_1;-4$vJy}`!C=A|9}5yCDq4! zo*v2!1pv_V^l)7Q00O=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bhQ#*^f`;m%pJMN?8 zj?t4I+l!vHdYON!Hfa1A>D!Sp8?=qk=7i=w_TV0RcRc!iL8|>M z_gO$YN5L%6cMfG=Mxc#%KeoHtonz$hhX}Pd-DDQ`4gl1(ej;=vHi)nXuwJjB8BEe} zn{RjOK)_;k1iEvuJFvri_mCqH`>AUG4zsw^NX5_d6yxdlbgFE@`d~yTfA;y!Z4P&t z7+{_3pJo2+0|l=|*B=M=dmuo*m6p?$;#mcA1MW^~==CAMAaVKK(?Wj z%QzXhlXLWX4VLHSx&ZV}BV=*iq(d^sP* zJu}^SxA(>@l-1ZvM<+l#{4jT8ukx237rVLi2^lNEJts@9oU%N`PHFr@luIJ~K6WxvbDc(L)L8wTP@@Q_IY&`H# z2c)5q)K^y->muGZu+N!)Jhxzbrxkuf{FFi?H>cH;w~y$H5SbYm5U; - arrows?: ReturnType[]; - iscsTexts?: ReturnType[]; - rects?: ReturnType[]; - }): FireAlarmGraphicStorage { - const message = new FireAlarmGraphicStorage({}); - if (data.canvas != null) { - message.canvas = dependency_1.iscsGraphicData.Canvas.fromObject(data.canvas); - } - if (data.arrows != null) { - message.arrows = data.arrows.map(item => dependency_1.iscsGraphicData.Arrow.fromObject(item)); - } - if (data.iscsTexts != null) { - message.iscsTexts = data.iscsTexts.map(item => dependency_1.iscsGraphicData.IscsText.fromObject(item)); - } - if (data.rects != null) { - message.rects = data.rects.map(item => dependency_1.iscsGraphicData.Rect.fromObject(item)); - } - return message; - } - toObject() { - const data: { - canvas?: ReturnType; - arrows?: ReturnType[]; - iscsTexts?: ReturnType[]; - rects?: ReturnType[]; - } = {}; - if (this.canvas != null) { - data.canvas = this.canvas.toObject(); - } - if (this.arrows != null) { - data.arrows = this.arrows.map((item: dependency_1.iscsGraphicData.Arrow) => item.toObject()); - } - if (this.iscsTexts != null) { - data.iscsTexts = this.iscsTexts.map((item: dependency_1.iscsGraphicData.IscsText) => item.toObject()); - } - if (this.rects != null) { - data.rects = this.rects.map((item: dependency_1.iscsGraphicData.Rect) => item.toObject()); - } - return data; - } - serialize(): Uint8Array; - serialize(w: pb_1.BinaryWriter): void; - serialize(w?: pb_1.BinaryWriter): Uint8Array | void { - const writer = w || new pb_1.BinaryWriter(); - if (this.has_canvas) - writer.writeMessage(1, this.canvas, () => this.canvas.serialize(writer)); - if (this.arrows.length) - writer.writeRepeatedMessage(2, this.arrows, (item: dependency_1.iscsGraphicData.Arrow) => item.serialize(writer)); - if (this.iscsTexts.length) - writer.writeRepeatedMessage(3, this.iscsTexts, (item: dependency_1.iscsGraphicData.IscsText) => item.serialize(writer)); - if (this.rects.length) - writer.writeRepeatedMessage(4, this.rects, (item: dependency_1.iscsGraphicData.Rect) => item.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): FireAlarmGraphicStorage { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new FireAlarmGraphicStorage(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.canvas, () => message.canvas = dependency_1.iscsGraphicData.Canvas.deserialize(reader)); - break; - case 2: - reader.readMessage(message.arrows, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_1.iscsGraphicData.Arrow.deserialize(reader), dependency_1.iscsGraphicData.Arrow)); - break; - case 3: - reader.readMessage(message.iscsTexts, () => pb_1.Message.addToRepeatedWrapperField(message, 3, dependency_1.iscsGraphicData.IscsText.deserialize(reader), dependency_1.iscsGraphicData.IscsText)); - break; - case 4: - reader.readMessage(message.rects, () => pb_1.Message.addToRepeatedWrapperField(message, 4, dependency_1.iscsGraphicData.Rect.deserialize(reader), dependency_1.iscsGraphicData.Rect)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): FireAlarmGraphicStorage { - return FireAlarmGraphicStorage.deserialize(bytes); - } - } -} diff --git a/src/router/routes.ts b/src/router/routes.ts index cd7f5eb..e922f29 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -35,12 +35,12 @@ const routes: RouteRecordRaw[] = [ component: () => import('layouts/CCTVDrawLayout.vue'), }, { - path: '/fireAlarmPaint', - name: 'fireAlarmPaint', + path: '/fasPaint', + name: 'fasPaint', meta: { label: '火灾报警绘制', }, - component: () => import('layouts/FireAlarmDrawLayout.vue'), + component: () => import('layouts/FASDrawLayout.vue'), }, ]; diff --git a/src/stores/draw-store.ts b/src/stores/draw-store.ts index 3beee17..a45bbf6 100644 --- a/src/stores/draw-store.ts +++ b/src/stores/draw-store.ts @@ -5,10 +5,10 @@ import { getCCTVDrawApp, } from 'src/drawApp/cctvApp'; import { - initFireAlarmDrawApp, - destroyFireAlarmDrawApp, - getFireAlarmDrawApp, -} from 'src/drawApp/fireAlarmApp'; + initFASDrawApp, + destroyFASDrawApp, + getFASDrawApp, +} from 'src/drawApp/fasApp'; import { DrawAssistant, GraphicData, @@ -38,7 +38,7 @@ export const useDrawStore = defineStore('draw', { app = getCCTVDrawApp(); break; case PictureType.FireAlarm: - app = getFireAlarmDrawApp(); + app = getFASDrawApp(); break; } return app; @@ -99,7 +99,7 @@ export const useDrawStore = defineStore('draw', { app = initCCTVDrawApp(); break; case PictureType.FireAlarm: - app = initFireAlarmDrawApp(); + app = initFASDrawApp(); break; } if (app == null) { @@ -129,7 +129,7 @@ export const useDrawStore = defineStore('draw', { destroyCCTVDrawApp(); break; case PictureType.FireAlarm: - destroyFireAlarmDrawApp(); + destroyFASDrawApp(); break; } },