#
luxiaotao1123
2024-10-11 85c7552bcc838661591b5e78dfdd341f7e3748b3
zy-acs-flow/src/map/settings/MapSettings.jsx
@@ -17,6 +17,7 @@
import MuiInput from '@mui/material/Input';
import { useTranslate } from 'react-admin';
import * as Tool from '../tool';
import ConfirmButton from '../../page/components/ConfirmButton';
const MapSettings = (props) => {
    const { sprite, setSpriteSettings, onSubmit } = props;
@@ -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,7 +56,6 @@
            sprite.scale.x = data.scaleX;
            sprite.scale.y = data.scaleY;
            sprite.rotation = (data.rotation * Math.PI) / 180;
            // 更新其他属性...
        }
    };
@@ -337,6 +333,7 @@
                        }}>
                            {translate('ra.action.delete')}
                        </Button>
                        {/* <ConfirmButton /> */}
                    </Stack>
                </Grid>
            </Grid>