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

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

diff --git a/zy-asrs-flow/src/pages/map/header/search.jsx b/zy-asrs-flow/src/pages/map/header/search.jsx
index 3d2a7df..53813b7 100644
--- a/zy-asrs-flow/src/pages/map/header/search.jsx
+++ b/zy-asrs-flow/src/pages/map/header/search.jsx
@@ -12,13 +12,25 @@
     const sensorTypeSelectOptions = Utils.sensorTypeSelectOptions(intl);
 
     const [curSensorType, setCurSensorType] = React.useState(sensorTypeSelectOptions?.[0]?.value);
+    const [sensorList, setSensorList] = React.useState([]);
+    const [curSensor, setCurSensor] = React.useState(null);
 
     useEffect(() => {
     }, [props]);
 
     React.useEffect(() => {
+        setSensorList([]);
+        setCurSensor(null);
         switch (curSensorType) {
             case Utils.SENSOR_TYPE.SHELF:
+                Utils.getMapContainer().children.forEach(child => {
+                    if (child?.data?.type === Utils.SENSOR_TYPE.SHELF) {
+                        setSensorList(prevArr => [...prevArr, {
+                            value: child.data.uuid,
+                            label: child.data.uuid
+                        }]);
+                    }
+                })
                 break;
             case Utils.SENSOR_TYPE.AGV:
                 break;
@@ -26,6 +38,10 @@
                 break;
         }
     }, [curSensorType])
+
+    React.useEffect(() => {
+        
+    }, [curSensor])
 
     return (
         <>
@@ -52,14 +68,9 @@
                     clearIcon: <CloseOutlined />
                 }}
                 onSearch={() => { }}
-                options={[
-                    {
-                        value: 'text 1',
-                    },
-                    {
-                        value: 'text 2',
-                    },
-                ]}
+                options={sensorList}
+                value={curSensor}
+                onChange={setCurSensor}
             />
         </>
     )

--
Gitblit v1.9.1