#
luxiaotao1123
2024-10-11 c9e8eab9835c6f72f84552f694582d9a27f6328c
#
3个文件已修改
50 ■■■■ 已修改文件
zy-acs-flow/src/i18n/en.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/i18n/zh.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/map/settings/CopyDrawer.jsx 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/i18n/en.js
@@ -656,6 +656,10 @@
                            ascend: 'Ascend',
                            descend: 'Descend',
                        },
                        valid: {
                            common: 'Please set the config parameters first',
                            shelf: 'Please set the row and bay in the config parameters first',
                        },
                    },
                    more: {
                        title: 'More',
zy-acs-flow/src/i18n/zh.js
@@ -654,6 +654,10 @@
                            ascend: '升序',
                            descend: '降序',
                        },
                        valid: {
                            common: '请先设置系统参数',
                            shelf: '请先在系统参数中设置排和列',
                        },
                    },
                    more: {
                        title: '更多',
zy-acs-flow/src/map/settings/CopyDrawer.jsx
@@ -46,6 +46,26 @@
    ],
};
const validateIncrement = (value, deviceType, sprite, translate) => {
    if (!value) {
        return true;
    }
    switch (deviceType) {
        case DEVICE_TYPE.SHELF:
            if (!sprite?.data?.row || !sprite?.data?.bay) {
                return translate('page.map.settings.map.copy.valid.shelf');
            }
            break;
        default:
            if (!sprite?.data?.no) {
                return translate('page.map.settings.map.copy.valid.common');
            }
            break;
    }
    return true;
};
const getDefaultFormValues = (value = {}) => ({
    copyDirect: value.copyDirect || '',
    copyCount: value.copyCount || '',
@@ -88,18 +108,6 @@
    const handleClose = () => {
        onCancel();
    }
    const validateIncrement = (value) => {
        if (!value) {
            return true;
        }
        if (deviceType === DEVICE_TYPE.SHELF) {
            if (!sprite?.data?.row || !sprite?.data?.bay) {
                return 'Row or Bay value is required for SHELF device type.';
            }
        }
        return true;
    };
    const onFormSubmit = (data) => {
        console.log(data);
@@ -192,7 +200,7 @@
                                        <Controller
                                            name="autoIncrement"
                                            control={control}
                                            rules={{ validate: validateIncrement }}
                                            rules={{ validate: (value) => validateIncrement(value, deviceType, sprite, translate) }}
                                            render={({ field }) => (
                                                <FormControlLabel
                                                    control={
@@ -228,7 +236,9 @@
                                                            value={field.value}
                                                            exclusive
                                                            onChange={(event, value) => {
                                                                field.onChange(value);
                                                                if (value !== null) {
                                                                    field.onChange(value);
                                                                }
                                                            }}
                                                            fullWidth
                                                        >
@@ -261,7 +271,9 @@
                                                            value={field.value}
                                                            exclusive
                                                            onChange={(event, value) => {
                                                                field.onChange(value);
                                                                if (value !== null) {
                                                                    field.onChange(value);
                                                                }
                                                            }}
                                                            fullWidth
                                                        >