|
|
|
@ -2,6 +2,7 @@ import React,{ Component } from "react";
|
|
|
|
|
import { Input,Checkbox,Table, Divider, Tooltip,Spin, Menu } from "antd";
|
|
|
|
|
|
|
|
|
|
import CourseLayoutcomponent from '../common/CourseLayoutComponent'
|
|
|
|
|
import NoneData from "../coursesPublic/NoneData"
|
|
|
|
|
|
|
|
|
|
import Titlesearchsection from '../common/titleSearch/TitleSearchSection'
|
|
|
|
|
import ColorCountText from '../common/titleSearch/ColorCountText'
|
|
|
|
@ -20,6 +21,7 @@ import { from } from "array-flatten";
|
|
|
|
|
// import AddStudentModal from './modal/AddStudentModal'
|
|
|
|
|
import AddGraduationGroupModal from './modal/AddGraduationGroupModal'
|
|
|
|
|
import AddAdminModal from './modal/AddAdminModal'
|
|
|
|
|
import CourseGroupChooserModal from './modal/CourseGroupChooserModal'
|
|
|
|
|
import { ROLE_TEACHER_NUM, ROLE_ASSISTANT_NUM } from './common'
|
|
|
|
|
import CourseGroupChooser from './CourseGroupChooser'
|
|
|
|
|
|
|
|
|
@ -100,8 +102,7 @@ function buildColumns(that) {
|
|
|
|
|
{...{course_groups, isAdminOrCreator, item, index, arg_course_groups,
|
|
|
|
|
checkAllValue: that.state.checkAllArray[index],
|
|
|
|
|
joinCourseGroup: that.joinCourseGroup,
|
|
|
|
|
onCheckAllChange: that.onCheckAllChange,
|
|
|
|
|
coursesids: that.props.coursesids }}
|
|
|
|
|
onCheckAllChange: that.onCheckAllChange}}
|
|
|
|
|
></CourseGroupChooser>}
|
|
|
|
|
</React.Fragment> }
|
|
|
|
|
</span>
|
|
|
|
@ -211,24 +212,39 @@ class studentsList extends Component{
|
|
|
|
|
}
|
|
|
|
|
// approval 2 - 拒绝
|
|
|
|
|
onAgree = (record, approval = 1) => {
|
|
|
|
|
const isAdminOrCreator = this.props.isAdminOrCreator()
|
|
|
|
|
const { course_groups } = this.state
|
|
|
|
|
if (approval == 1 && isAdminOrCreator && course_groups && course_groups.length) {
|
|
|
|
|
this.setState({ clickRecord: record}, () => {
|
|
|
|
|
this.setGroupChooserModalVisible(true)
|
|
|
|
|
})
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const courseId = this.props.match.params.coursesId
|
|
|
|
|
|
|
|
|
|
let url = `/courses/${courseId}/teacher_application_review.json`
|
|
|
|
|
|
|
|
|
|
axios.post(url, {
|
|
|
|
|
user_id: record.user_id,
|
|
|
|
|
application_id: record.application_id,
|
|
|
|
|
approval: approval
|
|
|
|
|
})
|
|
|
|
|
.then((response) => {
|
|
|
|
|
if (response.data.status == 0) {
|
|
|
|
|
this.props.showNotification(`已${approval == 1? '同意' : '拒绝'}`)
|
|
|
|
|
this.fetchAll(1)
|
|
|
|
|
this.props.confirm({
|
|
|
|
|
content: `是否确认${ approval == 1 ? '同意' : '拒绝'}TA的加入?`,
|
|
|
|
|
onOk: () => {
|
|
|
|
|
axios.post(url, {
|
|
|
|
|
user_id: record.user_id,
|
|
|
|
|
application_id: record.application_id,
|
|
|
|
|
approval: approval
|
|
|
|
|
})
|
|
|
|
|
.then((response) => {
|
|
|
|
|
if (response.data.status == 0) {
|
|
|
|
|
this.props.showNotification(`已${approval == 1? '同意' : '拒绝'}`)
|
|
|
|
|
this.fetchAll(1)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(function (error) {
|
|
|
|
|
console.log(error);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(function (error) {
|
|
|
|
|
console.log(error);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
onRefuse = (record) => {
|
|
|
|
|
this.onAgree(record, 2)
|
|
|
|
@ -560,11 +576,15 @@ class studentsList extends Component{
|
|
|
|
|
this.fetchAll();
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
setGroupChooserModalVisible = (visible) => {
|
|
|
|
|
// 这里只会调用open
|
|
|
|
|
this.setState({groupChooserModalVisible: !this.state.groupChooserModalVisible})
|
|
|
|
|
}
|
|
|
|
|
render(){
|
|
|
|
|
const isAdmin = this.props.isAdmin()
|
|
|
|
|
const columns = buildColumns(this)
|
|
|
|
|
let {
|
|
|
|
|
searchValue, checkBoxValues, checkAllValue,
|
|
|
|
|
searchValue, checkBoxValues, checkAllValue, course_groups,
|
|
|
|
|
groupList, total_count, teachers, order, page, apply_size, filterKey
|
|
|
|
|
}=this.state
|
|
|
|
|
|
|
|
|
@ -646,6 +666,15 @@ class studentsList extends Component{
|
|
|
|
|
}
|
|
|
|
|
`}</style>
|
|
|
|
|
<div className="mt20 edu-back-white padding20 teacherList">
|
|
|
|
|
|
|
|
|
|
<CourseGroupChooserModal
|
|
|
|
|
props={this.props}
|
|
|
|
|
record={this.state.clickRecord}
|
|
|
|
|
fetchAll={this.fetchAll}
|
|
|
|
|
course_groups={course_groups}
|
|
|
|
|
visible={this.state.groupChooserModalVisible}
|
|
|
|
|
setVisible={this.setGroupChooserModalVisible}
|
|
|
|
|
></CourseGroupChooserModal>
|
|
|
|
|
{filterKey == '1' && <div className="clearfix stu_head" style={{paddingLeft: '15px'}}>
|
|
|
|
|
{ isAdminOrTeacher && hasGraduationModule && <Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue} >已选 {checkBoxValues.length} 个</Checkbox> }
|
|
|
|
|
{ filterKey == '1' && <div className="studentList_operation_ul">
|
|
|
|
@ -688,6 +717,7 @@ class studentsList extends Component{
|
|
|
|
|
</div>}
|
|
|
|
|
<Spin size="large" spinning={this.state.isSpin}>
|
|
|
|
|
<div className="clearfix stu_table">
|
|
|
|
|
{combineArray.length ?
|
|
|
|
|
<Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
|
|
|
|
|
{/* pagination={{ current: page, total: total_count, pageSize:20, onChange: this.onPageChange }} */}
|
|
|
|
|
<Table columns={columns} dataSource={combineArray}
|
|
|
|
@ -700,6 +730,8 @@ class studentsList extends Component{
|
|
|
|
|
} : false}
|
|
|
|
|
></Table>
|
|
|
|
|
</Checkbox.Group>
|
|
|
|
|
:
|
|
|
|
|
<NoneData></NoneData>}
|
|
|
|
|
</div>
|
|
|
|
|
</Spin>
|
|
|
|
|
</div>
|
|
|
|
|