From a673254db9bdc9e540b0b67b4ef63c0deb64916a Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期二, 15 十月 2024 13:59:23 +0800 Subject: [PATCH] # --- zy-acs-flow/src/map/MapPage.jsx | 38 +++++++++++++++++++------------------- 1 files changed, 19 insertions(+), 19 deletions(-) diff --git a/zy-acs-flow/src/map/MapPage.jsx b/zy-acs-flow/src/map/MapPage.jsx index f62c5b1..1d34847 100644 --- a/zy-acs-flow/src/map/MapPage.jsx +++ b/zy-acs-flow/src/map/MapPage.jsx @@ -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('Welcome to Rcs'); + notify.info(translate('page.map.welcome')); }, 200) - - // websocket.connect(); - // websocket.onMessage = (data) => { - // Tool.updateMapStatusInRealTime(data, () => curFloorRef.current, setCurSPrite); - // } - } initialize(); @@ -157,7 +155,7 @@ break case MAP_MODE.SETTINGS_MODE: player.hideGridLines(); - player.showStarryBackground(); // 0x2f68ac + // player.showStarryBackground(); // 0x2f68ac player.activateMapMultiSelect((selectedSprites, restartFn) => { setBatchSprites(selectedSprites); @@ -242,12 +240,13 @@ sx={{ display: 'flex', alignItems: 'center', - backgroundColor: '#f5f5f5', - color: '#000', + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, padding: '0 16px', height: '64px', flexShrink: 0, // keep height zIndex: 200, + boxShadow: theme.shadows[1], }} > <TextField @@ -256,7 +255,7 @@ placeholder="鎼滅储..." sx={{ width: '200px', - backgroundColor: '#fff', + backgroundColor: theme.palette.background.paper, borderRadius: 1, }} /> @@ -269,10 +268,10 @@ color="primary" sx={{ mr: 2 }} > - 鍋滄RCS杩愯浆 + {translate('page.map.action.startup')} </Button> <Button variant="contained" color="primary"> - 绯荤粺鎶ュ憡 + {translate('page.map.action.monitor')} </Button> </> )} @@ -299,7 +298,6 @@ <Button variant="contained" color="primary" - sx={{ mr: 1 }} onClick={() => setDeviceVisible(!deviceVisible)} > {translate('page.map.devices.title')} @@ -337,13 +335,14 @@ size="small" sx={{ ml: 2, - backgroundColor: '#fff', + backgroundColor: theme.palette.background.paper, + color: theme.palette.text.primary, borderRadius: 1, }} > - <MenuItem value={MAP_MODE.OBSERVER_MODE}>鐩戞帶妯″紡</MenuItem> - <MenuItem value={MAP_MODE.MOVABLE_MODE}>缂栬緫妯″紡</MenuItem> - <MenuItem value={MAP_MODE.SETTINGS_MODE}>閰嶇疆妯″紡</MenuItem> + <MenuItem value={MAP_MODE.OBSERVER_MODE}>{translate('page.map.mode.observer')}</MenuItem> + <MenuItem value={MAP_MODE.MOVABLE_MODE}>{translate('page.map.mode.movable')}</MenuItem> + <MenuItem value={MAP_MODE.SETTINGS_MODE}>{translate('page.map.mode.settings')}</MenuItem> </Select> </Box> {/* content */} @@ -442,6 +441,7 @@ <Batch open={batchSelectionVisible} onCancel={() => { + setBatchSprites([]); setBatchSelectionVisible(false); }} batchSprites={batchSprites} -- Gitblit v1.9.1