From 8b052f65e991c28b5ef4aa490917d2624cad4f62 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 10 十月 2024 17:00:38 +0800
Subject: [PATCH] #

---
 zy-acs-flow/src/map/settings/MapSettings.jsx |   23 +++++++++--------------
 1 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/zy-acs-flow/src/map/settings/MapSettings.jsx b/zy-acs-flow/src/map/settings/MapSettings.jsx
index 644d73f..2e3e7a6 100644
--- a/zy-acs-flow/src/map/settings/MapSettings.jsx
+++ b/zy-acs-flow/src/map/settings/MapSettings.jsx
@@ -15,11 +15,11 @@
     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';
 
 const MapSettings = (props) => {
-    const { sprite, onSubmit } = props;
+    const { sprite, setSpriteSettings, onSubmit } = props;
     const translate = useTranslate();
 
     const { control, handleSubmit, reset, watch } = useForm({
@@ -63,7 +63,6 @@
         }
     };
 
-    // 澶勭悊琛ㄥ崟鎻愪氦
     const onFormSubmit = (data) => {
         updateSprite(data);
         if (onSubmit) {
@@ -71,18 +70,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={1.5}>
+            <Grid container spacing={1.4}>
                 {/* position */}
                 <Grid item xs={12}>
                     <Typography variant="inherit">
@@ -339,7 +329,12 @@
                 </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>
                     </Stack>

--
Gitblit v1.9.1