|
|
|
@ -107,7 +107,7 @@ const buildColumns = (that,isParent) => {
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
if (course_groups && course_groups.length) {
|
|
|
|
|
columns.push({
|
|
|
|
|
this.isStudentPage && columns.push({
|
|
|
|
|
title: '分班',
|
|
|
|
|
dataIndex: 'course_group_name',
|
|
|
|
|
key: 'course_group_name',
|
|
|
|
@ -148,8 +148,9 @@ const buildColumns = (that,isParent) => {
|
|
|
|
|
render: (text, record) => {
|
|
|
|
|
return (
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
<WordsBtn style2={{ marginRight: '12px' }} onClick={() => that.onDelete(record)} style={'grey'}>删除学生</WordsBtn>
|
|
|
|
|
<WordsBtn onClick={() => that.onDelete(record)} style={'grey'}>删除学生</WordsBtn>
|
|
|
|
|
{record.member_roles && record.member_roles.length && <ChangeRolePop
|
|
|
|
|
style={{ marginLeft: '12px' }}
|
|
|
|
|
courseId={courseId}
|
|
|
|
|
record={record}
|
|
|
|
|
member_roles={record.member_roles}
|
|
|
|
@ -319,6 +320,9 @@ class studentsList extends Component{
|
|
|
|
|
isAdmin && on('updateNavSuccess', this.updateNavSuccess)
|
|
|
|
|
}
|
|
|
|
|
componentWillUnmount() {
|
|
|
|
|
if (this.clipboard) {
|
|
|
|
|
this.clipboard.destroy()
|
|
|
|
|
}
|
|
|
|
|
const isAdmin = this.props.isAdmin()
|
|
|
|
|
if (isAdmin) {
|
|
|
|
|
off('addStudentSuccess', this.addStudentSuccessListener)
|
|
|
|
@ -330,6 +334,7 @@ class studentsList extends Component{
|
|
|
|
|
}
|
|
|
|
|
updateNavSuccess = () => {
|
|
|
|
|
this.fetchCourseGroups()
|
|
|
|
|
this.fetchAll()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
addStudentSuccessListener=(e, data)=>{
|
|
|
|
@ -418,12 +423,14 @@ class studentsList extends Component{
|
|
|
|
|
invite_code: result.data.invite_code,
|
|
|
|
|
isSpin:false
|
|
|
|
|
}, () => {
|
|
|
|
|
if (!this.clipboard) {
|
|
|
|
|
const clipboard = new ClipboardJS('.copybtn');
|
|
|
|
|
clipboard.on('success', (e) => {
|
|
|
|
|
this.props.showNotification('复制成功')
|
|
|
|
|
});
|
|
|
|
|
this.clipboard = clipboard
|
|
|
|
|
if (course_group_id) {
|
|
|
|
|
if (!this.clipboard) {
|
|
|
|
|
const clipboard = new ClipboardJS('.copybtn');
|
|
|
|
|
clipboard.on('success', (e) => {
|
|
|
|
|
this.props.showNotification('复制成功')
|
|
|
|
|
});
|
|
|
|
|
this.clipboard = clipboard
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
@ -588,15 +595,15 @@ class studentsList extends Component{
|
|
|
|
|
<div>是否确认删除?</div>
|
|
|
|
|
</div>,
|
|
|
|
|
onOk: () => {
|
|
|
|
|
// const cid = this.props.match.params.coursesId
|
|
|
|
|
const course_group_id = this.props.match.params.course_group_id
|
|
|
|
|
const courseId = this.props.match.params.coursesId
|
|
|
|
|
|
|
|
|
|
const url = `/course_groups/${course_group_id}.json`
|
|
|
|
|
axios.delete(url)
|
|
|
|
|
.then((response) => {
|
|
|
|
|
if (response.data.status == 0) {
|
|
|
|
|
this.props.showNotification('删除成功')
|
|
|
|
|
this.props.history.push(response.data.right_url)
|
|
|
|
|
this.props.history.push(`/courses/${courseId}/course_groups`)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(function (error) {
|
|
|
|
@ -682,12 +689,14 @@ class studentsList extends Component{
|
|
|
|
|
if (this.props.match.path.endsWith('students')) {
|
|
|
|
|
|
|
|
|
|
} else if (course_group_id) {
|
|
|
|
|
pageType = TYPE_COURSE_GOURP_PARENT
|
|
|
|
|
} else {
|
|
|
|
|
pageType = TYPE_COURSE_GOURP_CHILD
|
|
|
|
|
} else {
|
|
|
|
|
pageType = TYPE_COURSE_GOURP_PARENT
|
|
|
|
|
}
|
|
|
|
|
// 本页面有2个状态,学生列表、具体分班
|
|
|
|
|
const isStudentPage = pageType == TYPE_STUDENTS
|
|
|
|
|
this.isStudentPage = isStudentPage
|
|
|
|
|
const isGroupChildPage = pageType == TYPE_COURSE_GOURP_CHILD
|
|
|
|
|
|
|
|
|
|
return(
|
|
|
|
|
<React.Fragment >
|
|
|
|
@ -700,7 +709,12 @@ class studentsList extends Component{
|
|
|
|
|
<Titlesearchsection
|
|
|
|
|
title={isParent ? (pageType == TYPE_STUDENTS ? "全部学生" : "学生列表"):
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
<span>{course_group_name || '未分班'}</span>
|
|
|
|
|
<span>
|
|
|
|
|
<Tooltip title="返回">
|
|
|
|
|
<i className="icon-zuojiantou iconfont font-14" onClick={() => { this.props.history.push(`/courses/${courseId}/course_groups`)}}
|
|
|
|
|
style={{color: '#212121', verticalAlign: 'initial', marginRight: '14px' }}
|
|
|
|
|
></i>
|
|
|
|
|
</Tooltip>{course_group_name || '未分班'}</span>
|
|
|
|
|
{isAdmin && invite_code && <React.Fragment>
|
|
|
|
|
<span className="color-grey-9 font-16 ml10">邀请码:</span>
|
|
|
|
|
<span className="color-orange font-16">
|
|
|
|
@ -742,7 +756,7 @@ class studentsList extends Component{
|
|
|
|
|
!isStudentPage && !isCourseEnd && isAdmin && <WordsBtn style="blue" className="mr30" onClick={()=>this.addDir()}>新建分班</WordsBtn> }
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
!isStudentPage && isStudent && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.addToDir()}>加入分班</WordsBtn> }
|
|
|
|
|
!isStudentPage && isStudent && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="" onClick={()=>this.addToDir()}>加入分班</WordsBtn> }
|
|
|
|
|
<style>{`
|
|
|
|
|
.drop_down_menu li a {
|
|
|
|
|
padding: 0px;
|
|
|
|
@ -797,7 +811,7 @@ 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'}}>
|
|
|
|
|
<div className="clearfix stu_head" style={{paddingLeft: '5px'}}>
|
|
|
|
|
{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>} */}
|
|
|
|
@ -828,7 +842,7 @@ class studentsList extends Component{
|
|
|
|
|
<p className="drop_down_btn">
|
|
|
|
|
<a href="javascript:void(0)" className="color-grey-6"
|
|
|
|
|
onClick={()=>this.addDir()}
|
|
|
|
|
>添加分班...</a>
|
|
|
|
|
>新建分班...</a>
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|