#
luxiaotao1123
2024-03-14 6df379eb947bf93ad269315aaa75974edf8e8182
#
1个文件已修改
27 ■■■■ 已修改文件
zy-asrs-flow/src/pages/map/header/search.jsx 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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}
            />
        </>
    )