| | |
| | | // MapSearch.js |
| | | import React, { useState, useEffect } from 'react'; |
| | | import { |
| | | Select, |
| | |
| | | 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 }) => ({ |
| | |
| | | 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} |