From 0d5321b4a070862fc9862af9ca17251b1f441c4b Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期二, 15 十月 2024 14:01:58 +0800 Subject: [PATCH] # --- zy-acs-flow/src/map/MapPage.jsx | 24 ++++++++++++++---------- 1 files changed, 14 insertions(+), 10 deletions(-) diff --git a/zy-acs-flow/src/map/MapPage.jsx b/zy-acs-flow/src/map/MapPage.jsx index b34c92c..73f59a0 100644 --- a/zy-acs-flow/src/map/MapPage.jsx +++ b/zy-acs-flow/src/map/MapPage.jsx @@ -31,7 +31,7 @@ import WebSocketClient from './websocket' import ConfirmButton from "../page/components/ConfirmButton"; import { FitScreen } from '@mui/icons-material'; - +import MapSearch from "./header/MapSearch"; let player; let websocket; @@ -80,20 +80,18 @@ Tool.setThemeMode(themeMode); Http.setNotify(notify); Http.setMapContainer(player.mapContainer); - // websocket = new WebSocketClient('/ws/map/websocket'); + websocket = new WebSocketClient('/ws/map/websocket'); await Http.fetchMapData(); + websocket.connect(); + websocket.onMessage = (wsMsg) => { + Tool.generateDynamicGraphic(curZone, JSON.parse(wsMsg)); + } setTimeout(() => { player.adaptScreen(); notify.info(translate('page.map.welcome')); }, 200) - - // websocket.connect(); - // websocket.onMessage = (data) => { - // Tool.updateMapStatusInRealTime(data, () => curFloorRef.current, setCurSPrite); - // } - } initialize(); @@ -251,7 +249,13 @@ boxShadow: theme.shadows[1], }} > - <TextField + <MapSearch + mode={mode} + setMode={setMode} + curZone={curZone} + setSpriteSettings={setSpriteSettings} + /> + {/* <TextField variant="outlined" size="small" placeholder="鎼滅储..." @@ -260,7 +264,7 @@ backgroundColor: theme.palette.background.paper, borderRadius: 1, }} - /> + /> */} <Box sx={{ flexGrow: 1 }} /> {mode === MAP_MODE.OBSERVER_MODE && ( -- Gitblit v1.9.1