#
luxiaotao1123
2024-10-10 6dadc459ce52921f2784b16063deffd0da2bde23
#
3个文件已修改
68 ■■■■■ 已修改文件
zy-acs-flow/src/i18n/en.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/i18n/zh.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/map/settings/MapSettings.jsx 62 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/i18n/en.js
@@ -647,6 +647,9 @@
                        down: 'Down',
                        count: 'Count',
                    },
                    more: {
                        title: 'More',
                    },
                },
                config: {
                    title: 'Config Parameters',
zy-acs-flow/src/i18n/zh.js
@@ -645,6 +645,9 @@
                        down: '下',
                        count: '数量',
                    },
                    more: {
                        title: '更多',
                    },
                },
                config: {
                    title: '系统参数',
zy-acs-flow/src/map/settings/MapSettings.jsx
@@ -18,10 +18,6 @@
import { styled } from '@mui/material/styles';
import { useTranslate } from 'react-admin';
const Input = styled(MuiInput)`
  width: 42px;
`;
const MapSettings = (props) => {
    const { sprite, onSubmit } = props;
    const translate = useTranslate();
@@ -87,7 +83,7 @@
    return (
        <Box component="form" onSubmit={handleSubmit(onFormSubmit)} noValidate sx={{ mt: 0 }}>
            <Grid container spacing={2}>
                {/* 位置 */}
                {/* position */}
                <Grid item xs={12}>
                    <Typography variant="inherit">
                        {translate('page.map.settings.map.base.position')}
@@ -95,7 +91,6 @@
                </Grid>
                <Grid item xs={6} pt={0} sx={{
                    paddingTop: '8px !important',
                    paddingLeft: '8px !important',
                }}>
                    <Controller
                        name="x"
@@ -119,7 +114,6 @@
                </Grid>
                <Grid item xs={6} sx={{
                    paddingTop: '8px !important',
                    paddingLeft: '8px !important',
                }}>
                    <Controller
                        name="y"
@@ -142,7 +136,7 @@
                    />
                </Grid>
                {/* 缩放 */}
                {/* scale */}
                <Grid item xs={12}>
                    <Typography variant="inherit">
                        {translate('page.map.settings.map.base.scale')}
@@ -150,7 +144,6 @@
                </Grid>
                <Grid item xs={6} sx={{
                    paddingTop: '8px !important',
                    paddingLeft: '8px !important',
                }}>
                    <Controller
                        name="scaleX"
@@ -175,7 +168,6 @@
                </Grid>
                <Grid item xs={6} sx={{
                    paddingTop: '8px !important',
                    paddingLeft: '8px !important',
                }}>
                    <Controller
                        name="scaleY"
@@ -199,7 +191,7 @@
                    />
                </Grid>
                {/* 旋转 */}
                {/* rotation */}
                <Grid item xs={12}>
                    <Typography variant="inherit">
                        {translate('page.map.settings.map.base.rotation')}
@@ -207,14 +199,14 @@
                </Grid>
                <Grid item xs={12}>
                    <Box display="flex" alignItems="center">
                        <Box flex={1} mr={2}>
                        <Box flex={1} mr={3}>
                            <Controller
                                name="rotation"
                                control={control}
                                render={({ field }) => (
                                    <Slider
                                        {...field}
                                        size="small"
                                        // size="small"
                                        min={0}
                                        max={360}
                                        step={1}
@@ -228,23 +220,35 @@
                                )}
                            />
                        </Box>
                        <Box width={80}>
                        <Box >
                            <Controller
                                name="rotation"
                                control={control}
                                render={({ field }) => (
                                    <TextField
                                    <MuiInput
                                        {...field}
                                        label=""
                                        type="number"
                                        fullWidth
                                        inputProps={{ min: 0, max: 360 }}
                                        size="small"
                                        value={field.value}
                                        onChange={(e) => {
                                            const value = parseFloat(e.target.value);
                                            const value = e.target.value === '' ? 0 : Number(e.target.value);
                                            if (!isNaN(value)) {
                                                field.onChange(value);
                                                updateSprite({ ...watchAllFields, rotation: value });
                                            }
                                        }}
                                        onBlur={() => {
                                            if (field.value < 0) {
                                                field.onChange(0);
                                            } else if (field.value > 360) {
                                                field.onChange(360);
                                            }
                                        }}
                                        inputProps={{
                                            step: 1,
                                            min: 0,
                                            max: 360,
                                            type: 'number',
                                            'aria-labelledby': 'input-slider',
                                        }}
                                    />
                                )}
@@ -256,7 +260,7 @@
                    <Divider />
                </Grid>
                {/* 复制 */}
                {/* copy */}
                <Grid item xs={12}>
                    <Typography variant="inherit">
                        {translate('page.map.settings.map.copy.title')}
@@ -264,7 +268,6 @@
                </Grid>
                <Grid item xs={6} sx={{
                    paddingTop: '8px !important',
                    paddingLeft: '8px !important',
                }}>
                    <Controller
                        name="copyDirection"
@@ -297,7 +300,6 @@
                </Grid>
                <Grid item xs={6} sx={{
                    paddingTop: '8px !important',
                    paddingLeft: '8px !important',
                }}>
                    <Controller
                        name="copyCount"
@@ -314,14 +316,16 @@
                    />
                </Grid>
                {/* 提交按钮 */}
                {/* more */}
                <Grid item xs={12}>
                    <Typography variant="inherit">
                        {translate('page.map.settings.map.more.title')}
                    </Typography>
                </Grid>
                <Grid item xs={12}>
                    <Stack direction="row" spacing={2}>
                        <Button type="submit" variant="contained" color="primary">
                            {translate('ra.action.confirm')}
                        </Button>
                        <Button variant="outlined" color="secondary" onClick={() => reset()}>
                            {translate('common.action.reset')}
                        <Button variant="outlined" color="error">
                            {translate('ra.action.delete')}
                        </Button>
                    </Stack>
                </Grid>