From 083c6f8b5244e65ae611a965e028a587ad6cb871 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 9 Jul 2019 16:37:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E7=8F=AD=E7=BB=84=E4=BB=B6=E5=B0=81?= =?UTF-8?q?=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/members/CourseGroupChooser.js | 80 +++++++++++++++++++ .../modules/courses/members/teacherList.js | 62 ++++---------- 2 files changed, 96 insertions(+), 46 deletions(-) create mode 100644 public/react/src/modules/courses/members/CourseGroupChooser.js 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 ( +
+ {setSearch(e.target.value)}} allowClear/> +
): + '' + } + +- {that.setState({groupSearchValue: e.target.value})}} allowClear/> -
): - '' - } - {course_groups && course_groups.length > 1 &&