From 4ee0610b0088b35f7f48b020b807453e28297b45 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 10 十月 2024 13:43:16 +0800
Subject: [PATCH] #

---
 zy-acs-flow/src/map/MapPage.jsx |   28 ++++++++++++++++++++++++----
 1 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/zy-acs-flow/src/map/MapPage.jsx b/zy-acs-flow/src/map/MapPage.jsx
index a2335b3..1839aef 100644
--- a/zy-acs-flow/src/map/MapPage.jsx
+++ b/zy-acs-flow/src/map/MapPage.jsx
@@ -22,7 +22,9 @@
 import Player from './player';
 import * as Tool from './tool';
 import { NotificationProvider, useNotification } from './Notification';
+import Insight from "./insight";
 import Device from "./Device";
+import Settings from "./settings";
 import * as Http from './http';
 
 let player;
@@ -39,6 +41,7 @@
     const [mapContainer, setMapContainer] = useState(null);
 
     const [mode, setMode] = useState(MapMode.OBSERVER_MODE);
+    const [insightVisible, setInsightVisible] = useState(false);
     const [deviceVisible, setDeviceVisible] = useState(false);
     const [settingsVisible, setSettingsVisible] = useState(false);
 
@@ -81,9 +84,15 @@
     }, [themeMode])
 
     const switchMode = (mode) => {
+        Tool.removeSelectedEffect();
+
+        setDeviceVisible(false);
+        setSettingsVisible(false);
+
+        setSpriteSettings(null);
+
         switch (mode) {
             case MapMode.OBSERVER_MODE:
-                setDeviceVisible(false);
                 player.hideGridLines();
 
                 player.activateMapMultiSelect((selectedSprites, restartFn) => {
@@ -102,7 +111,6 @@
                 break
             case MapMode.SETTINGS_MODE:
                 player.hideGridLines();
-                setDeviceVisible(false);
 
                 player.activateMapMultiSelect((selectedSprites, restartFn) => {
                     console.log(selectedSprites);
@@ -139,8 +147,6 @@
         if (!mapContainer) {
             return;
         }
-        console.log(spriteSettings);
-
         prevSpriteSettingsRef.current = spriteSettings;
         if (spriteSettings && prevSpriteSettings !== spriteSettings) {
             Tool.removeSelectedEffect();
@@ -288,6 +294,13 @@
                 </SpeedDial>
             </Box>
 
+            <Insight
+                open={insightVisible}
+                onCancel={() => {
+                    setInsightVisible(false);
+                }}
+            />
+
             <Device
                 open={deviceVisible}
                 onCancel={() => {
@@ -297,6 +310,13 @@
                 width={378}
             />
 
+            <Settings
+                open={settingsVisible}
+                onCancel={() => {
+                    setSettingsVisible(false);
+                }}
+            />
+
         </Box>
     );
 }

--
Gitblit v1.9.1