dev_forum
hjm 6 years ago
parent 14a638c34e
commit 9832ae4c4c

@ -89,10 +89,20 @@ function buildColumns(that) {
</p>):
''
}
{course_groups && course_groups.length > 1 && <li key={'_all' + index} >
{/* 防止被外面group包裹 */}
<Checkbox.Group>
<Checkbox
checked={that.state.checkAllArray[index]}
style={{ marginRight: '6px' }} onClick={(e) => that.onCheckAllChange(e, item, index)} onChange={() => {}}
>全选</Checkbox>
</Checkbox.Group>
</li>}
<Checkbox.Group onChange={(checkedValues) => that.joinCourseGroup(checkedValues, item, index)}
value={arg_course_groups.map(item => item.id)}
disabled={!isAdminOrCreator}
>
{
course_groups && course_groups.filter((item) => {
return (!that.state.groupSearchValue || item.name.indexOf(that.state.groupSearchValue) != -1)
@ -165,7 +175,7 @@ function buildColumns(that) {
dataIndex: 'course_member_id',
key: 'course_member_id',
render: (content, item, index) => {
return <Checkbox value={content}></Checkbox>
return content ? <Checkbox value={content}></Checkbox> : ''
}
})
}
@ -190,7 +200,20 @@ class studentsList extends Component{
teachers: [],
checkBoxValues: [],
isSpin:false,
application_list: []
application_list: [],
checkAllArray: []
}
}
onCheckAllChange = (e, item, index) => {
const that = this;
debugger;
const checkAllArray = that.state.checkAllArray.slice(0)
checkAllArray[index] = !checkAllArray[index]
that.setState({checkAllArray})
if (checkAllArray[index]) {
that.joinCourseGroup(that.state.course_groups.map((item) => item.id), item, index)
} else {
that.joinCourseGroup([], item, index)
}
}
inputSearch=(e)=>{

Loading…
Cancel
Save