#
luxiaotao1123
2024-03-16 990fd250989b0425a9026635ca0dbb062b1f7e9e
#
2个文件已修改
44 ■■■■ 已修改文件
zy-asrs-flow/src/pages/map/header/search.jsx 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/map/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/map/header/search.jsx
@@ -60,7 +60,14 @@
const MapSearch = (props) => {
    const intl = useIntl();
    const { curSprite: curSensor, setCurSPrite: setCurSensor } = props;
    const {
        curSprite: curSensor,
        setCurSPrite: setCurSensor,
        setSpriteBySettings,
        model,
        setModel,
        ModelEnum,
    } = props;
    const sensorTypeSelectOptions = sensorTypeSelectOptionsFn(intl);
    const [curSensorType, setCurSensorType] = React.useState(sensorTypeSelectOptions?.[0]?.value);
@@ -86,6 +93,28 @@
            setFilterSensorList(sensorList.filter(item => item.value.includes(curSensorLabel)));
        }
    }, [curSensorLabel])
    const onSecondSelect = (value, option) => {
        const uuid = option.label?.props?.children?.[1].props.children;
        const selectSensor = Utils.findSpriteByUuid(uuid);
        if (selectSensor) {
            Utils.beCenter(selectSensor);
        }
        switch (model) {
            case ModelEnum.OBSERVER_MODEL:
                setCurSensor(selectSensor);
                break;
            case ModelEnum.MOVABLE_MODEL:
                setModel(ModelEnum.SETTINGS_MODEL);
                setSpriteBySettings(selectSensor);
                break;
            case ModelEnum.SETTINGS_MODEL:
                setSpriteBySettings(selectSensor);
                break;
            default:
                break;
        }
    }
    return (
        <>
@@ -114,14 +143,7 @@
                popupMatchSelectWidth={500}
                options={filterSensorList}
                value={curSensorLabel}
                onSelect={(value, option) => {
                    const uuid = option.label?.props?.children?.[1].props.children;
                    const selectSensor = Utils.findSpriteByUuid(uuid);
                    setCurSensor(selectSensor);
                    if (selectSensor) {
                        Utils.beCenter(selectSensor);
                    }
                }}
                onSelect={onSecondSelect}
                onChange={setCurSensorLabel}
            />
        </>
zy-asrs-flow/src/pages/map/index.jsx
@@ -245,8 +245,12 @@
                        <Col className={styles.headerCol} span={12} style={{}}>
                            {dataFetched && (
                                <MapSearch
                                    model={model}
                                    setModel={setModel}
                                    ModelEnum={MapModel}
                                    curSprite={curSprite}
                                    setCurSPrite={setCurSPrite}
                                    setSpriteBySettings={setSpriteBySettings}
                                />
                            )}
                        </Col>