#
luxiaotao1123
2024-03-14 491afee13734c9acc672802cd6d80ead53337c3e
#
1个文件已修改
32 ■■■■ 已修改文件
zy-asrs-flow/src/pages/map/header/search.jsx 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/map/header/search.jsx
@@ -57,6 +57,15 @@
    const [curSensorLabel, setCurSensorLabel] = React.useState(null);
    useEffect(() => {
        const intervalID = setInterval(() => {
            if (!curSensorLabel) {
                let sensorListAll = updateSensorList();
                setSensorList(sensorListAll);
                setFilterSensorList(sensorListAll);
            }
        }, 1000)
        return () => clearInterval(intervalID);
    }, [props]);
    // first select
@@ -64,15 +73,7 @@
        if (!Utils.getMapContainer()) {
            return
        }
        let sensorListAll = [];
        Utils.getMapContainer().children.forEach(child => {
            if (child?.data?.type === curSensorType && child?.data?.no) {
                sensorListAll.push({
                    value: child.data.no,
                    label: renderTitle(child.data.no, child.data.uuid)
                })
            }
        });
        let sensorListAll = updateSensorList();
        setSensorList(sensorListAll);
        setFilterSensorList(sensorListAll);
        setCurSensorLabel(null);
@@ -88,6 +89,19 @@
        }
    }, [curSensorLabel])
    function updateSensorList() {
        let sensorListAll = [];
        Utils.getMapContainer().children.forEach(child => {
            if (child?.data?.type === curSensorType && child?.data?.no) {
                sensorListAll.push({
                    value: child.data.no,
                    label: renderTitle(child.data.no, child.data.uuid)
                })
            }
        });
        return sensorListAll;
    }
    return (
        <>
            <Select