| | |
| | | '': '', |
| | | '': '', |
| | | '': '', |
| | | 'map.sensor.type.shelf': 'Shelf', |
| | | 'map.sensor.type.agv': 'Agv', |
| | | '': '', |
| | | '': '', |
| | | '': '', |
| | | '': '', |
| | | '': '', |
| | |
| | | const { styles } = useStyles(); |
| | | const mapRef = React.useRef(); |
| | | const contentRef = React.useRef(); |
| | | const sensorTypeSelectOptions = Utils.sensorTypeSelectOptions(intl); |
| | | |
| | | const [model, setModel] = React.useState(() => MapModel.OBSERVER_MODEL); |
| | | const [deviceVisible, setDeviceVisible] = React.useState(false); |
| | |
| | | <Header className={styles.header}> |
| | | <Row style={{ height: '100%' }}> |
| | | <Col className={styles.headerCol} span={12} style={{}}> |
| | | |
| | | <Select |
| | | className='map-header-select' |
| | | variant='filled' |
| | | defaultValue="agv" |
| | | style={{ |
| | | width: 160, |
| | | }} |
| | | size={'large'} |
| | | options={sensorTypeSelectOptions} |
| | | defaultValue={sensorTypeSelectOptions?.[0]?.value} |
| | | onChange={(value, option) => { |
| | | console.log(value, option); |
| | | }} |
| | | options={[ |
| | | { |
| | | value: 'agv', |
| | | label: 'agv', |
| | | }, |
| | | { |
| | | value: 'crn', |
| | | label: 'crn', |
| | | }, |
| | | ]} |
| | | /> |
| | | <AutoComplete |
| | | className='map-header-select' |
| | |
| | | }) |
| | | |
| | | export const SENSOR_TYPE = Object.freeze({ |
| | | AGV: "AGV", |
| | | SHELF: "SHELF", |
| | | AGV: "AGV", |
| | | }) |
| | | |
| | | export const getRealPosition = (x, y, mapContainer) => { |
| | |
| | | } else { |
| | | return ''; |
| | | } |
| | | } |
| | | |
| | | export const sensorTypeSelectOptions = (intl) => { |
| | | let options = []; |
| | | Object.entries(SENSOR_TYPE).forEach(([key, value]) => { |
| | | switch (key) { |
| | | case SENSOR_TYPE.SHELF: |
| | | options.push({ |
| | | value: value, |
| | | label: intl.formatMessage({ id: 'map.sensor.type.shelf', defaultMessage: '货架' }) |
| | | }) |
| | | break; |
| | | case SENSOR_TYPE.AGV: |
| | | options.push({ |
| | | value: value, |
| | | label: intl.formatMessage({ id: 'map.sensor.type.agv', defaultMessage: '无人小车' }) |
| | | }) |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | }) |
| | | return options; |
| | | } |