#
luxiaotao1123
2024-03-20 467d7518ae2ce3ca22337ca60dceb8ce709915cf
#
3个文件已修改
23 ■■■■■ 已修改文件
zy-asrs-flow/src/locales/en-US/map.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/map/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/map/utils.js 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/locales/en-US/map.ts
@@ -8,6 +8,7 @@
    'map.save': 'Save Map',
    'map.load': 'Load Map',
    'map.clear': 'Clear Map',
    'map.load.success': 'Welcome To WCS.',
    '': '',
    '': '',
    '': '',
zy-asrs-flow/src/pages/map/index.jsx
@@ -1,7 +1,7 @@
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,
@@ -62,6 +62,7 @@
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();
@@ -91,6 +92,7 @@
            setMapContainer(player.mapContainer);
            Utils.syncApp(player.app);
            Utils.syncMapContainer(player.mapContainer);
            Utils.syncNotify(notify);
            const handleResize = () => {
                setWindowSize({
@@ -104,6 +106,7 @@
            setModel(MapModel.OBSERVER_MODEL)
            setTimeout(() => {
                player.adaptScreen();
                Utils.mapNotify(intl.formatMessage({ id: 'map.load.success', defaultMessage: '欢迎使用WCS系统' }));
            }, 200)
        }
        initialize();
@@ -241,6 +244,7 @@
    return (
        <>
            {contextHolder}
            <Layout className={styles.layout}>
                <Header className={styles.header}>
                    <Row style={{ height: '100%' }}>
zy-asrs-flow/src/pages/map/utils.js
@@ -9,6 +9,7 @@
let app = null;
let mapContainer = null;
let notify = null;
let effectTick, effectHalfCircle, effectRectangle;
export function syncApp(param) {
@@ -17,6 +18,10 @@
export function syncMapContainer(param) {
    mapContainer = param;
}
export function syncNotify(param) {
    notify = param;
}
export function getMapContainer() {
@@ -443,4 +448,15 @@
    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: () => { }
    });
}