| | |
| | | 'map.save': 'Save Map', |
| | | 'map.load': 'Load Map', |
| | | 'map.clear': 'Clear Map', |
| | | 'map.load.success': 'Welcome To WCS.', |
| | | '': '', |
| | | '': '', |
| | | '': '', |
| | |
| | | import * as React from 'react' |
| | | import * as PIXI from 'pixi.js'; |
| | | import { FormattedMessage, useIntl, useModel } from '@umijs/max'; |
| | | import { Layout, Button, Flex, Row, Col, FloatButton, Select, Spin, AutoComplete } from 'antd'; |
| | | import { Layout, Button, Flex, Row, Col, FloatButton, Select, notification } from 'antd'; |
| | | const { Header, Content } = Layout; |
| | | import { |
| | | AppstoreAddOutlined, |
| | |
| | | const Map = () => { |
| | | const intl = useIntl(); |
| | | const { initialState, setInitialState } = useModel('@@initialState'); |
| | | const [notify, contextHolder] = notification.useNotification(); |
| | | const { styles } = useStyles(); |
| | | const mapRef = React.useRef(); |
| | | const contentRef = React.useRef(); |
| | |
| | | setMapContainer(player.mapContainer); |
| | | Utils.syncApp(player.app); |
| | | Utils.syncMapContainer(player.mapContainer); |
| | | Utils.syncNotify(notify); |
| | | |
| | | const handleResize = () => { |
| | | setWindowSize({ |
| | |
| | | setModel(MapModel.OBSERVER_MODEL) |
| | | setTimeout(() => { |
| | | player.adaptScreen(); |
| | | Utils.mapNotify(intl.formatMessage({ id: 'map.load.success', defaultMessage: '欢迎使用WCS系统' })); |
| | | }, 200) |
| | | } |
| | | initialize(); |
| | |
| | | |
| | | return ( |
| | | <> |
| | | {contextHolder} |
| | | <Layout className={styles.layout}> |
| | | <Header className={styles.header}> |
| | | <Row style={{ height: '100%' }}> |
| | |
| | | |
| | | let app = null; |
| | | let mapContainer = null; |
| | | let notify = null; |
| | | let effectTick, effectHalfCircle, effectRectangle; |
| | | |
| | | export function syncApp(param) { |
| | |
| | | |
| | | export function syncMapContainer(param) { |
| | | mapContainer = param; |
| | | } |
| | | |
| | | export function syncNotify(param) { |
| | | notify = param; |
| | | } |
| | | |
| | | export function getMapContainer() { |
| | |
| | | |
| | | new TWEEDLE.Tween(mapContainer.position).easing(TWEEDLE.Easing.Quadratic.Out) |
| | | .to(targetPos, 500).start(); |
| | | } |
| | | |
| | | export const mapNotify = (msg) => { |
| | | notify.open({ |
| | | description: msg, |
| | | duration: 1.5, |
| | | style: { width: 300 }, |
| | | placement: 'bottom', |
| | | closeIcon: false, |
| | | onClick: () => { } |
| | | }); |
| | | } |