#
luxiaotao1123
2024-10-16 790a8230d49ebc927e864a96afbd5607b9656e09
zy-acs-flow/src/map/header/MapSearch.jsx
@@ -1,4 +1,3 @@
// MapSearch.js
import React, { useState, useEffect } from 'react';
import {
    Select,
@@ -22,7 +21,7 @@
        { key: DEVICE_TYPE.AGV, id: 'page.map.devices.agv' },
        { key: DEVICE_TYPE.STATION, id: 'page.map.devices.station' },
        { key: DEVICE_TYPE.POINT, id: 'page.map.devices.point' },
        // 添加其他设备类型
        // ... other devices
    ];
    return deviceTypes.map(({ key, id }) => ({
@@ -37,7 +36,9 @@
        setMode,
        dataFetched,
        curZone,
        curSprite,
        setCurSprite,
        spriteSettings,
        setSpriteSettings,
    } = props;
@@ -64,6 +65,11 @@
            resetSearch();
        }
    }, [curDeviceType, dataFetched, curZone]);
    useEffect(() => {
        console.log(1);
    }, [curSprite, spriteSettings]);
    useEffect(() => {
        if (!Tool.getMapContainer()) return;
@@ -139,10 +145,10 @@
                size="small"
                options={filterDeviceList}
                getOptionLabel={(option) => option.value}
                renderOption={(props, option) => {
                    const { key, ...otherProps } = props;
                renderOption={(optionProps, option) => {
                    const { key, ...otherProps } = optionProps;
                    return (
                        <li key={Number(key)} {...otherProps}>
                        <li key={option.uuid} {...otherProps}>
                            <Stack direction="row" justifyContent="space-between" width="100%">
                                <Typography variant="body1" fontWeight="bold">
                                    {option.label}