From 0effc9ada2eddfe75284c3eeb62e28de9a8ce658 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期六, 12 十月 2024 15:14:37 +0800 Subject: [PATCH] # --- zy-acs-flow/src/map/MapPage.jsx | 43 +++++++++++++++++++++++++++++++++++++++---- 1 files changed, 39 insertions(+), 4 deletions(-) diff --git a/zy-acs-flow/src/map/MapPage.jsx b/zy-acs-flow/src/map/MapPage.jsx index cf185ce..9ab4030 100644 --- a/zy-acs-flow/src/map/MapPage.jsx +++ b/zy-acs-flow/src/map/MapPage.jsx @@ -66,9 +66,16 @@ Tool.setMapContainer(player.mapContainer); Tool.setThemeMode(themeMode); Http.setNotify(notify); + Http.setMapContainer(player.mapContainer); // websocket = new WebSocketClient('/ws/map/websocket'); - await Http.fetchMapData(0); + await Http.fetchMapData(); + + setTimeout(() => { + player.adaptScreen(); + notify.info('Welcome to Rcs'); + }, 200) + // websocket.connect(); // websocket.onMessage = (data) => { // Tool.updateMapStatusInRealTime(data, () => curFloorRef.current, setCurSPrite); @@ -86,8 +93,6 @@ }; handleResize(); window.addEventListener('resize', handleResize); - - notify.info('Welcome to Rcs'); return () => { if (websocket) { @@ -132,6 +137,10 @@ restartFn(); }); }); + + mapContainer.children.forEach(child => { + Tool.beMovable(child); + }) break case MapMode.SETTINGS_MODE: player.hideGridLines(); @@ -244,6 +253,23 @@ {mode === MapMode.MOVABLE_MODE && ( <> <Button + variant="outlined" + sx={{ mr: 2 }} + onClick={() => { + Tool.clearMapData(); + }} + > + {translate('page.map.action.clear')} + </Button> + <ConfirmButton + label="page.map.action.save" + variant="contained" + sx={{ mr: 2 }} + onConfirm={() => { + Http.saveMapData(curZone); + }} + /> + <Button variant="contained" color="primary" sx={{ mr: 1 }} @@ -256,11 +282,20 @@ {mode === MapMode.SETTINGS_MODE && ( <> + <Button + variant="outlined" + sx={{ mr: 2 }} + onClick={() => { + Tool.clearMapData(); + }} + > + {translate('page.map.action.clear')} + </Button> <ConfirmButton label="page.map.action.save" variant="contained" onConfirm={() => { - Http.saveMapData(curZone, mapContainer); + Http.saveMapData(curZone); }} /> </> -- Gitblit v1.9.1