| | |
| | | import * as React from 'react' |
| | | import * as PIXI from 'pixi.js'; |
| | | import * as TWEEDLE from 'tweedle.js'; |
| | | import { FormattedMessage, useIntl, useModel } from '@umijs/max'; |
| | | import { Layout, Button, Flex, Row, Col, FloatButton, Select, notification, Segmented } from 'antd'; |
| | | const { Header, Content } = Layout; |
| | |
| | | const storedValue = localStorage.getItem('curFloor'); |
| | | return storedValue !== null ? JSON.parse(storedValue) : null; |
| | | }); |
| | | const curFloorRef = React.useRef(curFloor); |
| | | const [batchSprites, setBatchSprites] = React.useState([]); |
| | | const [batchDrawerVisible, setBatchDrawerVisible] = React.useState(false); |
| | | |
| | |
| | | |
| | | websocket = new WebSocketClient('/ws/map/websocket'); |
| | | websocket.connect(); |
| | | websocket.onMessage = Utils.updateMapStatusInRealTime; |
| | | websocket.onMessage = (data) => { |
| | | Utils.updateMapStatusInRealTime(data, () => curFloorRef.current); |
| | | } |
| | | |
| | | const handleResize = () => { |
| | | setWindowSize({ |
| | |
| | | |
| | | // watch curFloor |
| | | React.useEffect(() => { |
| | | curFloorRef.current = curFloor; |
| | | if (!mapContainer && !dataFetched) { |
| | | return; |
| | | } |