#
luxiaotao1123
2024-10-11 64fb3ce826cd086463824844a9ee82977a763236
#
1个文件已修改
11 ■■■■ 已修改文件
zy-acs-flow/src/map/settings/ConfigSettings.jsx 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/map/settings/ConfigSettings.jsx
@@ -27,7 +27,7 @@
    const notify = useNotification();
    const translate = useTranslate();
    const { control, handleSubmit, reset, watch, setValue } = useForm({
    const { control, handleSubmit, reset, watch, setValue, formState: { errors } } = useForm({
        defaultValues: { ...sprite?.data },
    });
@@ -60,7 +60,7 @@
    ]);
    const onFormSubmit = (data) => {
        if (sprite && sprite.data) {
        if (sprite?.data) {
            Object.keys(data).forEach((key) => {
                sprite.data[key] = data[key];
            });
@@ -68,7 +68,6 @@
        if (onSubmit) {
            onSubmit(data);
        }
        console.log(sprite.data);
        notify.info(translate('common.response.success'));
    };
@@ -76,6 +75,7 @@
        <>
            <Box component="form" onSubmit={handleSubmit(onFormSubmit)} noValidate sx={{ mt: 0 }}>
                <Grid container spacing={1.4}>
                    {deviceType === DEVICE_TYPE.SHELF && (
                        <>
                            <Grid item xs={6}>
@@ -140,6 +140,9 @@
                        <Controller
                            name="no"
                            control={control}
                            rules={{
                                required: translate('ra.validation.required')    // warn msg
                            }}
                            render={({ field }) => {
                                return (
                                    <TextField
@@ -147,6 +150,8 @@
                                        label={translate('page.map.settings.config.base.no')}
                                        type="text"
                                        value={field.value ?? ''}
                                        error={!!errors.no} // show red warn
                                        helperText={errors.no ? errors.no.message : null}   // show warn msg
                                        fullWidth
                                        onChange={(e) => {
                                            field.onChange(e);