From ed52bc840f6a10b7067ff4004d41b2da70869337 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 14 三月 2024 19:53:53 +0800
Subject: [PATCH] #

---
 zy-asrs-flow/src/pages/map/header/search.jsx |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/zy-asrs-flow/src/pages/map/header/search.jsx b/zy-asrs-flow/src/pages/map/header/search.jsx
index 1fd0e26..5daa259 100644
--- a/zy-asrs-flow/src/pages/map/header/search.jsx
+++ b/zy-asrs-flow/src/pages/map/header/search.jsx
@@ -69,17 +69,17 @@
     const [filterSensorList, setFilterSensorList] = React.useState([]);
     const [curSensorLabel, setCurSensorLabel] = React.useState(null);
 
-    useEffect(() => {
-        const intervalID = setInterval(() => {
-            if (!curSensorLabel) {
-                let sensorListAll = getAllSensorList(curSensorType);
-                setSensorList(sensorListAll);
-                setFilterSensorList(sensorListAll);
-            }
-        }, 1000)
+    // useEffect(() => {
+    //     const intervalID = setInterval(() => {
+    //         if (!curSensorLabel) {
+    //             let sensorListAll = getAllSensorList(curSensorType);
+    //             setSensorList(sensorListAll);
+    //             setFilterSensorList(sensorListAll);
+    //         }
+    //     }, 1000)
 
-        return () => clearInterval(intervalID);
-    }, [props]);
+    //     return () => clearInterval(intervalID);
+    // }, [props]);
 
     // first select
     React.useEffect(() => {
@@ -93,7 +93,7 @@
     // second select
     React.useEffect(() => {
         if (!Utils.getMapContainer()) { return; }
-        if (sensorList && sensorList.length > 0) {
+        if (curSensorLabel && sensorList && sensorList.length > 0) {
             setFilterSensorList(sensorList.filter(item => item.value.includes(curSensorLabel)));
         }
     }, [curSensorLabel])
@@ -126,7 +126,7 @@
                 options={filterSensorList}
                 value={curSensorLabel}
                 onSelect={(value, option) => {
-                    const uuid = option.label?.props?.children?.[1].props.children
+                    const uuid = option.label?.props?.children?.[1].props.children;
                     setCurSensor(Utils.findSpriteByUuid(uuid));
                 }}
                 onChange={setCurSensorLabel}

--
Gitblit v1.9.1