From 467d7518ae2ce3ca22337ca60dceb8ce709915cf Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期三, 20 三月 2024 15:42:47 +0800
Subject: [PATCH] #

---
 zy-asrs-flow/src/locales/en-US/map.ts |    1 +
 zy-asrs-flow/src/pages/map/index.jsx  |    6 +++++-
 zy-asrs-flow/src/pages/map/utils.js   |   16 ++++++++++++++++
 3 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/zy-asrs-flow/src/locales/en-US/map.ts b/zy-asrs-flow/src/locales/en-US/map.ts
index b9d01d3..8e3c29d 100644
--- a/zy-asrs-flow/src/locales/en-US/map.ts
+++ b/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.',
     '': '',
     '': '',
     '': '',
diff --git a/zy-asrs-flow/src/pages/map/index.jsx b/zy-asrs-flow/src/pages/map/index.jsx
index 0d84c56..9b94472 100644
--- a/zy-asrs-flow/src/pages/map/index.jsx
+++ b/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%' }}>
diff --git a/zy-asrs-flow/src/pages/map/utils.js b/zy-asrs-flow/src/pages/map/utils.js
index b089a48..9408f1b 100644
--- a/zy-asrs-flow/src/pages/map/utils.js
+++ b/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: () => { }
+    });
 }
\ No newline at end of file

--
Gitblit v1.9.1