From 6242bc5ba6bfed2d8852b40dc642010745cd935c Mon Sep 17 00:00:00 2001 From: fan Date: Mon, 31 Jul 2023 11:19:10 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E6=81=A2=E5=A4=8D=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E5=86=85=E5=AE=B9"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f09fe81a910e0306650276de120ae0285ad0ebc7. --- src/drawApp/lineNetApp.ts | 84 +++++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/src/drawApp/lineNetApp.ts b/src/drawApp/lineNetApp.ts index 7379894..04b7cf8 100644 --- a/src/drawApp/lineNetApp.ts +++ b/src/drawApp/lineNetApp.ts @@ -1,7 +1,7 @@ import { GraphicApp, GraphicData, GraphicState } from 'src/jl-graphic'; import { getPublishLineNet } from 'src/api/PublishApi'; import { graphicData } from 'src/protos/stationLayoutGraphics'; -import { state } from 'src/protos/ws_message'; +// import { state } from 'src/protos/ws_message'; import { RunLine, RunLineTemplate } from 'src/graphics/runLine/RunLine'; import { @@ -25,10 +25,10 @@ import { RectData } from './graphics/RectInteraction'; import { useLineNetStore } from 'src/stores/line-net-store'; import { toUint8Array } from 'js-base64'; -import { getWebsocketUrl } from 'src/configs/UrlManage'; -import { getJwtToken } from 'src/configs/TokenManage'; -import { alert } from 'src/protos/alertInfo'; -import { QNotifyUpdateOptions, Notify } from 'quasar'; +// import { getWebsocketUrl } from 'src/configs/UrlManage'; +// import { getJwtToken } from 'src/configs/TokenManage'; +// import { alert } from 'src/protos/alertInfo'; +// import { QNotifyUpdateOptions, Notify } from 'quasar'; let lineNetApp: GraphicApp | null = null; @@ -107,43 +107,43 @@ export async function loadLineNetDatas(app: GraphicApp) { pathLineList.forEach((pathLine) => { pathLine.visible = false; }); - app.enableWsMassaging({ - wsUrl: `${getWebsocketUrl()}`, - token: getJwtToken() as string, - }); - app.subscribe({ - destination: '/queue/lineNet', - messageConverter: (message: Uint8Array) => { - const storage = state.WsLineNetMessage.deserialize(message); - const states: GraphicState[] = []; - storage.offset.forEach((item) => { - states.push(new TrainLineState(item)); - }); - return states; - }, - }); - app.subscribe({ - destination: '/queue/xian/ncc/alert', - messageHandle: (message: Uint8Array) => { - const storage = alert.NccAlertInfoMessage.deserialize(message); - lineNetStore.setAlarmInfo(storage.messages as []); - }, - }); - let msgNotify: null | ((props?: QNotifyUpdateOptions | undefined) => void) = - null; - app.on('websocket-connect-state-change', (connected) => { - if (!connected && !msgNotify) { - msgNotify = Notify.create({ - type: 'negative', - timeout: 0, - position: 'top-right', - message: '通信链接已断开!', - }); - } else if (msgNotify && connected) { - msgNotify(); - msgNotify = null; - } - }); + // app.enableWsMassaging({ + // wsUrl: `${getWebsocketUrl()}`, + // token: getJwtToken() as string, + // }); + // app.subscribe({ + // destination: '/queue/lineNet', + // messageConverter: (message: Uint8Array) => { + // const storage = state.WsLineNetMessage.deserialize(message); + // const states: GraphicState[] = []; + // storage.offset.forEach((item) => { + // states.push(new TrainLineState(item)); + // }); + // return states; + // }, + // }); + // app.subscribe({ + // destination: '/queue/xian/ncc/alert', + // messageHandle: (message: Uint8Array) => { + // const storage = alert.NccAlertInfoMessage.deserialize(message); + // lineNetStore.setAlarmInfo(storage.messages as []); + // }, + // }); + // let msgNotify: null | ((props?: QNotifyUpdateOptions | undefined) => void) = + // null; + // app.on('websocket-connect-state-change', (connected) => { + // if (!connected && !msgNotify) { + // msgNotify = Notify.create({ + // type: 'negative', + // timeout: 0, + // position: 'top-right', + // message: '通信链接已断开!', + // }); + // } else if (msgNotify && connected) { + // msgNotify(); + // msgNotify = null; + // } + // }); } else { app.loadGraphic([]); }