this.props.ListType
这里的isCheck 不需要也没事可以直接用e.target.checked判断
[
{title:'wuyifan',isCheck:'wuyifanisCheck',value:'zhanan'},
]
{this.props.ListType.map(item => {
return <Checkbox
checked={this.state[item.value] && this.state[item.value] > 0 ? true : false}
disabled={type == '2' || type == '3' ? true : false}
onChange={(e) => this.onCheckboxEduCertChange(e, item.isCheck, item.value)}>
{item.title}
</Checkbox>
)} }
onCheckboxEduCertChange = (e, value, numValue) => {
const { type } = this.props;
console.log(this.props.ListType, 'ListType', type)
this.setState({
[value]: e.target.checked && 1 || 0
}, () => {
if (this.state[value] == false) {
this.setState({
[numValue]: 0, examination: true
}, () => {
this.count()
})
if (type != '1') {
this.props.form.setFieldsValue({
[numValue]: 0, examination: true
}, () => {
this.count()
})
}
} else {
this.setState({ [numValue]: 1 }, () => { })
}
})
}