From bb61bc0c22ae4ef9963ca00d23b5cf0c412f26f5 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期六, 12 十月 2024 14:47:35 +0800
Subject: [PATCH] #

---
 zy-acs-flow/src/map/MapPage.jsx |   31 +++++++++++++++++++++++++++++--
 1 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/zy-acs-flow/src/map/MapPage.jsx b/zy-acs-flow/src/map/MapPage.jsx
index cf185ce..f99eaf5 100644
--- a/zy-acs-flow/src/map/MapPage.jsx
+++ b/zy-acs-flow/src/map/MapPage.jsx
@@ -66,9 +66,10 @@
             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();
             // websocket.connect();
             // websocket.onMessage = (data) => {
             //     Tool.updateMapStatusInRealTime(data, () => curFloorRef.current, setCurSPrite);
@@ -244,6 +245,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 +274,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