From 62774ce5aa3f92f8aae12fb38fe773fd63bceb2a Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期三, 09 十月 2024 13:10:47 +0800
Subject: [PATCH] #

---
 zy-acs-flow/src/map/MapPage.jsx |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/zy-acs-flow/src/map/MapPage.jsx b/zy-acs-flow/src/map/MapPage.jsx
index 1681ed6..8761047 100644
--- a/zy-acs-flow/src/map/MapPage.jsx
+++ b/zy-acs-flow/src/map/MapPage.jsx
@@ -1,4 +1,5 @@
 import React, { useState, useRef, useEffect, useMemo } from "react";
+import { useTranslate } from "react-admin";
 import {
     TextField,
     Select,
@@ -29,6 +30,7 @@
     const theme = useTheme();
     const themeMode = theme.palette.mode;
     const notify = useNotification();
+    const translate = useTranslate();
 
     const mapRef = useRef();
     const contentRef = useRef();
@@ -76,7 +78,6 @@
                 setDeviceVisible(false);
                 break
             case MapMode.MOVABLE_MODE:
-                setDeviceVisible(true);
                 break
             case MapMode.SETTINGS_MODE:
                 setDeviceVisible(false);
@@ -94,6 +95,8 @@
     }, [mode]);
 
     const onDrop = (sprite, type, x, y) => {
+        console.log(sprite, type, x, y);
+
         const { mapX, mapY } = Tool.getRealPosition(x, y);
         sprite.x = mapX;
         sprite.y = mapY;
@@ -167,7 +170,7 @@
                             sx={{ mr: 1 }}
                             onClick={() => setDeviceVisible(!deviceVisible)}
                         >
-                            娣诲姞妯″瀷
+                            {translate('page.map.devices.title')}
                         </Button>
                     </>
                 )}
@@ -243,6 +246,7 @@
                     setDeviceVisible(false);
                 }}
                 onDrop={onDrop}
+                width={378}
             />
 
         </Box>

--
Gitblit v1.9.1