From d58639159104c0cb71c6c907b2f7cfe6b33a3655 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期二, 15 十月 2024 17:07:24 +0800 Subject: [PATCH] # --- zy-acs-flow/src/map/header/MapSearch.jsx | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/zy-acs-flow/src/map/header/MapSearch.jsx b/zy-acs-flow/src/map/header/MapSearch.jsx index 3a866e5..cb867d1 100644 --- a/zy-acs-flow/src/map/header/MapSearch.jsx +++ b/zy-acs-flow/src/map/header/MapSearch.jsx @@ -1,4 +1,3 @@ -// MapSearch.js import React, { useState, useEffect } from 'react'; import { Select, @@ -19,10 +18,10 @@ const deviceTypeSelectOptionsFn = (translate) => { const deviceTypes = [ { key: DEVICE_TYPE.SHELF, id: 'page.map.devices.shelf' }, - { key: DEVICE_TYPE.STATION, id: 'page.map.devices.station' }, { 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 }) => ({ @@ -35,6 +34,7 @@ const { mode, setMode, + dataFetched, curZone, setCurSprite, setSpriteSettings, @@ -59,11 +59,10 @@ }; useEffect(() => { - if (!Tool.getMapContainer()) return; - setTimeout(() => { + if (dataFetched) { resetSearch(); - }, 200); - }, [curDeviceType, curZone]); + } + }, [curDeviceType, dataFetched, curZone]); useEffect(() => { if (!Tool.getMapContainer()) return; @@ -195,6 +194,7 @@ onInputChange={(event, newInputValue) => { setInputValue(newInputValue); }} + disableClearable /> </Stack> ); -- Gitblit v1.9.1