From f6e078563328c30b3a8dd83a8eb52e07df572b57 Mon Sep 17 00:00:00 2001 From: joylink_fanyuhong <18706759286@163.com> Date: Thu, 10 Oct 2024 16:04:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/drawApp/iscsApp.ts | 23 +++++------------------ src/layouts/IscsDrawLayout.vue | 32 +++++++++++++++++--------------- src/pages/IscsDraftManage.vue | 5 ++++- 3 files changed, 26 insertions(+), 34 deletions(-) diff --git a/src/drawApp/iscsApp.ts b/src/drawApp/iscsApp.ts index 042de0d..0fd32d0 100644 --- a/src/drawApp/iscsApp.ts +++ b/src/drawApp/iscsApp.ts @@ -121,16 +121,10 @@ function handleSubscribe(app: IDrawApp) { app.deleteGraphics(...graphics); } } else { - storage = iscsGraphicData.IscsGraphicStorage.deserialize( - toUint8Array(base64) - ); if (syncData.submenu === '火灾报警平面图') { for (let i = 0; i < storage.fasOfPlatformAlarmStorages.length; i++) { const fasPlatformAlarm = storage.fasOfPlatformAlarmStorages[i]; if (fasPlatformAlarm.stationName == syncData.station) { - // canvasProperty = fasPlatformAlarm.canvas; - // datas = loadCommonDrawDatas(fasPlatformAlarm); - // break; syncData.datas.forEach((data) => { handlerNoEditCommonData( data, @@ -150,12 +144,6 @@ function handleSubscribe(app: IDrawApp) { ) { const ctvOfStationControl = storage.cctvOfStationControlStorages[i]; if (ctvOfStationControl.stationName == syncData.station) { - // canvasProperty = ctvOfStationControl.canvas; - // datas = loadCommonDrawDatas(ctvOfStationControl); - // ctvOfStationControl.cctvButtons.forEach((cctvButton) => { - // datas.push(new CCTVButtonData(cctvButton)); - // }); - // break; syncData.datas.forEach((data) => { handlerNoEditCommonData( data, @@ -202,18 +190,17 @@ export async function loadDrawDatas(): Promise { if (!hasLoadData) { base64 = (await getDraft(id)).data; - hasLoadData = true; - } - if (base64) { - if (!hasLoadData) { + if (base64) { storage = iscsGraphicData.IscsGraphicStorage.deserialize( toUint8Array(base64) ); } - + hasLoadData = true; + } + if (hasLoadData) { let datas = []; let canvasProperty; - + console.log(storage); switch (drawStore.selectSubmenuAndStation.submenu) { case '火灾报警平面图': for (let i = 0; i < storage.fasOfPlatformAlarmStorages.length; i++) { diff --git a/src/layouts/IscsDrawLayout.vue b/src/layouts/IscsDrawLayout.vue index bcea97a..e56578e 100644 --- a/src/layouts/IscsDrawLayout.vue +++ b/src/layouts/IscsDrawLayout.vue @@ -343,21 +343,23 @@ onMounted(() => { const drawApp = drawStore.initDrawApp(); drawApp.bindDom(dom); drawApp.reload(); - const _record = drawApp.opRecord.record; - drawApp.opRecord.record = function (op) { - handleRecordData(op); - _record.call(drawApp.opRecord, op); - }; - const _undo = drawApp.opRecord.undo; - drawApp.opRecord.undo = function () { - _undo.call(drawApp.opRecord); - console.log('undo'); - }; - const _redo = drawApp.opRecord.redo; - drawApp.opRecord.redo = function () { - _redo.call(drawApp.opRecord); - console.log('redo'); - }; + if (route.query.isShared == '1') { + const _record = drawApp.opRecord.record; + drawApp.opRecord.record = function (op) { + handleRecordData(op); + _record.call(drawApp.opRecord, op); + }; + const _undo = drawApp.opRecord.undo; + drawApp.opRecord.undo = function () { + _undo.call(drawApp.opRecord); + console.log('undo'); + }; + const _redo = drawApp.opRecord.redo; + drawApp.opRecord.redo = function () { + _redo.call(drawApp.opRecord); + console.log('redo'); + }; + } onResize(); } else { drawStore.setDraftId(null); diff --git a/src/pages/IscsDraftManage.vue b/src/pages/IscsDraftManage.vue index b1c191e..a5ee606 100644 --- a/src/pages/IscsDraftManage.vue +++ b/src/pages/IscsDraftManage.vue @@ -486,7 +486,10 @@ function goToPath(row: DraftItem) { let path = `/iscsPainting/${row.id}`; const iscsStyle = allRequestData.find((item) => item.draftData.id == row.id) .options.style; - router.push({ path: path, query: { iscsStyle } }); + router.push({ + path: path, + query: { iscsStyle, isShared: row.isShared ? 1 : 2 }, + }); } //发布相关