#
luxiaotao1123
2024-03-14 ca767633a3e8414661138720a68cc41a435a4afe
#
3个文件已修改
45 ■■■■ 已修改文件
zy-asrs-flow/src/locales/en-US/map.ts 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/map/index.jsx 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/map/utils.js 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/locales/en-US/map.ts
@@ -9,6 +9,10 @@
    '': '',
    '': '',
    '': '',
    'map.sensor.type.shelf': 'Shelf',
    'map.sensor.type.agv': 'Agv',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
zy-asrs-flow/src/pages/map/index.jsx
@@ -64,6 +64,7 @@
    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);
@@ -212,28 +213,18 @@
                <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'
zy-asrs-flow/src/pages/map/utils.js
@@ -21,8 +21,8 @@
})
export const SENSOR_TYPE = Object.freeze({
    AGV: "AGV",
    SHELF: "SHELF",
    AGV: "AGV",
})
export const getRealPosition = (x, y, mapContainer) => {
@@ -248,4 +248,28 @@
    } 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;
}