|
|
|
@ -258,7 +258,7 @@ class studentsList extends Component{
|
|
|
|
|
// approval 2 - 拒绝
|
|
|
|
|
onAgree = (record, approval = 1) => {
|
|
|
|
|
const isAdminOrCreator = this.props.isAdminOrCreator()
|
|
|
|
|
const { course_groups } = this.state
|
|
|
|
|
const { course_groups ,filterKey} = this.state
|
|
|
|
|
if (approval == 1 && isAdminOrCreator && course_groups && course_groups.length) {
|
|
|
|
|
this.setState({ clickRecord: record}, () => {
|
|
|
|
|
this.setGroupChooserModalVisible(true)
|
|
|
|
@ -280,7 +280,7 @@ class studentsList extends Component{
|
|
|
|
|
.then((response) => {
|
|
|
|
|
if (response.data.status == 0) {
|
|
|
|
|
this.props.showNotification(`已${approval == 1? '同意' : '拒绝'}`)
|
|
|
|
|
this.fetchAll(1)
|
|
|
|
|
this.fetchAll(1,filterKey)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(function (error) {
|
|
|
|
@ -299,7 +299,20 @@ class studentsList extends Component{
|
|
|
|
|
this.setState({
|
|
|
|
|
isSpin:true
|
|
|
|
|
})
|
|
|
|
|
this.fetchAll(1);
|
|
|
|
|
let newmenuid=this.props.location.search.replace('?tab=', '');
|
|
|
|
|
if(newmenuid===undefined||newmenuid===""||newmenuid==="1"||newmenuid===1){
|
|
|
|
|
this.setState({
|
|
|
|
|
filterKey:'1'
|
|
|
|
|
})
|
|
|
|
|
this.fetchAll(1,'1');
|
|
|
|
|
}else{
|
|
|
|
|
this.setState({
|
|
|
|
|
filterKey:'2'
|
|
|
|
|
})
|
|
|
|
|
this.fetchAll(1,'2');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const isAdminOrTeacher = this.props.isAdminOrTeacher()
|
|
|
|
|
const isAdmin = this.props.isAdmin()
|
|
|
|
|
|
|
|
|
@ -319,10 +332,11 @@ class studentsList extends Component{
|
|
|
|
|
this.getCourseGroups()
|
|
|
|
|
}
|
|
|
|
|
addTeacherSuccessListener = (e, data) => {
|
|
|
|
|
|
|
|
|
|
// const params = JSON.parse(data)
|
|
|
|
|
// const coursesId = this.props.match.params.coursesId
|
|
|
|
|
if (window.location.pathname.endsWith('teachers')) {
|
|
|
|
|
this.fetchAll(1)
|
|
|
|
|
this.fetchAll(1,this.state.filterKey)
|
|
|
|
|
} else {
|
|
|
|
|
// this.props.history.push(`/courses/${coursesId}/teachers`)
|
|
|
|
|
}
|
|
|
|
@ -382,9 +396,11 @@ class studentsList extends Component{
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
onChangeRoleSuccess = () => {
|
|
|
|
|
this.fetchAll()
|
|
|
|
|
this.fetchAll(undefined,this.state.filterKey)
|
|
|
|
|
}
|
|
|
|
|
fetchAll = async (argPage) => {
|
|
|
|
|
fetchAll = async (argPage,filterKey) => {
|
|
|
|
|
let { searchValue }=this.state
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
isSpin:true
|
|
|
|
|
})
|
|
|
|
@ -395,7 +411,7 @@ class studentsList extends Component{
|
|
|
|
|
|
|
|
|
|
const sortedInfo = this.state.sortedInfo;
|
|
|
|
|
let page = argPage || this.state.page
|
|
|
|
|
let { searchValue, filterKey }=this.state
|
|
|
|
|
|
|
|
|
|
let order = 1;
|
|
|
|
|
if (sortedInfo.columnKey == 'role') {
|
|
|
|
|
order = 1;
|
|
|
|
@ -463,8 +479,8 @@ class studentsList extends Component{
|
|
|
|
|
|
|
|
|
|
// join_graduation_group
|
|
|
|
|
joinGraduationGroup = (graduation_group_id) => {
|
|
|
|
|
const courseId = this.props.match.params.coursesId
|
|
|
|
|
|
|
|
|
|
const courseId = this.props.match.params.coursesId
|
|
|
|
|
let { filterKey }=this.state
|
|
|
|
|
let url= `/courses/${courseId}/join_graduation_group.json`;
|
|
|
|
|
axios.post(url, {
|
|
|
|
|
course_member_list: this.state.checkBoxValues.map (item => { return { course_member_id: item } }),
|
|
|
|
@ -472,7 +488,7 @@ class studentsList extends Component{
|
|
|
|
|
}).then((result)=>{
|
|
|
|
|
if(result.data.status==0){
|
|
|
|
|
this.props.showNotification('操作成功。')
|
|
|
|
|
this.fetchAll()
|
|
|
|
|
this.fetchAll(undefined,filterKey)
|
|
|
|
|
}
|
|
|
|
|
}).catch((error)=>{
|
|
|
|
|
console.log(error);
|
|
|
|
@ -480,6 +496,7 @@ class studentsList extends Component{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onInputSearchChange = (e) => {
|
|
|
|
|
let {filterKey}=this.state;
|
|
|
|
|
this.setState({
|
|
|
|
|
searchValue: e.target.value
|
|
|
|
|
})
|
|
|
|
@ -488,12 +505,12 @@ class studentsList extends Component{
|
|
|
|
|
clearTimeout(this.timeoutHandler)
|
|
|
|
|
}
|
|
|
|
|
this.timeoutHandler = setTimeout(() => {
|
|
|
|
|
this.fetchAll(1)
|
|
|
|
|
this.fetchAll(1,filterKey)
|
|
|
|
|
}, 1200)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onPressEnter = (e) => {
|
|
|
|
|
this.fetchAll(1)
|
|
|
|
|
this.fetchAll(1,this.state.filterKey)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -530,7 +547,7 @@ class studentsList extends Component{
|
|
|
|
|
changeRole = (member, role) => {
|
|
|
|
|
|
|
|
|
|
const courseId = this.props.match.params.coursesId
|
|
|
|
|
|
|
|
|
|
let {filterKey}=this.state;
|
|
|
|
|
let url= `/courses/${courseId}/change_course_teacher.json`;
|
|
|
|
|
axios.post(url, {
|
|
|
|
|
course_member_id: member.course_member_id
|
|
|
|
@ -543,7 +560,7 @@ class studentsList extends Component{
|
|
|
|
|
}).then((result)=>{
|
|
|
|
|
if(result.data.status==0){
|
|
|
|
|
this.props.showNotification('操作成功。')
|
|
|
|
|
this.fetchAll()
|
|
|
|
|
this.fetchAll(undefined,filterKey)
|
|
|
|
|
}
|
|
|
|
|
}).catch((error)=>{
|
|
|
|
|
console.log(error);
|
|
|
|
@ -559,9 +576,11 @@ class studentsList extends Component{
|
|
|
|
|
this.refs.addAdminModal.setVisible(true)
|
|
|
|
|
}
|
|
|
|
|
changeAdminSuccess = () => {
|
|
|
|
|
this.fetchAll()
|
|
|
|
|
let {filterKey}=this.state;
|
|
|
|
|
this.fetchAll(undefined,filterKey)
|
|
|
|
|
}
|
|
|
|
|
onDelete = (member) => {
|
|
|
|
|
let {filterKey}=this.state;
|
|
|
|
|
this.props.confirm({
|
|
|
|
|
content: `确认要将“${member.name}”从教师列表中移除吗?`,
|
|
|
|
|
onOk: () => {
|
|
|
|
@ -577,7 +596,7 @@ class studentsList extends Component{
|
|
|
|
|
// {"status":1,"message":"删除成功"}
|
|
|
|
|
this.props.showNotification('删除成功')
|
|
|
|
|
trigger('updatabanner')
|
|
|
|
|
this.fetchAll()
|
|
|
|
|
this.fetchAll(undefined,filterKey)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(function (error) {
|
|
|
|
@ -602,12 +621,13 @@ class studentsList extends Component{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onTableChange = (pagination, filters, sorter) => {
|
|
|
|
|
let {filterKey}=this.state;
|
|
|
|
|
console.log('Various parameters', pagination, filters, sorter);
|
|
|
|
|
this.setState({
|
|
|
|
|
page: pagination.current,
|
|
|
|
|
sortedInfo: sorter,
|
|
|
|
|
}, () => {
|
|
|
|
|
this.fetchAll()
|
|
|
|
|
this.fetchAll(undefined,filterKey)
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
clearSelection = () => {
|
|
|
|
@ -620,7 +640,7 @@ class studentsList extends Component{
|
|
|
|
|
page:1,
|
|
|
|
|
isSpin:true
|
|
|
|
|
}, () => {
|
|
|
|
|
this.fetchAll();
|
|
|
|
|
this.fetchAll(undefined,e.key);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
setGroupChooserModalVisible = (visible) => {
|
|
|
|
@ -654,7 +674,9 @@ class studentsList extends Component{
|
|
|
|
|
const isSuperAdmin = this.props.isSuperAdmin()
|
|
|
|
|
const hasGraduationModule = this.hasGraduationModule()
|
|
|
|
|
const coursesId = this.props.match.params.coursesId
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return(
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
{/* <AddTeacherModal ref="addTeacherModal"
|
|
|
|
@ -693,7 +715,7 @@ class studentsList extends Component{
|
|
|
|
|
}
|
|
|
|
|
secondRowLeft={
|
|
|
|
|
isAdminOrTeacher ? <div className="fl mt6 task_menu_ul " style={{ width: '600px' }}>
|
|
|
|
|
<Menu mode="horizontal" defaultSelectedKeys="1" onClick={this.selectedStatus}>
|
|
|
|
|
<Menu mode="horizontal" selectedKeys={[`${this.state.filterKey}`]} onClick={this.selectedStatus}>
|
|
|
|
|
<Menu.Item key="1">已审批({total_count})</Menu.Item>
|
|
|
|
|
<Menu.Item key="2">待审批({apply_size})</Menu.Item>
|
|
|
|
|
</Menu>
|
|
|
|
@ -740,9 +762,11 @@ class studentsList extends Component{
|
|
|
|
|
<div className="mt20 edu-back-white padding20 teacherList">
|
|
|
|
|
|
|
|
|
|
{ course_groups && !!course_groups.length && <CourseGroupChooserModal
|
|
|
|
|
{...this.state}
|
|
|
|
|
{...this.props}
|
|
|
|
|
props={{match: this.props.match, showNotification: this.props.showNotification}}
|
|
|
|
|
record={this.state.clickRecord}
|
|
|
|
|
fetchAll={this.fetchAll}
|
|
|
|
|
fetchAll={(e)=>this.fetchAll(e,this.state.filterKey)}
|
|
|
|
|
course_groups={course_groups}
|
|
|
|
|
visible={this.state.groupChooserModalVisible}
|
|
|
|
|
setVisible={this.setGroupChooserModalVisible}
|
|
|
|
|