| | |
| | | ) |
| | | }) |
| | | break; |
| | | case Utils.SENSOR_TYPE.SHUTTLE: |
| | | options.push({ |
| | | value: value, |
| | | label: |
| | | ( |
| | | <> |
| | | <span style={{ fontWeight: 'bold' }} >{intl.formatMessage({ id: 'map.sensor.type.shuttle', defaultMessage: '穿梭车' })}</span> |
| | | </> |
| | | ) |
| | | }) |
| | | break; |
| | | case Utils.SENSOR_TYPE.AGV: |
| | | options.push({ |
| | | value: value, |
| | |
| | | const [filterSensorList, setFilterSensorList] = React.useState([]); |
| | | const [curSensorLabel, setCurSensorLabel] = React.useState(null); |
| | | |
| | | // first select |
| | | React.useEffect(() => { |
| | | if (!Utils.getMapContainer()) { return; } |
| | | const resetSearch = () => { |
| | | let sensorListAll = getAllSensorList(curSensorType); |
| | | setSensorList(sensorListAll); |
| | | setFilterSensorList(sensorListAll); |
| | | setCurSensorLabel(null); |
| | | }, [curSensorType]) |
| | | } |
| | | |
| | | // second select |
| | | // first select and switch floor |
| | | React.useEffect(() => { |
| | | if (!Utils.getMapContainer()) { return } |
| | | setTimeout(() => { |
| | | resetSearch(); |
| | | }, 200) |
| | | }, [curSensorType, props.curFloor]) |
| | | |
| | | // second select condition |
| | | React.useEffect(() => { |
| | | if (!Utils.getMapContainer()) { return; } |
| | | if ((curSensorLabel !== null || curSensorLabel != undefined) |
| | |
| | | break; |
| | | case ModelEnum.MOVABLE_MODEL: |
| | | setModel(ModelEnum.SETTINGS_MODEL); |
| | | setSpriteBySettings(selectSensor); |
| | | // avoid model modify which will clear spriteBySettings |
| | | setTimeout(() => { |
| | | setSpriteBySettings(selectSensor); |
| | | }, 200) |
| | | break; |
| | | case ModelEnum.SETTINGS_MODEL: |
| | | setSpriteBySettings(selectSensor); |