提交 b34348d3 authored 作者: 钟是志's avatar 钟是志

28974 辅导员考核相关需求,有疑问联系我

onestop 增加 步骤条组件
上级 b40383ab
...@@ -12,7 +12,6 @@ export default function StepDiy(props) { ...@@ -12,7 +12,6 @@ export default function StepDiy(props) {
b = { b = {
...value, ...value,
}; };
delete b.formValues;
} }
if (json.otherProps && typeof json.otherProps === 'string') { if (json.otherProps && typeof json.otherProps === 'string') {
try { try {
...@@ -33,7 +32,6 @@ export default function StepDiy(props) { ...@@ -33,7 +32,6 @@ export default function StepDiy(props) {
}, [json.otherProps, value]); }, [json.otherProps, value]);
const [current, setCurrent] = useState(diyProps?.StepsProps?.current || 0); const [current, setCurrent] = useState(diyProps?.StepsProps?.current || 0);
const [formValues, setFormValues] = useState({});
const partFormKey = useMemo(() => { const partFormKey = useMemo(() => {
if (typeof current !== 'undefined') { if (typeof current !== 'undefined') {
...@@ -43,33 +41,16 @@ export default function StepDiy(props) { ...@@ -43,33 +41,16 @@ export default function StepDiy(props) {
if (item) { if (item) {
return item.formKey; return item.formKey;
} }
partFormProps.form.setFieldsValue(formValues);
} }
return undefined; return undefined;
}, [current]); }, [current]);
useEffect(() => { useEffect(() => {
if (diyProps?.StepsProps?.current !== current) { if (diyProps?.StepsProps?.current !== current) {
const oldValues = partFormProps.form.getFieldsValue();
let newV = {
...oldValues,
};
delete newV[dataColumn.base52];
setFormValues({
...formValues,
...newV,
});
}
setCurrent(diyProps?.StepsProps?.current); setCurrent(diyProps?.StepsProps?.current);
}
}, [diyProps?.StepsProps?.current]); }, [diyProps?.StepsProps?.current]);
useEffect(() => {
onChange({
...value,
formValues,
})
}, [formValues]);
console.log(value); console.log(value);
return ( return (
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论