提交 9d13aac1 authored 作者: chscls@163.com's avatar chscls@163.com

修改bug

上级 ced935cd
...@@ -54,7 +54,7 @@ export default class ChildForm extends React.Component { ...@@ -54,7 +54,7 @@ export default class ChildForm extends React.Component {
} }
delete = (uuid) => { delete = (uuid) => {
const objs = this.state const objs = this.state
const {json:{numCode},form,base52}=this.props
if (this.props.min != null && Object.keys(objs).length - 1 < this.props.min) { if (this.props.min != null && Object.keys(objs).length - 1 < this.props.min) {
message.error("不能小于最小限制") message.error("不能小于最小限制")
...@@ -67,12 +67,14 @@ export default class ChildForm extends React.Component { ...@@ -67,12 +67,14 @@ export default class ChildForm extends React.Component {
} }
this.triggerChange({ ...objs }); this.triggerChange({ ...objs });
if(numCode!=null){
this.props.form.setFieldsValue({[numCode]:Object.keys(objs).length})
}
} }
add = () => { add = () => {
const objs = this.state const objs = this.state
console.log(objs) const {json:{numCode},form,base52}=this.props
if (this.props.max != null && Object.keys(objs).length + 1 > this.props.max) { if (this.props.max != null && Object.keys(objs).length + 1 > this.props.max) {
message.error("不能大于最大限制") message.error("不能大于最大限制")
...@@ -84,7 +86,9 @@ export default class ChildForm extends React.Component { ...@@ -84,7 +86,9 @@ export default class ChildForm extends React.Component {
this.setState({ ...objs }); this.setState({ ...objs });
} }
this.triggerChange({ ...objs }); this.triggerChange({ ...objs });
if(numCode!=null){
this.props.form.setFieldsValue({[numCode]:Object.keys(objs).length})
}
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论