Commit 7f4a800e authored by XieZhiXiong's avatar XieZhiXiong

feat: 增强判断

parent eba9ace8
...@@ -128,12 +128,18 @@ const NiceForm: React.FC<NiceFormProps> = props => { ...@@ -128,12 +128,18 @@ const NiceForm: React.FC<NiceFormProps> = props => {
useEffect(() => { useEffect(() => {
let paginationInfo: currentStateType = getCurrentState(); let paginationInfo: currentStateType = getCurrentState();
if(match.path === paginationInfo.pathname) {
// 一般 列表检索传入的 controlRender 的 NiceForm 是没有 value 或者 initialValues 的
// value 或者 initialValues 的,表单页有
if (
match.path === paginationInfo.pathname
&& !('value' in reset)
&& !('initialValues' in reset)
) {
reset.actions.setFormState( reset.actions.setFormState(
state => (state.values = paginationInfo.queryParams), state => (state.values = paginationInfo.queryParams),
); );
} }
}, []) }, [])
return ( return (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment