From 97db7c8a1471e9146a5abe53375f4d2e29fa2ced Mon Sep 17 00:00:00 2001 From: verou <857149855@qq.com> Date: 星期一, 07 四月 2025 17:04:53 +0800 Subject: [PATCH] fix:0407修改 --- rsf-admin/src/page/basicInfo/matnr/MatnrEdit.jsx | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/rsf-admin/src/page/basicInfo/matnr/MatnrEdit.jsx b/rsf-admin/src/page/basicInfo/matnr/MatnrEdit.jsx index 15f2f0a..ffec017 100644 --- a/rsf-admin/src/page/basicInfo/matnr/MatnrEdit.jsx +++ b/rsf-admin/src/page/basicInfo/matnr/MatnrEdit.jsx @@ -22,7 +22,7 @@ useNotify, } from 'react-admin'; import PropTypes from 'prop-types'; -import { useWatch, useFormContext } from "react-hook-form"; +import { useWatch, useFormContext, useForm, useFormState } from "react-hook-form"; import { Stack, Grid, Box, Typography, Tabs, Tab, } from '@mui/material'; import * as Common from '@/utils/common'; import { EDIT_MODE, REFERENCE_INPUT_PAGESIZE } from '@/config/setting'; @@ -33,7 +33,7 @@ import TreeSelectInput from "@/page/components/TreeSelectInput"; import request from '@/utils/request'; const FormToolbar = () => { - const { getValues } = useFormContext(); + const { getValues } = useFormState(); return ( <Toolbar sx={{ justifyContent: 'space-between' }}> <SaveButton /> @@ -74,6 +74,7 @@ const MatnrEdit = () => { const translate = useTranslate(); const [value, setValue] = React.useState(0); + const form = useForm(); const notify = useNotify(); const [dynamicFields, setDynamicFields] = useState([]); @@ -88,6 +89,7 @@ if (code === 200) { setDynamicFields(data || []) + } else { notify(msg); } -- Gitblit v1.9.1