diff --git a/public/react/src/modules/courses/members/CourseGroupChooser.js b/public/react/src/modules/courses/members/CourseGroupChooser.js new file mode 100644 index 000000000..7974b70dd --- /dev/null +++ b/public/react/src/modules/courses/members/CourseGroupChooser.js @@ -0,0 +1,80 @@ +import React, { useState, useEffect } from 'react' +import { trigger } from 'educoder' +import { Input, Checkbox } from "antd"; + +function CourseGroupChooser({ course_groups, isAdminOrCreator, item, index, arg_course_groups, checkAllValue + , coursesids, onCheckAllChange, joinCourseGroup }) { + const [state, setState] = useState({counter: 0}) + const [search, setSearch] = useState('') + // useEffect(() => { + // console.log(' cdm') + // return () => { + // console.log(' cwum') + // }; + // // , [state.counter] 加了这个后,onClick就消失了 加错位置了? + // }, [state.counter] ) + // TODO 为什么每次onClick都会执行 cwum + + // const add1ToCounter = () => { + // const newCounterValue = state.counter + 1 + // setState({ counter: newCounterValue }) + // } + + /** + that.state.groupSearchValue + that.setState({groupSearchValue: e.target.value}) + + that.onCheckAllChange(e, item, index) - onCheckAllChange(e, item, index) + that.joinCourseGroup(checkedValues, item, index) - joinCourseGroup(checkedValues, item, index) + + that.state.checkAllArray[index] - checkAllValue + */ + + return ( + + ) +} +export default CourseGroupChooser \ No newline at end of file diff --git a/public/react/src/modules/courses/members/teacherList.js b/public/react/src/modules/courses/members/teacherList.js index a3cc08437..95d5148c9 100644 --- a/public/react/src/modules/courses/members/teacherList.js +++ b/public/react/src/modules/courses/members/teacherList.js @@ -21,6 +21,7 @@ import { from } from "array-flatten"; import AddGraduationGroupModal from './modal/AddGraduationGroupModal' import AddAdminModal from './modal/AddAdminModal' import { ROLE_TEACHER_NUM, ROLE_ASSISTANT_NUM } from './common' +import CourseGroupChooser from './CourseGroupChooser' const Search = Input.Search; const ROLE_ADMIN = "管理员" @@ -95,49 +96,13 @@ function buildColumns(that) { { isAdmin && - {!noGroups && } + {!noGroups && } } ) @@ -328,7 +293,7 @@ class studentsList extends Component{ }); } joinCourseGroup = (ids, item, index) => { - console.log('join ', ids, item) + // console.log('join ', ids, item) const courseId = this.props.match.params.coursesId @@ -663,6 +628,11 @@ class studentsList extends Component{ >
-
+ {filterKey == '1' &&
{ isAdminOrTeacher && hasGraduationModule && 已选 {checkBoxValues.length} 个 } { filterKey == '1' &&
{ hasGraduationModule && isAdminOrTeacher &&
  • @@ -715,7 +685,7 @@ class studentsList extends Component{
  • */}
    } -
    +
    }