#
luxiaotao1123
2024-10-10 8b052f65e991c28b5ef4aa490917d2624cad4f62
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,22 +63,12 @@
        }
    };
    // 处理表单提交
    const onFormSubmit = (data) => {
        updateSprite(data);
        if (onSubmit) {
            onSubmit(data);
        }
    };
    // 旋转滑块的刻度
    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 }}>
@@ -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>