From d993d5030b00c7a12e126c727a47883bf311ec5b Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期一, 04 三月 2024 11:21:54 +0800
Subject: [PATCH] #

---
 zy-asrs-flow/src/pages/map/index.jsx             |   15 +++++++--------
 zy-asrs-flow/src/pages/map/components/device.jsx |    4 ++--
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/zy-asrs-flow/src/pages/map/components/edit.jsx b/zy-asrs-flow/src/pages/map/components/device.jsx
similarity index 98%
rename from zy-asrs-flow/src/pages/map/components/edit.jsx
rename to zy-asrs-flow/src/pages/map/components/device.jsx
index e757d1b..81c69af 100644
--- a/zy-asrs-flow/src/pages/map/components/edit.jsx
+++ b/zy-asrs-flow/src/pages/map/components/device.jsx
@@ -34,7 +34,7 @@
 
 import agv from '/public/img/map/agv.svg'
 
-const Edit = (props) => {
+const Device = (props) => {
     const { styles } = useStyles();
     const [dragging, setDragging] = useState(false);
     const [dragSprite, setDragSprite] = useState(null);
@@ -178,4 +178,4 @@
     )
 }
 
-export default Edit;
\ No newline at end of file
+export default Device;
\ No newline at end of file
diff --git a/zy-asrs-flow/src/pages/map/index.jsx b/zy-asrs-flow/src/pages/map/index.jsx
index fa2a126..0affcf4 100644
--- a/zy-asrs-flow/src/pages/map/index.jsx
+++ b/zy-asrs-flow/src/pages/map/index.jsx
@@ -10,7 +10,7 @@
 } 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';
 
@@ -45,7 +45,7 @@
     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,
@@ -79,7 +79,6 @@
     }, [app, mapContainer, windowSize])
 
     const editHandle = () => {
-        setEditModalVisible(true);
     }
 
     const onDrop = (sprite, x, y) => {
@@ -101,8 +100,6 @@
                             </Flex>
                         </Col>
                     </Row>
-
-
                 </Header>
                 <Content ref={contentRef} className={styles.content}>
                     <div ref={mapRef} style={{ position: "relative" }} />
@@ -131,16 +128,18 @@
                         <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}

--
Gitblit v1.9.1