| | |
| | | } from '@ant-design/icons'; |
| | | import './index.css' |
| | | import { createStyles } from 'antd-style'; |
| | | import Edit from './components/edit' |
| | | import Edit from './components/device' |
| | | import * as Utils from './utils' |
| | | import Player from './player'; |
| | | |
| | |
| | | const mapRef = React.useRef(); |
| | | const contentRef = React.useRef(); |
| | | |
| | | const [editModalVisible, setEditModalVisible] = React.useState(false); |
| | | const [deviceVisible, setDeviceVisible] = React.useState(false); |
| | | const [windowSize, setWindowSize] = React.useState({ |
| | | width: window.innerWidth, |
| | | height: window.innerHeight, |
| | |
| | | }, [app, mapContainer, windowSize]) |
| | | |
| | | const editHandle = () => { |
| | | setEditModalVisible(true); |
| | | } |
| | | |
| | | const onDrop = (sprite, x, y) => { |
| | |
| | | </Flex> |
| | | </Col> |
| | | </Row> |
| | | |
| | | |
| | | </Header> |
| | | <Content ref={contentRef} className={styles.content}> |
| | | <div ref={mapRef} style={{ position: "relative" }} /> |
| | |
| | | <FloatButton |
| | | tooltip={<div><FormattedMessage id='map.edit' defaultMessage='编辑地图' /></div>} |
| | | icon={<FileAddOutlined />} |
| | | onClick={editHandle} |
| | | onClick={() => { |
| | | setDeviceVisible(true); |
| | | }} |
| | | /> |
| | | </FloatButton.Group> |
| | | </Content> |
| | | </Layout> |
| | | |
| | | <Edit |
| | | open={editModalVisible} |
| | | open={deviceVisible} |
| | | onCancel={() => { |
| | | setEditModalVisible(false); |
| | | setDeviceVisible(false); |
| | | }} |
| | | refCurr={mapRef.current} |
| | | onDrop={onDrop} |