From 0254b3caa25819d038754baa58b03824303b5fa7 Mon Sep 17 00:00:00 2001
From: Junjie <xjj@123>
Date: 星期日, 07 四月 2024 08:35:55 +0800
Subject: [PATCH] #

---
 zy-asrs-flow/src/pages/map/index.jsx |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/zy-asrs-flow/src/pages/map/index.jsx b/zy-asrs-flow/src/pages/map/index.jsx
index 42904f1..a1c3cb2 100644
--- a/zy-asrs-flow/src/pages/map/index.jsx
+++ b/zy-asrs-flow/src/pages/map/index.jsx
@@ -8,13 +8,13 @@
     FileAddOutlined,
     CompressOutlined,
     SettingOutlined,
-    CloseOutlined
 } from '@ant-design/icons';
 import './index.css'
 import { createStyles } from 'antd-style';
 import Edit from './components/device';
 import Settings from './components/settings'
 import * as Utils from './utils'
+import WebSocketClient from './websocket'
 import Player from './player';
 import MapSearch from './header/search';
 import MapFloor from './header/floor';
@@ -60,7 +60,7 @@
     SETTINGS_MODEL: "3",
 })
 
-let player;
+let player, websocket;
 
 const Map = () => {
     const intl = useIntl();
@@ -102,6 +102,10 @@
             Utils.syncApp(player.app);
             Utils.syncMapContainer(player.mapContainer);
             Utils.syncNotify(notify);
+
+            websocket = new WebSocketClient('/ws/map/websocket');
+            websocket.connect();
+            websocket.onMessage = Utils.updateMapStatusInRealTime;
 
             const handleResize = () => {
                 setWindowSize({
@@ -432,6 +436,7 @@
             <MapDrawer
                 open={drawerVisible}
                 curSprite={curSprite}
+                curFloor={curFloor}
                 refCurr={mapRef.current}
                 onCancel={() => {
                     setCurSPrite(null);

--
Gitblit v1.9.1