|
|
@ -547,6 +547,19 @@ class studentsList extends Component{
|
|
|
|
addDir = () => {
|
|
|
|
addDir = () => {
|
|
|
|
trigger('groupAdd', this.props.coursesids)
|
|
|
|
trigger('groupAdd', this.props.coursesids)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
addToDir = async () => {
|
|
|
|
|
|
|
|
const courseId = this.props.match.params.coursesId
|
|
|
|
|
|
|
|
const url = `/courses/${courseId}/join_course_group.json`
|
|
|
|
|
|
|
|
const course_group_id = this.props.match.params.course_group_id
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const response = await axios.post(url, {
|
|
|
|
|
|
|
|
course_group_id
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
if (response && response.data.status == 0) {
|
|
|
|
|
|
|
|
this.props.showNotification('加入成功')
|
|
|
|
|
|
|
|
this.fetchAll()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
renameDir = () => {
|
|
|
|
renameDir = () => {
|
|
|
|
const course_group_id = this.props.match.params.course_group_id
|
|
|
|
const course_group_id = this.props.match.params.course_group_id
|
|
|
|
trigger('groupRename', { id: parseInt(course_group_id), name: this.state.course_group_name})
|
|
|
|
trigger('groupRename', { id: parseInt(course_group_id), name: this.state.course_group_name})
|
|
|
@ -593,6 +606,7 @@ class studentsList extends Component{
|
|
|
|
|
|
|
|
|
|
|
|
render(){
|
|
|
|
render(){
|
|
|
|
const isAdmin = this.props.isAdmin()
|
|
|
|
const isAdmin = this.props.isAdmin()
|
|
|
|
|
|
|
|
const isStudent = this.props.isStudent()
|
|
|
|
const isSuperAdmin = this.props.isSuperAdmin()
|
|
|
|
const isSuperAdmin = this.props.isSuperAdmin()
|
|
|
|
const isCourseEnd = this.props.isCourseEnd()
|
|
|
|
const isCourseEnd = this.props.isCourseEnd()
|
|
|
|
let {
|
|
|
|
let {
|
|
|
@ -704,6 +718,8 @@ class studentsList extends Component{
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// pageType !== TYPE_STUDENTS &&
|
|
|
|
// pageType !== TYPE_STUDENTS &&
|
|
|
|
!isCourseEnd && isAdmin && isParent && <WordsBtn style="blue" className="mr30" onClick={()=>this.addDir()}>添加分班</WordsBtn> }
|
|
|
|
!isCourseEnd && isAdmin && isParent && <WordsBtn style="blue" className="mr30" onClick={()=>this.addDir()}>添加分班</WordsBtn> }
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
isStudent && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.addToDir()}>加入分班</WordsBtn> }
|
|
|
|
{
|
|
|
|
{
|
|
|
|
isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.deleteDir()}>删除分班</WordsBtn> }
|
|
|
|
isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.deleteDir()}>删除分班</WordsBtn> }
|
|
|
|
{
|
|
|
|
{
|
|
|
|