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

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

onestop 增加 步骤条组件
上级 84e70b48
...@@ -4,10 +4,10 @@ import { Steps } from 'antd'; ...@@ -4,10 +4,10 @@ import { Steps } from 'antd';
const { Step } = Steps; const { Step } = Steps;
export default function StepDiy(props) { export default function StepDiy(props) {
const { value, onChange, json } = props; const { value, onChange, json, form } = props;
const diyProps = useMemo(() => { const diyProps = useMemo(() => {
let b = {}; let b = {};
if(value && typeof value === 'object'){ if (value && typeof value === 'object') {
b = { b = {
...value, ...value,
}; };
...@@ -17,8 +17,8 @@ export default function StepDiy(props) { ...@@ -17,8 +17,8 @@ export default function StepDiy(props) {
let a = new Function(json.otherProps)(); let a = new Function(json.otherProps)();
if (a) { if (a) {
return { return {
...b,
...a, ...a,
...b,
}; };
} }
return b; return b;
...@@ -30,13 +30,18 @@ export default function StepDiy(props) { ...@@ -30,13 +30,18 @@ export default function StepDiy(props) {
} }
}, [json.otherProps, value]); }, [json.otherProps, value]);
console.log(diyProps); /**
* 按姚鑫国的要求 在切换步骤时将表单的值保存起来
* */
useEffect(() => {
console.log(JSON.stringify(form.getFieldsValue()));
}, [diyProps?.StepsProps.current]);
return ( return (
<div style={diyProps.outSideDivStyle}> <div style={diyProps.outSideDivStyle}>
<Steps {...diyProps.StepsProps}> <Steps {...diyProps.StepsProps}>
{Array.isArray(diyProps.Step) && {Array.isArray(diyProps.Step) &&
diyProps.Step.map(g => { diyProps.Step.map(g => {
return <Step {...g} key={g.title} />; return <Step {...g} key={g.title} />;
})} })}
</Steps> </Steps>
......
...@@ -3727,6 +3727,7 @@ ${obj[dataColumn.base52]} ...@@ -3727,6 +3727,7 @@ ${obj[dataColumn.base52]}
dataColumn={dataColumn} dataColumn={dataColumn}
disabled={disabled} disabled={disabled}
uuid={uuid} uuid={uuid}
form={this.props.form}
/>); />);
break; break;
case 'MobileCard': case 'MobileCard':
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论