import React, { useState, useRef, useEffect } from 'react';
|
import { Drawer, Space, Button } from 'antd';
|
import { FormattedMessage, useIntl, useModel } from '@umijs/max';
|
import { createStyles } from 'antd-style';
|
import * as Utils from '../utils'
|
import ShelfDrawer from './shelf';
|
import AgvDrawer from './agv';
|
import PointDrawer from './point'
|
|
const useStyles = createStyles(({ token, css }) => {
|
|
})
|
|
const MapDrawer = (props) => {
|
const intl = useIntl();
|
const { styles } = useStyles();
|
const { curSprite } = props;
|
|
const handleCancel = () => {
|
props.onCancel();
|
};
|
|
return (
|
<>
|
<Drawer
|
open={props.open}
|
onClose={handleCancel}
|
getContainer={props.refCurr}
|
rootStyle={{ position: "absolute" }}
|
mask={false}
|
width={600}
|
style={{
|
opacity: .8
|
}}
|
extra={
|
<Space>
|
<Button onClick={handleCancel}>
|
<FormattedMessage id='common.cancel' defaultMessage='取消' />
|
</Button>
|
</Space>
|
}
|
>
|
{props.curSprite?.data?.type === Utils.SENSOR_TYPE.SHELF && (
|
<>
|
<ShelfDrawer
|
curSprite={curSprite}
|
/>
|
</>
|
)}
|
{props.curSprite?.data?.type === Utils.SENSOR_TYPE.POINT && (
|
<>
|
<PointDrawer
|
curSprite={curSprite}
|
/>
|
</>
|
)}
|
{props.curSprite?.data?.type === Utils.SENSOR_TYPE.AGV && (
|
<>
|
<AgvDrawer
|
curSprite={curSprite}
|
/>
|
</>
|
)}
|
</Drawer>
|
</>
|
)
|
}
|
|
export default MapDrawer;
|