From 8f2a4fd023a42d5f3b82a2a97b0c39d8bbee274d Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期三, 03 四月 2024 13:51:01 +0800
Subject: [PATCH] #

---
 zy-asrs-flow/src/pages/map/index.jsx |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/zy-asrs-flow/src/pages/map/index.jsx b/zy-asrs-flow/src/pages/map/index.jsx
index 5709878..987f5d2 100644
--- a/zy-asrs-flow/src/pages/map/index.jsx
+++ b/zy-asrs-flow/src/pages/map/index.jsx
@@ -8,14 +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 * as Websocket from './websocket'
+import WebSocketClient from './websocket'
 import Player from './player';
 import MapSearch from './header/search';
 import MapFloor from './header/floor';
@@ -61,7 +60,7 @@
     SETTINGS_MODEL: "3",
 })
 
-let player;
+let player, websocket;
 
 const Map = () => {
     const intl = useIntl();
@@ -104,6 +103,13 @@
             Utils.syncMapContainer(player.mapContainer);
             Utils.syncNotify(notify);
 
+            websocket = new WebSocketClient('/ws/map/websocket');
+            websocket.connect();
+
+            setInterval(() => {
+                websocket.sendMessage('asds')
+            }, 1000)
+
             const handleResize = () => {
                 setWindowSize({
                     width: window.innerWidth,
@@ -123,10 +129,9 @@
                 player.adaptScreen();
                 Utils.mapNotify(intl.formatMessage({ id: 'map.load.success', defaultMessage: '娆㈣繋浣跨敤WCS绯荤粺' }));
             }, 200)
-
-            Websocket.createWs();
         }
         initialize();
+        console.log(1);
     }, []);
 
     // resize

--
Gitblit v1.9.1