|
|
|
@ -130,7 +130,7 @@ const buildColumns = (that,isParent) => {
|
|
|
|
|
}
|
|
|
|
|
const isAdmin = that.props.isAdmin()
|
|
|
|
|
if (isAdmin) {
|
|
|
|
|
columns.unshift({
|
|
|
|
|
!that.isStudentPage && columns.unshift({
|
|
|
|
|
title: '',
|
|
|
|
|
dataIndex: 'check',
|
|
|
|
|
key: 'check',
|
|
|
|
@ -547,7 +547,7 @@ class studentsList extends Component{
|
|
|
|
|
addDir = () => {
|
|
|
|
|
trigger('groupAdd', this.props.coursesids)
|
|
|
|
|
}
|
|
|
|
|
addToDir = async () => {
|
|
|
|
|
doAddToDir = 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
|
|
|
|
@ -556,11 +556,27 @@ class studentsList extends Component{
|
|
|
|
|
course_group_id
|
|
|
|
|
})
|
|
|
|
|
if (response && response.data.status == 0) {
|
|
|
|
|
this.props.showNotification('加入成功')
|
|
|
|
|
this.props.showNotification(`已加入分班:${this.state.course_group_name}`)
|
|
|
|
|
this.props.updataleftNavfun()
|
|
|
|
|
this.fetchAll()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
addToDir = (record) => {
|
|
|
|
|
this.props.confirm({
|
|
|
|
|
|
|
|
|
|
content: `是否确认加入分班: ${this.state.course_group_name}?`,
|
|
|
|
|
|
|
|
|
|
okText: '确认',
|
|
|
|
|
cancelText: '取消',
|
|
|
|
|
|
|
|
|
|
onOk: () => {
|
|
|
|
|
this.doAddToDir()
|
|
|
|
|
},
|
|
|
|
|
onCancel() {
|
|
|
|
|
console.log('Cancel');
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
renameDir = () => {
|
|
|
|
|
const course_group_id = this.props.match.params.course_group_id
|
|
|
|
|
trigger('groupRename', { id: parseInt(course_group_id), name: this.state.course_group_name})
|
|
|
|
@ -670,7 +686,8 @@ class studentsList extends Component{
|
|
|
|
|
} else {
|
|
|
|
|
pageType = TYPE_COURSE_GOURP_CHILD
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const isStudentPage = pageType == TYPE_STUDENTS
|
|
|
|
|
this.isStudentPage = isStudentPage
|
|
|
|
|
|
|
|
|
|
return(
|
|
|
|
|
<React.Fragment >
|
|
|
|
@ -708,23 +725,24 @@ class studentsList extends Component{
|
|
|
|
|
searchPlaceholder={ '请输入姓名、学号进行搜索' }
|
|
|
|
|
firstRowRight={
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
{
|
|
|
|
|
{/* {
|
|
|
|
|
// pageType !== TYPE_STUDENTS &&
|
|
|
|
|
isSuperAdmin && <React.Fragment>
|
|
|
|
|
!isStudentPage && isSuperAdmin && <React.Fragment>
|
|
|
|
|
<CreateGroupByImportModal ref="createGroupByImportModal" {...this.props}
|
|
|
|
|
createGroupImportSuccess={this.createGroupImportSuccess}
|
|
|
|
|
></CreateGroupByImportModal>
|
|
|
|
|
<WordsBtn style="blue" className="mr30" onClick={()=> this.refs['createGroupByImportModal'].setVisible(true)}>导入创建分班</WordsBtn>
|
|
|
|
|
</React.Fragment> }
|
|
|
|
|
</React.Fragment> } */}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// pageType !== TYPE_STUDENTS &&
|
|
|
|
|
!isCourseEnd && isAdmin && isParent && <WordsBtn style="blue" className="mr30" onClick={()=>this.addDir()}>添加分班</WordsBtn> }
|
|
|
|
|
!isStudentPage && isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.deleteDir()}>删除分班</WordsBtn> }
|
|
|
|
|
{
|
|
|
|
|
isStudent && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.addToDir()}>加入分班</WordsBtn> }
|
|
|
|
|
!isStudentPage && isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.renameDir()}>分班重命名</WordsBtn> }
|
|
|
|
|
{
|
|
|
|
|
isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.deleteDir()}>删除分班</WordsBtn> }
|
|
|
|
|
!isStudentPage && !isCourseEnd && isAdmin && <WordsBtn style="blue" className="mr30" onClick={()=>this.addDir()}>新建分班</WordsBtn> }
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.renameDir()}>分班重命名</WordsBtn> }
|
|
|
|
|
!isStudentPage && isStudent && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.addToDir()}>加入分班</WordsBtn> }
|
|
|
|
|
<style>{`
|
|
|
|
|
.drop_down_menu li a {
|
|
|
|
|
padding: 0px;
|
|
|
|
@ -780,10 +798,10 @@ class studentsList extends Component{
|
|
|
|
|
total_count > 0 || this.state.isSpin == true ?
|
|
|
|
|
<div className="mt20 edu-back-white padding20">
|
|
|
|
|
<div className="clearfix stu_head" style={{paddingLeft: '15px'}}>
|
|
|
|
|
{isAdmin && <Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue} >已选 {checkBoxValues.length} 个</Checkbox>}
|
|
|
|
|
{isAdmin && !isStudentPage && <Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue} >已选 {checkBoxValues.length} 个</Checkbox>}
|
|
|
|
|
<div className="studentList_operation_ul">
|
|
|
|
|
{/* {isAdmin && <li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.onDelete}>删除</a></li>} */}
|
|
|
|
|
{isAdmin && <li className="drop_down">
|
|
|
|
|
{isAdmin && !isStudentPage && <li className="drop_down">
|
|
|
|
|
移动到...<i className="iconfont icon-xiajiantou font-12 ml2"></i>
|
|
|
|
|
<ul className="drop_down_menu" style={{"right":"0px","left":"unset", width: '200px', maxHeight: '324px', overflowY: 'auto'}}>
|
|
|
|
|
{
|
|
|
|
|