From cbd9fde3a2f8d4f5c45bea1a5215ad843e8dabc6 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期四, 10 十月 2024 14:32:45 +0800 Subject: [PATCH] # --- zy-acs-flow/src/map/MapPage.jsx | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/zy-acs-flow/src/map/MapPage.jsx b/zy-acs-flow/src/map/MapPage.jsx index 1839aef..283b0e0 100644 --- a/zy-acs-flow/src/map/MapPage.jsx +++ b/zy-acs-flow/src/map/MapPage.jsx @@ -26,8 +26,10 @@ import Device from "./Device"; import Settings from "./settings"; import * as Http from './http'; +import WebSocketClient from './websocket' let player; +let websocket; const Map = () => { const notify = useNotification(); @@ -58,8 +60,13 @@ Tool.setMapContainer(player.mapContainer); Tool.setThemeMode(themeMode); Http.setNotify(notify); + // websocket = new WebSocketClient('/ws/map/websocket'); await Http.fetchMapData(0); + // websocket.connect(); + // websocket.onMessage = (data) => { + // Tool.updateMapStatusInRealTime(data, () => curFloorRef.current, setCurSPrite); + // } } initialize(); @@ -77,6 +84,10 @@ notify('Welcome to Rcs', 'info'); return () => { + if (websocket) { + websocket.onMessage = () => { } + websocket.close(); + } player.destroy(); window.removeEventListener('resize', handleResize); Tool.patchRaLayout(''); @@ -299,6 +310,7 @@ onCancel={() => { setInsightVisible(false); }} + width={378} /> <Device @@ -313,8 +325,11 @@ <Settings open={settingsVisible} onCancel={() => { + setSpriteSettings(null); setSettingsVisible(false); }} + sprite={spriteSettings} + width={570} /> </Box> -- Gitblit v1.9.1