From 54d940c0bfabe90700d0bcc9e72dc93bc8bafaad Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期五, 11 十月 2024 10:54:26 +0800
Subject: [PATCH] #

---
 zy-acs-flow/src/map/settings/MapSettings.jsx |   45 ++++++++++++++++++++++++++-------------------
 1 files changed, 26 insertions(+), 19 deletions(-)

diff --git a/zy-acs-flow/src/map/settings/MapSettings.jsx b/zy-acs-flow/src/map/settings/MapSettings.jsx
index 7acf00b..6a24546 100644
--- a/zy-acs-flow/src/map/settings/MapSettings.jsx
+++ b/zy-acs-flow/src/map/settings/MapSettings.jsx
@@ -15,11 +15,12 @@
     Divider,
 } from '@mui/material';
 import MuiInput from '@mui/material/Input';
-import { styled } from '@mui/material/styles';
 import { useTranslate } from 'react-admin';
+import * as Tool from '../tool';
+import ConfirmButton from '../../page/components/ConfirmButton';
 
 const MapSettings = (props) => {
-    const { sprite, onSubmit } = props;
+    const { sprite, setSpriteSettings, onSubmit } = props;
     const translate = useTranslate();
 
     const { control, handleSubmit, reset, watch } = useForm({
@@ -31,11 +32,9 @@
             rotation: (sprite?.rotation * 180) / Math.PI || 0,
             copyDirection: 'right',
             copyCount: 1,
-            // 鍏朵粬榛樿鍊�...
         },
     });
 
-    // 鐩戝惉鎵�鏈夊瓧娈电殑鍙樺寲
     const watchAllFields = watch();
 
     useEffect(() => {
@@ -46,12 +45,10 @@
                 scaleX: sprite.scale.x,
                 scaleY: sprite.scale.y,
                 rotation: (sprite.rotation * 180) / Math.PI,
-                // 璁剧疆鍏朵粬瀛楁鐨勫垵濮嬪��
             });
         }
     }, [sprite, reset]);
 
-    // 鏇存柊绮剧伒灞炴�х殑鍑芥暟
     const updateSprite = (data) => {
         if (sprite) {
             sprite.position.x = data.x;
@@ -59,11 +56,9 @@
             sprite.scale.x = data.scaleX;
             sprite.scale.y = data.scaleY;
             sprite.rotation = (data.rotation * Math.PI) / 180;
-            // 鏇存柊鍏朵粬灞炴��...
         }
     };
 
-    // 澶勭悊琛ㄥ崟鎻愪氦
     const onFormSubmit = (data) => {
         updateSprite(data);
         if (onSubmit) {
@@ -71,18 +66,9 @@
         }
     };
 
-    // 鏃嬭浆婊戝潡鐨勫埢搴�
-    const rotationMarks = [
-        { value: 0, label: '0掳' },
-        { value: 90, label: '90掳' },
-        { value: 180, label: '180掳' },
-        { value: 270, label: '270掳' },
-        { value: 360, label: '360掳' },
-    ];
-
     return (
         <Box component="form" onSubmit={handleSubmit(onFormSubmit)} noValidate sx={{ mt: 0 }}>
-            <Grid container spacing={2}>
+            <Grid container spacing={1.4}>
                 {/* position */}
                 <Grid item xs={12}>
                     <Typography variant="inherit">
@@ -256,6 +242,7 @@
                         </Box>
                     </Box>
                 </Grid>
+
                 <Grid item xs={12}>
                     <Divider />
                 </Grid>
@@ -315,6 +302,20 @@
                         )}
                     />
                 </Grid>
+                <Grid item xs={12}>
+                    <Stack direction="row" spacing={2}>
+                        <Button variant="contained" color="primary">
+                            {translate('page.map.settings.map.copy.execute')}
+                        </Button>
+                        <Button variant="text" color="primary">
+                            {translate('page.map.settings.map.copy.reverse')}
+                        </Button>
+                    </Stack>
+                </Grid>
+
+                <Grid item xs={12}>
+                    <Divider />
+                </Grid>
 
                 {/* more */}
                 <Grid item xs={12}>
@@ -324,9 +325,15 @@
                 </Grid>
                 <Grid item xs={12}>
                     <Stack direction="row" spacing={2}>
-                        <Button variant="outlined" color="error">
+                        <Button variant="outlined" color="error" onClick={() => {
+                            Tool.getMapContainer().removeChild(sprite);
+                            setSpriteSettings(null);
+                            Tool.removeSelectedEffect();
+                            reset();
+                        }}>
                             {translate('ra.action.delete')}
                         </Button>
+                        {/* <ConfirmButton /> */}
                     </Stack>
                 </Grid>
             </Grid>

--
Gitblit v1.9.1