#
luxiaotao1123
2024-10-11 9b78832f6bc69c9832c1bf08366870c788479df6
#
1个文件已修改
30 ■■■■ 已修改文件
zy-acs-flow/src/map/settings/ConfigSettings.jsx 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/map/settings/ConfigSettings.jsx
@@ -22,28 +22,20 @@
} from '../constants';
import { useNotification } from '../Notification';
export const getFormDefaultValues = (data) => {
    return {
        row: data?.row ?? '',
        bay: data?.bay ?? '',
        no: data?.no ?? '',
        ...data,
    }
};
const ConfigSettings = (props) => {
    const { sprite, onSubmit } = props;
    const notify = useNotification();
    const translate = useTranslate();
    const { control, handleSubmit, reset, watch, setValue, unregister } = useForm({
        defaultValues: getFormDefaultValues(sprite?.data),
        shouldUnregister: true,
    const { control, handleSubmit, reset, watch, setValue } = useForm({
        defaultValues: { ...sprite?.data },
    });
    useEffect(() => {
        if (sprite?.data) {
            reset(getFormDefaultValues(sprite.data));
            reset({
                ...sprite.data
            });
        }
    }, [sprite, reset]);
@@ -51,13 +43,6 @@
    const rowValue = watch('row');
    const bayValue = watch('bay');
    useEffect(() => {
        if (deviceType !== DEVICE_TYPE.SHELF) {
            unregister('row');
            unregister('bay');
        }
    }, [deviceType, unregister]);
    useEffect(() => {
        if (deviceType === DEVICE_TYPE.SHELF) {
@@ -151,11 +136,6 @@
                        <Divider />
                    </Grid>
                    {/* <Grid item xs={12}>
                        <Typography variant="inherit">
                            {translate('page.map.settings.config.base.no')}
                        </Typography>
                    </Grid> */}
                    <Grid item xs={6}>
                        <Controller
                            name="no"