|
|
|
@ -7,7 +7,7 @@ import CourseLayoutcomponent from '../common/CourseLayoutComponent'
|
|
|
|
|
|
|
|
|
|
import Titlesearchsection from '../common/titleSearch/TitleSearchSection'
|
|
|
|
|
import ColorCountText from '../common/titleSearch/ColorCountText'
|
|
|
|
|
import { WordsBtn, trigger, on, off, getUrl, downloadFile , sortDirections } from 'educoder'
|
|
|
|
|
import { WordsBtn, trigger, on, off, getRandomcode, getRandomNumber , sortDirections } from 'educoder'
|
|
|
|
|
import Modals from "../../modals/Modals";
|
|
|
|
|
import axios from 'axios'
|
|
|
|
|
import _ from 'lodash'
|
|
|
|
@ -24,7 +24,7 @@ const TYPE_COURSE_GOURP_CHILD = 3
|
|
|
|
|
const buildColumns = (that,isParent) => {
|
|
|
|
|
const { course_groups , sortedInfo } = that.state
|
|
|
|
|
let showSorter = isParent==true
|
|
|
|
|
const courseId = that.props.match.params.coursesId
|
|
|
|
|
const courseId = that.props.match.params.coursesId
|
|
|
|
|
const columns=[{
|
|
|
|
|
title: '序号',
|
|
|
|
|
dataIndex: 'id',
|
|
|
|
@ -35,7 +35,7 @@ const buildColumns = (that,isParent) => {
|
|
|
|
|
render: (id, student, index) => {
|
|
|
|
|
return (that.state.page - 1) * 20 + index + 1
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
// {
|
|
|
|
|
// title: '用户id',
|
|
|
|
|
// dataIndex: 'login',
|
|
|
|
@ -48,7 +48,7 @@ const buildColumns = (that,isParent) => {
|
|
|
|
|
// title={login && login.length > 10 ? login : ''}
|
|
|
|
|
// >{login}</span>
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// },
|
|
|
|
|
{
|
|
|
|
|
title: '姓名',
|
|
|
|
|
dataIndex: 'name',
|
|
|
|
@ -57,7 +57,7 @@ const buildColumns = (that,isParent) => {
|
|
|
|
|
width:"10%",
|
|
|
|
|
className:"color-grey-6",
|
|
|
|
|
render: (name, record) => {
|
|
|
|
|
return <a className="color-dark overflowHidden1" target="_blank"
|
|
|
|
|
return <a className="color-dark overflowHidden1" target="_blank"
|
|
|
|
|
style={{maxWidth: '120px'}} href={`/users/${record.login}`}>{name}</a>
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
@ -106,7 +106,7 @@ const buildColumns = (that,isParent) => {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (that.hasGroupModule()) {
|
|
|
|
|
that.isStudentPage && columns.push({
|
|
|
|
|
title: '分班',
|
|
|
|
@ -126,7 +126,7 @@ const buildColumns = (that,isParent) => {
|
|
|
|
|
if (item.title === "学号") {
|
|
|
|
|
columns.splice(key, 1)
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
const isAdmin = that.props.isAdmin()
|
|
|
|
@ -149,7 +149,7 @@ const buildColumns = (that,isParent) => {
|
|
|
|
|
render: (text, record) => {
|
|
|
|
|
return (
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
<WordsBtn 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}
|
|
|
|
@ -164,7 +164,7 @@ const buildColumns = (that,isParent) => {
|
|
|
|
|
)
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return columns;
|
|
|
|
@ -199,7 +199,7 @@ class studentsList extends Component{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/// 确认是否下载
|
|
|
|
|
confirmysl(url){
|
|
|
|
|
confirmysl(url,urls){
|
|
|
|
|
// this.props.showGlobalLoading('正在生成文件,请稍后...')
|
|
|
|
|
axios.get(url + 'export=true').then((response) => {
|
|
|
|
|
if(response === undefined){
|
|
|
|
@ -223,11 +223,11 @@ class studentsList extends Component{
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// this.props.showNotification(`正在下载中`);
|
|
|
|
|
// window.open("/api"+url, '_blank');
|
|
|
|
|
this.props.slowDownload(url)
|
|
|
|
|
|
|
|
|
|
this.props.slowDownload(getRandomcode(url))
|
|
|
|
|
|
|
|
|
|
// getUrl() + "/api"+
|
|
|
|
|
// const fileUrl = url;
|
|
|
|
|
|
|
|
|
@ -263,7 +263,7 @@ class studentsList extends Component{
|
|
|
|
|
DownloadMessageval:undefined
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inputStudent=(e)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
StudentList_value:e.target.value
|
|
|
|
@ -307,7 +307,7 @@ class studentsList extends Component{
|
|
|
|
|
modalCancel:false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onChange=()=>{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -344,7 +344,7 @@ class studentsList extends Component{
|
|
|
|
|
this.fetchCourseGroups()
|
|
|
|
|
this.fetchAll()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addStudentSuccessListener=(e, data)=>{
|
|
|
|
|
const params = JSON.parse(data)
|
|
|
|
|
this.props.updataleftNavfun()
|
|
|
|
@ -358,10 +358,10 @@ class studentsList extends Component{
|
|
|
|
|
// console.log('addStudentSuccessListener', data)
|
|
|
|
|
}
|
|
|
|
|
fetchCourseGroups = () => {
|
|
|
|
|
const courseId = this.props.match.params.coursesId
|
|
|
|
|
|
|
|
|
|
const courseId = this.props.match.params.coursesId
|
|
|
|
|
|
|
|
|
|
let url = `/courses/${courseId}/all_course_groups.json`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
axios.get(url, {
|
|
|
|
|
})
|
|
|
|
|
.then((response) => {
|
|
|
|
@ -382,7 +382,7 @@ class studentsList extends Component{
|
|
|
|
|
this.setState({checkBoxValues: [], checkAllValue: false })
|
|
|
|
|
|
|
|
|
|
this.fetchAll(1)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 加载了2次
|
|
|
|
|
// else if (prevProps.coursesids != this.props.coursesids) {
|
|
|
|
|
// this.fetchAll(1)
|
|
|
|
@ -392,7 +392,7 @@ class studentsList extends Component{
|
|
|
|
|
this.setState({
|
|
|
|
|
isSpin:true
|
|
|
|
|
})
|
|
|
|
|
let id = this.props.match.params.coursesId
|
|
|
|
|
let id = this.props.match.params.coursesId
|
|
|
|
|
let course_group_id = this.props.match.params.course_group_id
|
|
|
|
|
|
|
|
|
|
const { coursesids } = this.props
|
|
|
|
@ -424,7 +424,7 @@ class studentsList extends Component{
|
|
|
|
|
}
|
|
|
|
|
axios.get(encodeURI(url)).then((result)=>{
|
|
|
|
|
if (result.data.students) {
|
|
|
|
|
this.setState({
|
|
|
|
|
this.setState({
|
|
|
|
|
students: result.data.students,
|
|
|
|
|
total_count: result.data.students_count,
|
|
|
|
|
course_group_name: result.data.course_group_name,
|
|
|
|
@ -468,7 +468,7 @@ class studentsList extends Component{
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
onPageChange = (page) => {
|
|
|
|
|
this.fetchAll(page)
|
|
|
|
|
this.fetchAll(page)
|
|
|
|
|
this.setState({ checkAllValue: false })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -490,7 +490,7 @@ class studentsList extends Component{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let id = this.props.match.params.coursesId
|
|
|
|
|
let id = this.props.match.params.coursesId
|
|
|
|
|
let { order, searchValue }=this.state
|
|
|
|
|
let url=`/courses/${id}/transfer_to_course_group.json`;
|
|
|
|
|
axios.post((url), {
|
|
|
|
@ -541,7 +541,7 @@ class studentsList extends Component{
|
|
|
|
|
// content: `确认要删除所选的${len}个学生吗?`,
|
|
|
|
|
content: `是否确认删除?`,
|
|
|
|
|
onOk: () => {
|
|
|
|
|
let id = this.props.match.params.coursesId
|
|
|
|
|
let id = this.props.match.params.coursesId
|
|
|
|
|
let url=`/courses/${id}/delete_from_course.json`;
|
|
|
|
|
axios.post((url), {
|
|
|
|
|
students: [{course_member_id: record.course_member_id}] // this.state.checkBoxValues.map(item => {return {course_member_id: item} }),
|
|
|
|
@ -563,7 +563,7 @@ class studentsList extends Component{
|
|
|
|
|
trigger('groupAdd', this.props.coursesids)
|
|
|
|
|
}
|
|
|
|
|
doAddToDir = async () => {
|
|
|
|
|
const courseId = this.props.match.params.coursesId
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
@ -578,12 +578,12 @@ class studentsList extends Component{
|
|
|
|
|
}
|
|
|
|
|
addToDir = (record) => {
|
|
|
|
|
this.props.confirm({
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
content: `是否确认加入分班: ${this.state.course_group_name}?`,
|
|
|
|
|
|
|
|
|
|
okText: '确认',
|
|
|
|
|
cancelText: '取消',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onOk: () => {
|
|
|
|
|
this.doAddToDir()
|
|
|
|
|
},
|
|
|
|
@ -604,7 +604,7 @@ class studentsList extends Component{
|
|
|
|
|
</div>,
|
|
|
|
|
onOk: () => {
|
|
|
|
|
const course_group_id = this.props.match.params.course_group_id
|
|
|
|
|
const courseId = this.props.match.params.coursesId
|
|
|
|
|
const courseId = this.props.match.params.coursesId
|
|
|
|
|
|
|
|
|
|
const url = `/course_groups/${course_group_id}.json`
|
|
|
|
|
axios.delete(url)
|
|
|
|
@ -616,7 +616,7 @@ class studentsList extends Component{
|
|
|
|
|
})
|
|
|
|
|
.catch(function (error) {
|
|
|
|
|
console.log(error);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
@ -643,7 +643,7 @@ class studentsList extends Component{
|
|
|
|
|
const isCourseEnd = this.props.isCourseEnd()
|
|
|
|
|
let {
|
|
|
|
|
page,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
order,
|
|
|
|
|
StudentList_value,
|
|
|
|
|
stu_new_flag,
|
|
|
|
@ -662,17 +662,19 @@ class studentsList extends Component{
|
|
|
|
|
let currentOrderName = '学生学号排序'
|
|
|
|
|
if (order == ORDER_BY_GROUP) {
|
|
|
|
|
currentOrderName = '分班名称排序'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const { coursesids } = this.props
|
|
|
|
|
const course_group_id = this.props.match.params.course_group_id
|
|
|
|
|
const isParent = !course_group_id || course_group_id == coursesids
|
|
|
|
|
const { course_group_name, invite_code } = this.state;
|
|
|
|
|
|
|
|
|
|
const courseId = this.props.match.params.coursesId
|
|
|
|
|
const courseId = this.props.match.params.coursesId
|
|
|
|
|
let exportUrl = `/courses/${courseId}/export_member_scores_excel.xlsx?`; //总成绩
|
|
|
|
|
let exportUrltwo = `/courses/${courseId}/export_couser_info.xlsx?`; //课堂信息
|
|
|
|
|
let exportUrlthree = `/courses/${courseId}/export_member_act_score.xlsx?`; //活跃度
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const params = {}
|
|
|
|
|
if (course_group_id) {
|
|
|
|
|
params.group_id = course_group_id
|
|
|
|
@ -685,11 +687,13 @@ class studentsList extends Component{
|
|
|
|
|
}
|
|
|
|
|
let paramsString = ''
|
|
|
|
|
for (let key in params) {
|
|
|
|
|
paramsString += `${key}=${params[key]}&`
|
|
|
|
|
paramsString += `&${key}=${params[key]}&`
|
|
|
|
|
}
|
|
|
|
|
exportUrl += paramsString;
|
|
|
|
|
exportUrltwo+=paramsString;
|
|
|
|
|
exportUrlthree+=paramsString;
|
|
|
|
|
exportUrlthree += paramsString;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// console.log(paramsString);
|
|
|
|
|
// console.log(checkBoxValues);
|
|
|
|
|
// console.log(searchValue);
|
|
|
|
@ -725,7 +729,7 @@ class studentsList extends Component{
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return(
|
|
|
|
|
<React.Fragment >
|
|
|
|
|
<DownloadMessageysl
|
|
|
|
@ -735,7 +739,7 @@ class studentsList extends Component{
|
|
|
|
|
modalsType={this.state.DownloadType}
|
|
|
|
|
/>
|
|
|
|
|
<Titlesearchsection
|
|
|
|
|
title={isParent ? (pageType == TYPE_STUDENTS ? "全部学生" : "学生列表"):
|
|
|
|
|
title={isParent ? (pageType == TYPE_STUDENTS ? "全部学生" : "学生列表"):
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
<span>
|
|
|
|
|
<Tooltip title="返回至分班列表">
|
|
|
|
@ -756,9 +760,9 @@ class studentsList extends Component{
|
|
|
|
|
<i class="iconfont icon-fuzhi font-14 ml10 copybtn" style={{color: '#FF6800', cursor: 'pointer', verticalAlign: 'baseline'}} data-clipboard-text={invite_code} ></i>
|
|
|
|
|
</span>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
}
|
|
|
|
|
searchValue={ searchValue }
|
|
|
|
@ -766,24 +770,24 @@ class studentsList extends Component{
|
|
|
|
|
showSearchInput={total_count >= 10}
|
|
|
|
|
searchPlaceholder={ '请输入姓名、学号进行搜索' }
|
|
|
|
|
firstRowRight={
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
{/* {
|
|
|
|
|
// pageType !== TYPE_STUDENTS &&
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
{/* {
|
|
|
|
|
// pageType !== TYPE_STUDENTS &&
|
|
|
|
|
!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> } */}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
!isStudentPage && isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.deleteDir()}>删除分班</WordsBtn> }
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
!isStudentPage && isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.renameDir()}>分班重命名</WordsBtn> }
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
!isStudentPage && !isCourseEnd && isAdmin && <WordsBtn style="blue" className="mr30" onClick={()=>this.addDir()}>新建分班</WordsBtn> }
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
!isStudentPage && isStudent && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="" onClick={()=>this.addToDir()}>加入分班</WordsBtn> }
|
|
|
|
|
<style>{`
|
|
|
|
|
.drop_down_menu li a {
|
|
|
|
@ -815,6 +819,7 @@ class studentsList extends Component{
|
|
|
|
|
<li className="li_line drop_down fr color-blue font-16">
|
|
|
|
|
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
|
|
|
|
|
<ul className="drop_down_menu" style={{"right": "-20px", "left": "unset", "height": "auto"}}>
|
|
|
|
|
|
|
|
|
|
<li><a
|
|
|
|
|
onClick={(i) => this.confirmysl(exportUrltwo)}>课堂信息</a>
|
|
|
|
|
</li>
|
|
|
|
@ -824,6 +829,7 @@ class studentsList extends Component{
|
|
|
|
|
<li><a
|
|
|
|
|
onClick={(i) => this.confirmysl(exportUrl)}>总成绩</a>
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
</li>
|
|
|
|
|
}
|
|
|
|
@ -854,7 +860,7 @@ class studentsList extends Component{
|
|
|
|
|
''
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
course_group_id != 0 && course_groups && course_groups.length > 0 &&
|
|
|
|
|
course_group_id != 0 && course_groups && course_groups.length > 0 &&
|
|
|
|
|
<li key={0} onClick={() => this.moveToGroup({id: 0})}>未分班</li>
|
|
|
|
|
}
|
|
|
|
|
{ course_groups.filter((item)=> {
|
|
|
|
@ -865,8 +871,8 @@ class studentsList extends Component{
|
|
|
|
|
)
|
|
|
|
|
}) }
|
|
|
|
|
{ course_groups && course_groups.length > 0 && <Divider className="dividerStyle"></Divider> }
|
|
|
|
|
{ isAdmin && !isCourseEnd &&
|
|
|
|
|
|
|
|
|
|
{ isAdmin && !isCourseEnd &&
|
|
|
|
|
|
|
|
|
|
<p className="drop_down_btn">
|
|
|
|
|
<a href="javascript:void(0)" className="color-grey-6"
|
|
|
|
|
onClick={()=>this.addDir()}
|
|
|
|
@ -876,10 +882,10 @@ class studentsList extends Component{
|
|
|
|
|
}
|
|
|
|
|
</ul>
|
|
|
|
|
</li>}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/* <li className="drop_down">
|
|
|
|
|
{currentOrderName}
|
|
|
|
|
{ course_groups && !!course_groups.length &&
|
|
|
|
|
{ course_groups && !!course_groups.length &&
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
<i className="iconfont icon-xiajiantou font-12 ml2"></i>
|
|
|
|
|
<ul className="drop_down_normal" style={{width: '124px'}}>
|
|
|
|
@ -893,7 +899,7 @@ class studentsList extends Component{
|
|
|
|
|
</div>
|
|
|
|
|
<Spin size="large" spinning={this.state.isSpin}>
|
|
|
|
|
<div className="clearfix stu_table">
|
|
|
|
|
{students && !!students.length && <Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
|
|
|
|
|
{students && !!students.length && <Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
|
|
|
|
|
<Table columns={studentlist} dataSource={students} onChange={this.onTableChange} pagination={false}></Table>
|
|
|
|
|
</Checkbox.Group> }
|
|
|
|
|
</div>
|
|
|
|
|