|
|
import React,{ Component } from "react";
|
|
|
import { Input,Checkbox,Table, Pagination, Modal,Menu ,Spin, Tooltip} from "antd";
|
|
|
import ClipboardJS from 'clipboard'
|
|
|
import '../css/Courses.css'
|
|
|
import '../css/members.css'
|
|
|
import CourseLayoutcomponent from '../common/CourseLayoutComponent'
|
|
|
|
|
|
import Titlesearchsection from '../common/titleSearch/TitleSearchSection'
|
|
|
import ColorCountText from '../common/titleSearch/ColorCountText'
|
|
|
import { WordsBtn, trigger, on, off, getUrl, downloadFile } from 'educoder'
|
|
|
import Modals from "../../modals/Modals";
|
|
|
import axios from 'axios'
|
|
|
import _ from 'lodash'
|
|
|
import NoneData from "../coursesPublic/NoneData"
|
|
|
import DownloadMessageysl from "../../modals/DownloadMessageysl";
|
|
|
import CreateGroupByImportModal from './modal/CreateGroupByImportModal'
|
|
|
|
|
|
const Search =Input.Search;
|
|
|
|
|
|
const buildColumns = (that) => {
|
|
|
const { course_groups } = that.state
|
|
|
const columns=[{
|
|
|
title: '序号',
|
|
|
dataIndex: 'id',
|
|
|
key: 'id',
|
|
|
align:'center',
|
|
|
width:"10%",
|
|
|
className:"color-grey-6",
|
|
|
render: (id, student, index) => {
|
|
|
return (that.state.page - 1) * 20 + index + 1
|
|
|
}
|
|
|
}, {
|
|
|
title: '用户id',
|
|
|
dataIndex: 'login',
|
|
|
key: 'login',
|
|
|
align:'center',
|
|
|
width:"10%",
|
|
|
className:"color-grey-6",
|
|
|
render: (login, record) => {
|
|
|
return <span className="color-dark overflowHidden1" style={{maxWidth: '160px'}}
|
|
|
title={login && login.length > 10 ? login : ''}
|
|
|
>{login}</span>
|
|
|
}
|
|
|
}, {
|
|
|
title: '姓名',
|
|
|
dataIndex: 'name',
|
|
|
key: 'name',
|
|
|
align:'center',
|
|
|
width:"10%",
|
|
|
className:"color-grey-6",
|
|
|
render: (name, record) => {
|
|
|
return <a className="color-dark overflowHidden1" target="_blank"
|
|
|
style={{maxWidth: '120px'}} href={`/users/${record.login}`}>{name}</a>
|
|
|
}
|
|
|
}, {
|
|
|
title: '学号',
|
|
|
dataIndex: 'student_id',
|
|
|
key: 'student_id',
|
|
|
align:'center',
|
|
|
width:"10%",
|
|
|
className:"color-grey-6",
|
|
|
render: (student_id, record) => {
|
|
|
return <span className="color-dark overflowHidden1 " title={student_id && student_id.length > 10 ? student_id : ''}
|
|
|
style={{maxWidth: '160px'}} >{student_id}</span>
|
|
|
}
|
|
|
}];
|
|
|
if (course_groups && course_groups.length) {
|
|
|
columns.push({
|
|
|
title: '分班',
|
|
|
dataIndex: 'course_group_name',
|
|
|
key: 'course_group_name',
|
|
|
align:'center',
|
|
|
width:"40%",
|
|
|
className:"color-grey-6"
|
|
|
})
|
|
|
}
|
|
|
const isAdminOrStudent = that.props.isAdminOrStudent()
|
|
|
if (!isAdminOrStudent) {
|
|
|
columns.some((item,key)=> {
|
|
|
if (item.title === "学号") {
|
|
|
columns.splice(key, 1)
|
|
|
return true
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
const isAdmin = that.props.isAdmin()
|
|
|
if (isAdmin) {
|
|
|
columns.unshift({
|
|
|
title: '',
|
|
|
dataIndex: 'check',
|
|
|
key: 'check',
|
|
|
render: (text, item) => {
|
|
|
return <Checkbox value={item.course_member_id} key={item.course_member_id} ></Checkbox>
|
|
|
},
|
|
|
width:"5%"
|
|
|
})
|
|
|
}
|
|
|
|
|
|
return columns;
|
|
|
}
|
|
|
|
|
|
// 1-按照学生学号 2-按照分班名称,
|
|
|
const ORDER_BY_NUM = 1;
|
|
|
const ORDER_BY_GROUP = 2;
|
|
|
|
|
|
class studentsList extends Component{
|
|
|
constructor(props){
|
|
|
super(props);
|
|
|
this.state={
|
|
|
page:1,
|
|
|
order: ORDER_BY_NUM,
|
|
|
searchValue: '',
|
|
|
course_groups: [],
|
|
|
students: [],
|
|
|
checkBoxValues: [],
|
|
|
|
|
|
stu_new_flag:false,
|
|
|
StudentList_value:"",
|
|
|
modalsType:"",
|
|
|
modalsTopval:"",
|
|
|
modalsBottomval:"",
|
|
|
modalCancel:"",
|
|
|
n_And_e:1,
|
|
|
isSpin:false,
|
|
|
DownloadType:false,
|
|
|
DownloadMessageval:undefined,
|
|
|
}
|
|
|
}
|
|
|
/// 确认是否下载
|
|
|
confirmysl(url){
|
|
|
// this.props.showGlobalLoading('正在生成文件,请稍后...')
|
|
|
axios.get(url + 'export=true').then((response) => {
|
|
|
if(response === undefined){
|
|
|
return
|
|
|
}
|
|
|
if(response.data.status&&response.data.status===-1){
|
|
|
|
|
|
}else if(response.data.status&&response.data.status===-2){
|
|
|
if(response.data.message === "100"){
|
|
|
// 已超出文件导出的上限数量(100 ),建议:
|
|
|
|
|
|
this.setState({
|
|
|
DownloadType:true,
|
|
|
DownloadMessageval:100
|
|
|
})
|
|
|
}else {
|
|
|
//因附件资料超过500M
|
|
|
this.setState({
|
|
|
DownloadType:true,
|
|
|
DownloadMessageval:500
|
|
|
})
|
|
|
}
|
|
|
}else {
|
|
|
|
|
|
// this.props.showNotification(`正在下载中`);
|
|
|
// window.open("/api"+url, '_blank');
|
|
|
this.props.slowDownload(url)
|
|
|
|
|
|
// getUrl() + "/api"+
|
|
|
// const fileUrl = url;
|
|
|
|
|
|
// this.props.slowDownload(fileUrl)
|
|
|
// return;
|
|
|
|
|
|
// downloadFile({
|
|
|
// url: fileUrl,
|
|
|
// successCallback: (url) => {
|
|
|
// console.log('successCallback')
|
|
|
// },
|
|
|
// failCallback: (responseHtml, url) => {
|
|
|
// console.log('failCallback')
|
|
|
// }
|
|
|
// })
|
|
|
// window.open(fileUrl, "_self");// , '_blank'
|
|
|
}
|
|
|
}).catch((error) => {
|
|
|
console.log(error)
|
|
|
});
|
|
|
}
|
|
|
|
|
|
Downloadcal=()=>{
|
|
|
this.setState({
|
|
|
DownloadType:false,
|
|
|
DownloadMessageval:undefined
|
|
|
})
|
|
|
}
|
|
|
|
|
|
inputStudent=(e)=>{
|
|
|
this.setState({
|
|
|
StudentList_value:e.target.value
|
|
|
})
|
|
|
}
|
|
|
// 有关新建分班和分班重命名
|
|
|
showStuNewBox=(index)=>{
|
|
|
this.setState({
|
|
|
stu_new_flag:true,
|
|
|
n_And_e:index
|
|
|
})
|
|
|
}
|
|
|
hideStuNewBox=()=>{
|
|
|
this.setState({
|
|
|
stu_new_flag:false
|
|
|
})
|
|
|
}
|
|
|
// 有关删除分班
|
|
|
delClasses=()=>{
|
|
|
this.setState({
|
|
|
modalsType:true,
|
|
|
modalsTopval:"该分班的学生将被移动到“XX班”",
|
|
|
modalsBottomval:"是否确认删除?",
|
|
|
modalCancel:true
|
|
|
})
|
|
|
}
|
|
|
cancelDelClasses=()=>{
|
|
|
this.setState({
|
|
|
modalsType:false,
|
|
|
modalsTopval:"",
|
|
|
modalsBottomval:"",
|
|
|
modalCancel:false
|
|
|
})
|
|
|
}
|
|
|
// 确认删除
|
|
|
sureDelClasses=()=>{
|
|
|
this.setState({
|
|
|
modalsType:false,
|
|
|
modalsTopval:"",
|
|
|
modalsBottomval:"",
|
|
|
modalCancel:false
|
|
|
})
|
|
|
}
|
|
|
|
|
|
onChange=()=>{
|
|
|
|
|
|
}
|
|
|
|
|
|
componentDidMount() {
|
|
|
this.setState({
|
|
|
isSpin:true
|
|
|
})
|
|
|
this.fetchAll()
|
|
|
const isAdmin = this.props.isAdmin()
|
|
|
// if (isAdmin) {
|
|
|
this.fetchCourseGroups();
|
|
|
// }
|
|
|
|
|
|
isAdmin && on('addStudentSuccess', this.addStudentSuccessListener)
|
|
|
isAdmin && on('updateNavSuccess', this.updateNavSuccess)
|
|
|
}
|
|
|
componentWillUnmount() {
|
|
|
const isAdmin = this.props.isAdmin()
|
|
|
if (isAdmin) {
|
|
|
off('addStudentSuccess', this.addStudentSuccessListener)
|
|
|
off('updateNavSuccess', this.updateNavSuccess)
|
|
|
}
|
|
|
}
|
|
|
createGroupImportSuccess = () => {
|
|
|
this.props.updataleftNavfun()
|
|
|
}
|
|
|
updateNavSuccess = () => {
|
|
|
this.fetchCourseGroups()
|
|
|
}
|
|
|
|
|
|
addStudentSuccessListener=(e, data)=>{
|
|
|
const params = JSON.parse(data)
|
|
|
const course_group_id = this.props.match.params.course_group_id
|
|
|
const coursesId = this.props.match.params.coursesId
|
|
|
if (params.course_group_id == course_group_id) {
|
|
|
this.fetchAll(1)
|
|
|
} else {
|
|
|
this.props.history.push(`/courses/${coursesId}/course_groups/${params.course_group_id}`)
|
|
|
}
|
|
|
// console.log('addStudentSuccessListener', data)
|
|
|
}
|
|
|
fetchCourseGroups = () => {
|
|
|
const courseId = this.props.match.params.coursesId
|
|
|
|
|
|
let url = `/courses/${courseId}/all_course_groups.json`
|
|
|
|
|
|
axios.get(url, {
|
|
|
})
|
|
|
.then((response) => {
|
|
|
if (response.data.course_groups && response.data.course_groups.length) {
|
|
|
this.setState({
|
|
|
course_groups: response.data.course_groups
|
|
|
})
|
|
|
} else {
|
|
|
// showNotification('')
|
|
|
}
|
|
|
})
|
|
|
.catch(function (error) {
|
|
|
console.log(error);
|
|
|
});
|
|
|
}
|
|
|
componentDidUpdate(prevProps) {
|
|
|
if (prevProps.match.params.course_group_id != this.props.match.params.course_group_id) {
|
|
|
this.setState({checkBoxValues: []})
|
|
|
this.fetchAll(1)
|
|
|
}
|
|
|
// 加载了2次
|
|
|
// else if (prevProps.coursesids != this.props.coursesids) {
|
|
|
// this.fetchAll(1)
|
|
|
// }
|
|
|
}
|
|
|
fetchAll = (argPage) => {
|
|
|
this.setState({
|
|
|
isSpin:true
|
|
|
})
|
|
|
let id = this.props.match.params.coursesId
|
|
|
let course_group_id = this.props.match.params.course_group_id
|
|
|
|
|
|
const { coursesids } = this.props
|
|
|
// if (!coursesids) {
|
|
|
// return;
|
|
|
// }
|
|
|
if (!course_group_id || course_group_id == coursesids) {
|
|
|
course_group_id = ''
|
|
|
}
|
|
|
if (argPage) {
|
|
|
this.setState({ page: argPage })
|
|
|
}
|
|
|
let page = argPage || this.state.page
|
|
|
let { order, searchValue }=this.state
|
|
|
let url=`/courses/${id}/students.json?order=${order}&page=${page}&limit=20&course_group_id=${course_group_id}`;
|
|
|
if(!!searchValue){
|
|
|
url+='&search='+searchValue;
|
|
|
}
|
|
|
axios.get((url)).then((result)=>{
|
|
|
if (result.data.students) {
|
|
|
this.setState({
|
|
|
students: result.data.students,
|
|
|
total_count: result.data.students_count,
|
|
|
course_group_name: result.data.course_group_name,
|
|
|
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
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
}).catch((error)=>{
|
|
|
console.log(error);
|
|
|
this.setState({
|
|
|
isSpin:false
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
|
|
|
onInputSearchChange = (e) => {
|
|
|
this.setState({
|
|
|
searchValue: e.target.value
|
|
|
})
|
|
|
|
|
|
if (this.timeoutHandler) {
|
|
|
clearTimeout(this.timeoutHandler)
|
|
|
}
|
|
|
this.timeoutHandler = setTimeout(() => {
|
|
|
this.fetchAll(1)
|
|
|
}, 1200)
|
|
|
}
|
|
|
onSortTypeChange = (order) => {
|
|
|
this.setState({ order: order }, () => {
|
|
|
this.fetchAll()
|
|
|
})
|
|
|
}
|
|
|
onPageChange = (page) => {
|
|
|
this.fetchAll(page)
|
|
|
this.setState({ checkAllValue: false })
|
|
|
}
|
|
|
|
|
|
onPressEnter = (e) => {
|
|
|
this.fetchAll(1)
|
|
|
}
|
|
|
|
|
|
onCheckBoxChange = (checkedValues) => {
|
|
|
this.setState({
|
|
|
checkBoxValues: checkedValues,
|
|
|
checkAllValue: checkedValues.length == this.state.students.length
|
|
|
})
|
|
|
}
|
|
|
// 多选
|
|
|
moveToGroup = (group) => {
|
|
|
const len = this.state.checkBoxValues.length
|
|
|
if (len == 0) {
|
|
|
this.props.showNotification('请从列表先选择要移动的学生')
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
let id = this.props.match.params.coursesId
|
|
|
let { order, searchValue }=this.state
|
|
|
let url=`/courses/${id}/transfer_to_course_group.json`;
|
|
|
axios.post((url), {
|
|
|
students: this.state.checkBoxValues.map(item => {return {course_member_id: item} }),
|
|
|
course_group_id: group.id
|
|
|
}).then((result)=>{
|
|
|
if (result.data.status == 0) {
|
|
|
this.props.showNotification('移动成功')
|
|
|
this.setState({checkBoxValues: []})
|
|
|
this.fetchAll()
|
|
|
this.props.updataleftNavfun()
|
|
|
|
|
|
}
|
|
|
}).catch((error)=>{
|
|
|
console.log(error);
|
|
|
})
|
|
|
}
|
|
|
onCheckAll = (e) => {
|
|
|
this.setState({
|
|
|
checkAllValue: e.target.checked
|
|
|
})
|
|
|
const values = this.state.students.map(item => {
|
|
|
return item.course_member_id
|
|
|
})
|
|
|
if (e.target.checked) {
|
|
|
const concated = this.state.checkBoxValues.concat(values);
|
|
|
const sortedUniqed = _.uniq(concated)
|
|
|
this.setState({
|
|
|
checkBoxValues: sortedUniqed
|
|
|
})
|
|
|
} else {
|
|
|
this.setState({
|
|
|
checkBoxValues: _.difference(this.state.checkBoxValues, values)
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
// 多选
|
|
|
onDelete = () => {
|
|
|
const len = this.state.checkBoxValues.length
|
|
|
if (len == 0) {
|
|
|
this.props.showNotification('请先从列表选择要删除的学生')
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
this.props.confirm({
|
|
|
// content: `确认要删除所选的${len}个学生吗?`,
|
|
|
content: `是否确认删除?`,
|
|
|
onOk: () => {
|
|
|
let id = this.props.match.params.coursesId
|
|
|
let url=`/courses/${id}/delete_from_course.json`;
|
|
|
axios.post((url), {
|
|
|
students: this.state.checkBoxValues.map(item => {return {course_member_id: item} }),
|
|
|
}).then((result)=>{
|
|
|
if (result.data.status == 0) {
|
|
|
this.props.showNotification('删除成功')
|
|
|
this.fetchAll()
|
|
|
this.setState({checkBoxValues: []})
|
|
|
trigger('updatabanner')
|
|
|
}
|
|
|
}).catch((error)=>{
|
|
|
console.log(error);
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
addDir = () => {
|
|
|
trigger('groupAdd', this.props.coursesids)
|
|
|
}
|
|
|
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})
|
|
|
}
|
|
|
deleteDir = () => {
|
|
|
this.props.confirm({
|
|
|
content: <div>
|
|
|
<div>该分班的学生将被移动到“未分班”</div>
|
|
|
<div>是否确认删除?</div>
|
|
|
</div>,
|
|
|
onOk: () => {
|
|
|
// const cid = this.props.match.params.coursesId
|
|
|
const course_group_id = this.props.match.params.course_group_id
|
|
|
|
|
|
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)
|
|
|
}
|
|
|
})
|
|
|
.catch(function (error) {
|
|
|
console.log(error);
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
jsCopy = () => {
|
|
|
var e = document.getElementById("copy_invite_code");
|
|
|
e.select();
|
|
|
document.execCommand("Copy");
|
|
|
this.props.showNotification('复制成功')
|
|
|
}
|
|
|
|
|
|
render(){
|
|
|
const isAdmin = this.props.isAdmin()
|
|
|
const isSuperAdmin = this.props.isSuperAdmin()
|
|
|
let {
|
|
|
page,
|
|
|
|
|
|
order,
|
|
|
StudentList_value,
|
|
|
stu_new_flag,
|
|
|
modalsType,
|
|
|
modalsTopval,
|
|
|
modalsBottomval,
|
|
|
n_And_e ,
|
|
|
|
|
|
students,
|
|
|
searchValue,
|
|
|
total_count,
|
|
|
course_groups,
|
|
|
checkBoxValues,
|
|
|
checkAllValue
|
|
|
}=this.state;
|
|
|
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
|
|
|
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
|
|
|
}
|
|
|
if (searchValue) {
|
|
|
searchValue = searchValue.trim()
|
|
|
if (searchValue) {
|
|
|
params.search = searchValue
|
|
|
}
|
|
|
}
|
|
|
let paramsString = ''
|
|
|
for (let key in params) {
|
|
|
paramsString += `${key}=${params[key]}&`
|
|
|
}
|
|
|
exportUrl += paramsString;
|
|
|
exportUrltwo+=paramsString;
|
|
|
exportUrlthree+=paramsString;
|
|
|
// console.log(paramsString);
|
|
|
// console.log(checkBoxValues);
|
|
|
// console.log(searchValue);
|
|
|
return(
|
|
|
<React.Fragment >
|
|
|
<DownloadMessageysl
|
|
|
{...this.props}
|
|
|
value={this.state.DownloadMessageval}
|
|
|
modalCancel={this.Downloadcal}
|
|
|
modalsType={this.state.DownloadType}
|
|
|
/>
|
|
|
<Titlesearchsection
|
|
|
title={isParent ? "学生列表" :
|
|
|
<React.Fragment>
|
|
|
<span>{course_group_name || '未分班'}</span>
|
|
|
{isAdmin && invite_code && <React.Fragment>
|
|
|
<span className="color-grey-9 font-16 ml10">邀请码:</span>
|
|
|
<span className="color-orange font-16">
|
|
|
{invite_code}
|
|
|
</span>
|
|
|
<Tooltip title={<div>
|
|
|
<div>成员可以通过邀请码主动加入课堂</div>
|
|
|
<div>点击立刻复制邀请码</div>
|
|
|
</div>}>
|
|
|
<span>
|
|
|
<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>
|
|
|
}
|
|
|
searchValue={ searchValue }
|
|
|
onInputSearchChange={this.onInputSearchChange}
|
|
|
showSearchInput={total_count >= 10}
|
|
|
searchPlaceholder={ '请输入姓名、学号进行搜索' }
|
|
|
firstRowRight={
|
|
|
<React.Fragment>
|
|
|
{ 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> }
|
|
|
{ isAdmin && isParent && <WordsBtn style="blue" className="mr30" onClick={()=>this.addDir()}>添加分班</WordsBtn> }
|
|
|
{ isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.deleteDir()}>删除分班</WordsBtn> }
|
|
|
{ isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.renameDir()}>分班重命名</WordsBtn> }
|
|
|
<style>{`
|
|
|
.drop_down_menu li a {
|
|
|
padding: 0px;
|
|
|
font-size: 14px;
|
|
|
}
|
|
|
.drop_down_menu {
|
|
|
width: 93px;
|
|
|
}
|
|
|
.drop_down_menu li {
|
|
|
overflow: visible;
|
|
|
width: 93px;
|
|
|
}
|
|
|
.drop_down_menu, .drop_down_normal {
|
|
|
padding-top: 10px;
|
|
|
padding-bottom: 8px;
|
|
|
}
|
|
|
|
|
|
`}</style>
|
|
|
{ isAdmin &&
|
|
|
<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>
|
|
|
<li><a
|
|
|
onClick={(i) => this.confirmysl(exportUrlthree)}>活跃度</a>
|
|
|
</li>
|
|
|
<li><a
|
|
|
onClick={(i) => this.confirmysl(exportUrl)}>总成绩</a>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</li>
|
|
|
}
|
|
|
{/*<WordsBtn style="blue" className="" onClick={(url)=>this.confirmysl(exportUrl)} >导出成绩</WordsBtn>*/}
|
|
|
{/* */}
|
|
|
</React.Fragment>
|
|
|
}
|
|
|
secondRowLeft={
|
|
|
total_count ? <ColorCountText count={total_count} name="个学生"></ColorCountText> : ''
|
|
|
}
|
|
|
onPressEnter={this.onPressEnter}
|
|
|
></Titlesearchsection>
|
|
|
{
|
|
|
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>}
|
|
|
<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="li_line drop_down">
|
|
|
移动到...<i className="iconfont icon-xiajiantou font-12 ml2"></i>
|
|
|
<ul className="drop_down_menu" style={{"right":"0px","left":"unset", minWidth: '160px', maxHeight: '324px', overflowY: 'auto'}}>
|
|
|
{
|
|
|
course_groups && course_groups.length > 9 ?
|
|
|
(<p className="drop_down_search">
|
|
|
<Input placeholder="搜索" value={this.state.groupSearchValue} onChange={(e) => {this.setState({groupSearchValue: e.target.value})}}/>
|
|
|
</p>):
|
|
|
''
|
|
|
}
|
|
|
{course_group_id != 0 && <li key={0} onClick={() => this.moveToGroup({id: 0})}>未分班</li>}
|
|
|
|
|
|
{ course_groups.filter((item)=> {
|
|
|
return item.id != course_group_id && (!this.state.groupSearchValue || item.name.indexOf(this.state.groupSearchValue) != -1)
|
|
|
}).map( item => {
|
|
|
return (
|
|
|
<li key={item.id} onClick={() => this.moveToGroup(item)} title={item.name}>{item.name}</li>
|
|
|
)
|
|
|
}) }
|
|
|
{ isAdmin &&
|
|
|
|
|
|
<p className="drop_down_btn">
|
|
|
<a href="javascript:void(0)" className="color-grey-6"
|
|
|
onClick={()=>this.addDir()}
|
|
|
>添加分班...</a>
|
|
|
</p>
|
|
|
|
|
|
}
|
|
|
</ul>
|
|
|
</li>}
|
|
|
|
|
|
<li className="drop_down">
|
|
|
{currentOrderName}
|
|
|
{ course_groups && !!course_groups.length &&
|
|
|
<React.Fragment>
|
|
|
<i className="iconfont icon-xiajiantou font-12 ml2"></i>
|
|
|
<ul className="drop_down_normal" style={{width: '124px'}}>
|
|
|
<li onClick={() => this.onSortTypeChange(ORDER_BY_NUM)} >学生学号排序</li>
|
|
|
<li onClick={() => this.onSortTypeChange(ORDER_BY_GROUP)} >分班名称排序</li>
|
|
|
</ul>
|
|
|
</React.Fragment>
|
|
|
}
|
|
|
</li>
|
|
|
</div>
|
|
|
</div>
|
|
|
<Spin size="large" spinning={this.state.isSpin}>
|
|
|
<div className="clearfix stu_table">
|
|
|
{!this.state.isSpin && <Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
|
|
|
<Table columns={buildColumns(this)} dataSource={students} pagination={false}></Table>
|
|
|
</Checkbox.Group> }
|
|
|
</div>
|
|
|
</Spin>
|
|
|
</div>
|
|
|
:
|
|
|
<NoneData></NoneData>
|
|
|
}
|
|
|
{/* showQuickJumper */}
|
|
|
{ total_count > 20 && <div className="clearfix mt30 mb50 edu-txt-center">
|
|
|
<Pagination showQuickJumper defaultCurrent={page} current={page} pageSize={20} total={total_count} onChange={this.onPageChange} />
|
|
|
</div> }
|
|
|
</React.Fragment>
|
|
|
)
|
|
|
}
|
|
|
}
|
|
|
export default studentsList; |