|
|
|
@ -1,10 +1,12 @@
|
|
|
|
|
import React,{ Component } from "react";
|
|
|
|
|
import {Table, Pagination, Tooltip, Spin, Row, Col, Checkbox, Tabs, Menu, Dropdown, Icon, Input} from "antd";
|
|
|
|
|
import {WordsBtn, on, off, trigger, getImageUrl, sortDirections} from 'educoder';
|
|
|
|
|
import {Table, Pagination,Tooltip,Spin, Row, Col ,Checkbox,Tabs,Menu, Dropdown, Icon,Input} from "antd";
|
|
|
|
|
import { WordsBtn,on, off, trigger ,getImageUrl,sortDirections} from 'educoder';
|
|
|
|
|
import axios from'axios';
|
|
|
|
|
import Dropdownbox from './Dropdownbox';
|
|
|
|
|
import Dynamiclist from './Dynamiclist';
|
|
|
|
|
import NoneData from "../../courses/coursesPublic/NoneData";
|
|
|
|
|
import './Statistics.css';
|
|
|
|
|
|
|
|
|
|
const { TabPane } = Tabs;
|
|
|
|
|
class Statistics extends Component{
|
|
|
|
|
constructor(props){
|
|
|
|
@ -12,165 +14,163 @@ class Statistics extends Component{
|
|
|
|
|
this.state={
|
|
|
|
|
nd1:60,
|
|
|
|
|
nd2:40,
|
|
|
|
|
nd3: 20,
|
|
|
|
|
data: undefined,
|
|
|
|
|
bomdata: undefined,
|
|
|
|
|
topisSpin: true,
|
|
|
|
|
bomisSpin: true,
|
|
|
|
|
sort: 'desc',
|
|
|
|
|
course_groups: [],
|
|
|
|
|
page: 1,
|
|
|
|
|
all_count: null,
|
|
|
|
|
activeKey: '1',
|
|
|
|
|
nd3:20,
|
|
|
|
|
data:undefined,
|
|
|
|
|
bomdata:undefined,
|
|
|
|
|
topisSpin:true,
|
|
|
|
|
bomisSpin:true,
|
|
|
|
|
sort:'desc',
|
|
|
|
|
course_groups:[],
|
|
|
|
|
page:1,
|
|
|
|
|
all_count:null,
|
|
|
|
|
activeKey:'1',
|
|
|
|
|
visible: false,
|
|
|
|
|
group_ids: [],
|
|
|
|
|
course_members: []
|
|
|
|
|
group_ids:[],
|
|
|
|
|
course_members:[]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
this.getdatas()
|
|
|
|
|
this.getdatas()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getdatas = () => {
|
|
|
|
|
let {page, group_ids, sort} = this.state;
|
|
|
|
|
let courseId = this.props.match.params.coursesId;
|
|
|
|
|
let url = `/courses/${courseId}/statistics.json`;
|
|
|
|
|
getdatas=()=>{
|
|
|
|
|
let {page,group_ids,sort}=this.state;
|
|
|
|
|
let courseId=this.props.match.params.coursesId;
|
|
|
|
|
let url=`/courses/${courseId}/statistics.json`;
|
|
|
|
|
axios.get(url).then((result) => {
|
|
|
|
|
if (result) {
|
|
|
|
|
this.setState({
|
|
|
|
|
data: result.data.top_scores,
|
|
|
|
|
topisSpin: false
|
|
|
|
|
data:result.data.top_scores,
|
|
|
|
|
topisSpin:false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error);
|
|
|
|
|
this.setState({
|
|
|
|
|
topisSpin: false,
|
|
|
|
|
topisSpin:false,
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
let courseurl = `/courses/${courseId}/all_course_groups.json`;
|
|
|
|
|
let courseurl=`/courses/${courseId}/all_course_groups.json`;
|
|
|
|
|
axios.get(courseurl).then((result) => {
|
|
|
|
|
if (result) {
|
|
|
|
|
this.setState({
|
|
|
|
|
course_groups: result.data.course_groups
|
|
|
|
|
course_groups:result.data.course_groups
|
|
|
|
|
})
|
|
|
|
|
let list = result.data.course_groups;
|
|
|
|
|
if (list.length > 0) {
|
|
|
|
|
this.setState({
|
|
|
|
|
group_ids: [list[0].id],
|
|
|
|
|
})
|
|
|
|
|
this.getwork_scoredata(page, [list[0].id], sort);
|
|
|
|
|
}
|
|
|
|
|
let list=result.data.course_groups;
|
|
|
|
|
// if(list.length>0){
|
|
|
|
|
// this.setState({
|
|
|
|
|
// group_ids:[list[0].id],
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
this.getwork_scoredata(page,undefined,sort);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getDynamiclistdatas = (group_ids) => {
|
|
|
|
|
getDynamiclistdatas=(group_ids)=>{
|
|
|
|
|
|
|
|
|
|
let courseId = this.props.match.params.coursesId;
|
|
|
|
|
let url = `/courses/${courseId}/act_score.json`;
|
|
|
|
|
let data = {
|
|
|
|
|
group_ids: group_ids,
|
|
|
|
|
let courseId=this.props.match.params.coursesId;
|
|
|
|
|
let url=`/courses/${courseId}/act_score.json`;
|
|
|
|
|
let data={
|
|
|
|
|
group_ids:group_ids,
|
|
|
|
|
}
|
|
|
|
|
axios.get(url, {
|
|
|
|
|
params:
|
|
|
|
|
axios.get(url,{params:
|
|
|
|
|
data
|
|
|
|
|
}).then((result) => {
|
|
|
|
|
if (result) {
|
|
|
|
|
this.setState({
|
|
|
|
|
course_members: result.data.course_members,
|
|
|
|
|
bomisSpin: false
|
|
|
|
|
course_members:result.data.course_members,
|
|
|
|
|
bomisSpin:false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error);
|
|
|
|
|
this.setState({
|
|
|
|
|
bomisSpin: false,
|
|
|
|
|
bomisSpin:false,
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getwork_scoredata = (page, group_ids, sort) => {
|
|
|
|
|
let {activeKey} = this.state;
|
|
|
|
|
getwork_scoredata=(page,group_ids,sort)=>{
|
|
|
|
|
let {activeKey}=this.state;
|
|
|
|
|
this.setState({
|
|
|
|
|
page: page,
|
|
|
|
|
sort: sort,
|
|
|
|
|
group_ids: group_ids,
|
|
|
|
|
bomisSpin: true,
|
|
|
|
|
page:page,
|
|
|
|
|
sort:sort,
|
|
|
|
|
group_ids:this.props.isStudent()===true?undefined:group_ids,
|
|
|
|
|
bomisSpin:true,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
if (activeKey === '1') {
|
|
|
|
|
let courseId = this.props.match.params.coursesId;
|
|
|
|
|
let url = `/courses/${courseId}/work_score.json`;
|
|
|
|
|
let data = {
|
|
|
|
|
limit: 20,
|
|
|
|
|
page: page,
|
|
|
|
|
group_ids: group_ids,
|
|
|
|
|
sort: sort
|
|
|
|
|
}
|
|
|
|
|
axios.get(url, {
|
|
|
|
|
params:
|
|
|
|
|
if(activeKey==='1'){
|
|
|
|
|
let courseId=this.props.match.params.coursesId;
|
|
|
|
|
let url=`/courses/${courseId}/work_score.json`;
|
|
|
|
|
let data={
|
|
|
|
|
limit:20,
|
|
|
|
|
page:page,
|
|
|
|
|
group_ids:this.props.isStudent()===true?undefined:group_ids,
|
|
|
|
|
sort:sort
|
|
|
|
|
}
|
|
|
|
|
axios.get(url,{params:
|
|
|
|
|
data
|
|
|
|
|
}).then((result) => {
|
|
|
|
|
if (result) {
|
|
|
|
|
this.setState({
|
|
|
|
|
bomdata: result.data.course_members,
|
|
|
|
|
all_count: result.data.all_count,
|
|
|
|
|
bomisSpin: false
|
|
|
|
|
bomdata:result.data.course_members,
|
|
|
|
|
all_count:result.data.all_count,
|
|
|
|
|
bomisSpin:false
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error);
|
|
|
|
|
this.setState({
|
|
|
|
|
bomisSpin: false,
|
|
|
|
|
bomisSpin:false,
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.getDynamiclistdatas(group_ids)
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
this.getDynamiclistdatas(group_ids)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
activeKey = (key) => {
|
|
|
|
|
if (key === "1") {
|
|
|
|
|
let {page, group_ids, sort} = this.state;
|
|
|
|
|
activeKey=(key)=>{
|
|
|
|
|
if(key==="1"){
|
|
|
|
|
let {page,group_ids,sort}=this.state;
|
|
|
|
|
// this.getdatas()
|
|
|
|
|
this.getwork_scoredata(page, group_ids, sort)
|
|
|
|
|
} else {
|
|
|
|
|
let {group_ids} = this.state;
|
|
|
|
|
this.getwork_scoredata(page,group_ids,sort)
|
|
|
|
|
}else{
|
|
|
|
|
let{group_ids}=this.state;
|
|
|
|
|
this.getDynamiclistdatas(group_ids)
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
activeKey: key
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
activeKey:key
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PaginationCourse = (pageNumber) => {
|
|
|
|
|
let {group_ids, sort} = this.state;
|
|
|
|
|
PaginationCourse=(pageNumber)=>{
|
|
|
|
|
let {group_ids,sort}=this.state;
|
|
|
|
|
|
|
|
|
|
this.getwork_scoredata(pageNumber, group_ids, sort);
|
|
|
|
|
this.getwork_scoredata(pageNumber,group_ids,sort);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
derivefun = (url) => {
|
|
|
|
|
let {group_ids} = this.state;
|
|
|
|
|
let data = {
|
|
|
|
|
group_id: group_ids
|
|
|
|
|
derivefun=(url)=>{
|
|
|
|
|
let{group_ids}=this.state;
|
|
|
|
|
let data={
|
|
|
|
|
group_id:group_ids
|
|
|
|
|
}
|
|
|
|
|
axios.get(url, {
|
|
|
|
|
params:
|
|
|
|
|
axios.get(url,{params:
|
|
|
|
|
data
|
|
|
|
|
}).then((response) => {
|
|
|
|
|
if (response === undefined) {
|
|
|
|
|
}).then((response)=>{
|
|
|
|
|
if(response === undefined){
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (response.data.status && response.data.status === -1) {
|
|
|
|
|
if(response.data.status&&response.data.status===-1){
|
|
|
|
|
this.props.showNotification(response.data.message);
|
|
|
|
|
} else if (response.data.status && response.data.status === -2) {
|
|
|
|
|
}else if(response.data.status&&response.data.status===-2){
|
|
|
|
|
// if(response.data.message === "100"){
|
|
|
|
|
// // 已超出文件导出的上限数量(100 ),建议:
|
|
|
|
|
//
|
|
|
|
@ -186,7 +186,7 @@ class Statistics extends Component{
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
this.props.showNotification(response.data.message);
|
|
|
|
|
} else {
|
|
|
|
|
}else {
|
|
|
|
|
// this.props.showNotification(`正在下载中`);
|
|
|
|
|
// window.open("/api"+url, '_blank');
|
|
|
|
|
this.props.slowDownload(url);
|
|
|
|
@ -198,31 +198,31 @@ class Statistics extends Component{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 筛选
|
|
|
|
|
handleTableChange = (pagination, filters, data) => {
|
|
|
|
|
let order = data.order;
|
|
|
|
|
let {page, group_ids} = this.state;
|
|
|
|
|
if (order === "descend") {
|
|
|
|
|
this.getwork_scoredata(page, group_ids, 'desc')
|
|
|
|
|
} else {
|
|
|
|
|
this.getwork_scoredata(page, group_ids, 'asc')
|
|
|
|
|
handleTableChange =(pagination, filters, data)=>{
|
|
|
|
|
let order=data.order;
|
|
|
|
|
let {page,group_ids}=this.state;
|
|
|
|
|
if(order==="descend"){
|
|
|
|
|
this.getwork_scoredata(page,group_ids,'desc')
|
|
|
|
|
}else{
|
|
|
|
|
this.getwork_scoredata(page,group_ids,'asc')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render(){
|
|
|
|
|
let {nd1, nd2, nd3, data, bomdata} = this.state;
|
|
|
|
|
let {nd1,nd2,nd3,data,bomdata,course_members}=this.state;
|
|
|
|
|
|
|
|
|
|
const columns = [
|
|
|
|
|
{
|
|
|
|
|
title: this.props.isAdmin() === true ? '序号' : '排名',
|
|
|
|
|
title: this.props.isAdmin()===true?'序号':'排名',
|
|
|
|
|
dataIndex: 'index',
|
|
|
|
|
render: (text, record, index) => {
|
|
|
|
|
return this.props.isAdmin() === true ? (this.state.page - 1) * 20 + index + 1 : record.rank
|
|
|
|
|
render: (text, record,index) => {
|
|
|
|
|
return this.props.isAdmin()===true?(this.state.page - 1) * 20 + index + 1:record.rank
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '姓名',
|
|
|
|
|
dataIndex: 'user_name',
|
|
|
|
|
dataIndex:'user_name',
|
|
|
|
|
render: (text, record) => (
|
|
|
|
|
<span>{record.user_name}</span>
|
|
|
|
|
)
|
|
|
|
@ -231,68 +231,66 @@ class Statistics extends Component{
|
|
|
|
|
title: '分班',
|
|
|
|
|
dataIndex: 'course_group',
|
|
|
|
|
render: (text, record) => (
|
|
|
|
|
<span>{record.course_group}</span>
|
|
|
|
|
<span >{record.course_group}</span>
|
|
|
|
|
)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '实训作业',
|
|
|
|
|
dataIndex: 'practice_score',
|
|
|
|
|
render: (text, record) => (
|
|
|
|
|
<span>{record.practice_score.toFixed(2)}</span>
|
|
|
|
|
<span >{record.practice_score.toFixed(2)}</span>
|
|
|
|
|
)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '普通作业',
|
|
|
|
|
dataIndex: 'common_score',
|
|
|
|
|
render: (text, record) => (
|
|
|
|
|
<span>{record.common_score.toFixed(2)}</span>
|
|
|
|
|
<span >{record.common_score.toFixed(2)}</span>
|
|
|
|
|
)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '分组作业',
|
|
|
|
|
dataIndex: 'group_score',
|
|
|
|
|
render: (text, record) => (
|
|
|
|
|
<span>{record.group_score.toFixed(2)}</span>
|
|
|
|
|
<span >{record.group_score.toFixed(2)}</span>
|
|
|
|
|
)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '毕设任务',
|
|
|
|
|
dataIndex: 'graduation_score',
|
|
|
|
|
render: (text, record) => (
|
|
|
|
|
<span>{record.graduation_score.toFixed(2)}</span>
|
|
|
|
|
<span >{record.graduation_score.toFixed(2)}</span>
|
|
|
|
|
)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '试卷',
|
|
|
|
|
dataIndex: 'exercise_score',
|
|
|
|
|
render: (text, record) => (
|
|
|
|
|
<span>{record.exercise_score}</span>
|
|
|
|
|
<span >{record.exercise_score}</span>
|
|
|
|
|
)
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '总成绩',
|
|
|
|
|
dataIndex: 'total_score',
|
|
|
|
|
sorter: this.props.isAdmin() === true ? true : false,
|
|
|
|
|
sorter: this.props.isAdmin()===true?true:false,
|
|
|
|
|
defaultSortOrder: 'descend',
|
|
|
|
|
sortDirections: sortDirections,
|
|
|
|
|
render: (text, record) => (
|
|
|
|
|
<span>{record.total_score.toFixed(2)}</span>
|
|
|
|
|
<span >{record.total_score.toFixed(2)}</span>
|
|
|
|
|
)
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
let course_grouptype = false;
|
|
|
|
|
if (this.props && this.props.course_modules != undefined) {
|
|
|
|
|
{
|
|
|
|
|
this.props && this.props.course_modules.map((item, key) => {
|
|
|
|
|
if (item.type === "course_group") {
|
|
|
|
|
course_grouptype = true
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
let course_grouptype=false;
|
|
|
|
|
if(this.props&&this.props.course_modules!=undefined){
|
|
|
|
|
{this.props&&this.props.course_modules.map((item,key)=>{
|
|
|
|
|
if(item.type==="course_group"){
|
|
|
|
|
course_grouptype=true
|
|
|
|
|
}
|
|
|
|
|
})}
|
|
|
|
|
}
|
|
|
|
|
if (course_grouptype === false) {
|
|
|
|
|
columns.some((item, key) => {
|
|
|
|
|
if(course_grouptype===false){
|
|
|
|
|
columns.some((item,key)=> {
|
|
|
|
|
if (item.title === "分班") {
|
|
|
|
|
columns.splice(key, 1)
|
|
|
|
|
return true
|
|
|
|
@ -317,168 +315,166 @@ class Statistics extends Component{
|
|
|
|
|
<Dropdownbox
|
|
|
|
|
{...this.props}
|
|
|
|
|
{...this.state}
|
|
|
|
|
postwork_scoredata={(group_idss) => this.getwork_scoredata(1, group_idss, 'desc')}
|
|
|
|
|
postwork_scoredata={(group_idss)=>this.getwork_scoredata(1,group_idss,'desc')}
|
|
|
|
|
/>
|
|
|
|
|
<a className={"ml20 ant-btn-link"}
|
|
|
|
|
onClick={() => this.derivefun(`/courses/${this.props.match.params.coursesId}/export_member_scores_excel.xlsx`)}>导出</a>
|
|
|
|
|
<a className={"ml20 ant-btn-link"} onClick={()=>this.derivefun(`/courses/${this.props.match.params.coursesId}/export_member_scores_excel.xlsx`)}>导出</a>
|
|
|
|
|
</React.Fragment>;
|
|
|
|
|
return(
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
<div className="edu-back-white">
|
|
|
|
|
<Spin size="large" spinning={this.state.topisSpin}>
|
|
|
|
|
<p className="clearfix padding30">
|
|
|
|
|
<Row gutter={24}>
|
|
|
|
|
<Col>
|
|
|
|
|
明星学员
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
|
|
<Row type="flex" justify="center" align="bottom">
|
|
|
|
|
{data && data.map((item, key) => {
|
|
|
|
|
if (key === 3) {
|
|
|
|
|
return (
|
|
|
|
|
<Col span={3}>
|
|
|
|
|
<li className="pr rankingss">
|
|
|
|
|
<a href={`/users/${item.user_login}`} className="color-dark">
|
|
|
|
|
<img src={getImageUrl(`images/${item.avatar_url}`)}/>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
</Col>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})}
|
|
|
|
|
{data && data.map((item, key) => {
|
|
|
|
|
if (key === 1) {
|
|
|
|
|
return (
|
|
|
|
|
<Col span={5}>
|
|
|
|
|
<li className="pr rankingss">
|
|
|
|
|
<a href={`/users/${item.user_login}`} className="color-dark">
|
|
|
|
|
<img src={getImageUrl(`images/${item.avatar_url}`)} className={"mb10"}/>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
<Col className={`height-${nd2}`}>
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
</Col>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})}
|
|
|
|
|
|
|
|
|
|
{data && data.map((item, key) => {
|
|
|
|
|
if (key === 0) {
|
|
|
|
|
return (
|
|
|
|
|
<Col span={5} className={"relatives"}>
|
|
|
|
|
<li className="pr rankingss">
|
|
|
|
|
<img src="https://test-newweb.educoder.net/images/educoder/huangguan.png"
|
|
|
|
|
className="huangguans mb5"/>
|
|
|
|
|
<a href={`/users/${item.user_login}`} className="color-dark">
|
|
|
|
|
<img src={getImageUrl(`images/${item.avatar_url}`)} className={"mb10 mt5"}/>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
<Col className={`height-${nd1}`}>
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
<p className="clearfix padding30">
|
|
|
|
|
<Row gutter={24}>
|
|
|
|
|
<Col className={"Statisticsmxxy"}>
|
|
|
|
|
明星学员
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
|
|
<Row type="flex" justify="center" align="bottom">
|
|
|
|
|
{data&&data.map((item,key)=>{
|
|
|
|
|
if(key===3){
|
|
|
|
|
return(
|
|
|
|
|
<Col span={3}>
|
|
|
|
|
<li className="pr rankingss">
|
|
|
|
|
<a href={`/users/${item.user_login}`} className="color-dark">
|
|
|
|
|
<img src={getImageUrl(`images/${item.avatar_url}`)}/>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
</Col>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})}
|
|
|
|
|
{data&&data.map((item,key)=>{
|
|
|
|
|
if(key===1){
|
|
|
|
|
return(
|
|
|
|
|
<Col span={5}>
|
|
|
|
|
<li className="pr rankingss">
|
|
|
|
|
<a href={`/users/${item.user_login}`} className="color-dark">
|
|
|
|
|
<img src={getImageUrl(`images/${item.avatar_url}`)} className={"mb10"}/>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
<Col className={`height-${nd2}`}>
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})}
|
|
|
|
|
|
|
|
|
|
{data && data.map((item, key) => {
|
|
|
|
|
if (key === 2) {
|
|
|
|
|
return (
|
|
|
|
|
<Col span={5}>
|
|
|
|
|
<li className="pr rankingss">
|
|
|
|
|
<a href={`/users/${item.user_login}`} className="color-dark">
|
|
|
|
|
<img src={getImageUrl(`images/${item.avatar_url}`)} className={"mb10"}/>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
<Col className={`height-${nd3}`}>
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
</Col>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})}
|
|
|
|
|
|
|
|
|
|
{data&&data.map((item,key)=>{
|
|
|
|
|
if(key===0){
|
|
|
|
|
return(
|
|
|
|
|
<Col span={5} className={"relatives"}>
|
|
|
|
|
<li className="pr rankingss">
|
|
|
|
|
<img src="https://test-newweb.educoder.net/images/educoder/huangguan.png" className="huangguans mb5" />
|
|
|
|
|
<a href={`/users/${item.user_login}`} className="color-dark">
|
|
|
|
|
<img src={getImageUrl(`images/${item.avatar_url}`)} className={"mb10 mt5"}/>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
<Col className={`height-${nd1}`}>
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
</Col>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})}
|
|
|
|
|
})}
|
|
|
|
|
|
|
|
|
|
{data&&data.map((item,key)=>{
|
|
|
|
|
if(key===2){
|
|
|
|
|
return(
|
|
|
|
|
<Col span={5}>
|
|
|
|
|
<li className="pr rankingss">
|
|
|
|
|
<a href={`/users/${item.user_login}`} className="color-dark">
|
|
|
|
|
<img src={getImageUrl(`images/${item.avatar_url}`)} className={"mb10"}/>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
<Col className={`height-${nd3}`}>
|
|
|
|
|
|
|
|
|
|
{data && data.map((item, key) => {
|
|
|
|
|
if (key === 4) {
|
|
|
|
|
return (
|
|
|
|
|
<Col span={3}>
|
|
|
|
|
<li className="pr rankingss">
|
|
|
|
|
<a href={`/users/${item.user_login}`} className="color-dark">
|
|
|
|
|
<img src={getImageUrl(`images/${item.avatar_url}`)}/>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
</Col>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
</Col>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})}
|
|
|
|
|
})}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Row>
|
|
|
|
|
{data&&data.map((item,key)=>{
|
|
|
|
|
if(key===4){
|
|
|
|
|
return(
|
|
|
|
|
<Col span={3}>
|
|
|
|
|
<li className="pr rankingss">
|
|
|
|
|
<a href={`/users/${item.user_login}`} className="color-dark">
|
|
|
|
|
<img src={getImageUrl(`images/${item.avatar_url}`)}/>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
</Col>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})}
|
|
|
|
|
|
|
|
|
|
<Row className="mt10" type="flex" justify="center" align="bottom">
|
|
|
|
|
|
|
|
|
|
{data && data.map((item, key) => {
|
|
|
|
|
if (key === 3) {
|
|
|
|
|
return (
|
|
|
|
|
<Col span={3} className={"Statisticscenter"}>
|
|
|
|
|
<Col>{item.user_name}</Col>
|
|
|
|
|
<Col>4th</Col>
|
|
|
|
|
</Col>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
})}
|
|
|
|
|
{data && data.map((item, key) => {
|
|
|
|
|
if (key === 1) {
|
|
|
|
|
return (
|
|
|
|
|
<Col span={5} className={"Statisticscenter"}>
|
|
|
|
|
<Col>{item.user_name}</Col>
|
|
|
|
|
<Col>2th</Col>
|
|
|
|
|
</Col>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
})}
|
|
|
|
|
{data && data.map((item, key) => {
|
|
|
|
|
if (key === 0) {
|
|
|
|
|
return (
|
|
|
|
|
<Col span={5} className={"Statisticscenter"}>
|
|
|
|
|
<Col>{item.user_name}</Col>
|
|
|
|
|
<Col>1th</Col>
|
|
|
|
|
</Col>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
})}
|
|
|
|
|
{data && data.map((item, key) => {
|
|
|
|
|
if (key === 2) {
|
|
|
|
|
return (
|
|
|
|
|
<Col span={5} className={"Statisticscenter"}>
|
|
|
|
|
<Col>{item.user_name}</Col>
|
|
|
|
|
<Col>3th</Col>
|
|
|
|
|
</Col>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
})}
|
|
|
|
|
{data && data.map((item, key) => {
|
|
|
|
|
if (key === 4) {
|
|
|
|
|
return (
|
|
|
|
|
<Col span={3} className={"Statisticscenter"}>
|
|
|
|
|
<Col>{item.user_name}</Col>
|
|
|
|
|
<Col>5th</Col>
|
|
|
|
|
</Col>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
})}
|
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Row className="mt10" type="flex" justify="center" align="bottom">
|
|
|
|
|
|
|
|
|
|
{data&&data.map((item,key)=>{
|
|
|
|
|
if(key===3){
|
|
|
|
|
return(
|
|
|
|
|
<Col span={3} className={"Statisticscenter"}>
|
|
|
|
|
<Col>{item.user_name}</Col>
|
|
|
|
|
<Col>4th</Col>
|
|
|
|
|
</Col>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
})}
|
|
|
|
|
{data&&data.map((item,key)=>{
|
|
|
|
|
if(key===1){
|
|
|
|
|
return(
|
|
|
|
|
<Col span={5} className={"Statisticscenter"}>
|
|
|
|
|
<Col>{item.user_name}</Col>
|
|
|
|
|
<Col>2nd</Col>
|
|
|
|
|
</Col>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
})}
|
|
|
|
|
{data&&data.map((item,key)=>{
|
|
|
|
|
if(key===0){
|
|
|
|
|
return(
|
|
|
|
|
<Col span={5} className={"Statisticscenter"}>
|
|
|
|
|
<Col>{item.user_name}</Col>
|
|
|
|
|
<Col>1st</Col>
|
|
|
|
|
</Col>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
})}
|
|
|
|
|
{data&&data.map((item,key)=>{
|
|
|
|
|
if(key===2){
|
|
|
|
|
return(
|
|
|
|
|
<Col span={5} className={"Statisticscenter"}>
|
|
|
|
|
<Col>{item.user_name}</Col>
|
|
|
|
|
<Col>3rd</Col>
|
|
|
|
|
</Col>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
})}
|
|
|
|
|
{data&&data.map((item,key)=>{
|
|
|
|
|
if(key===4){
|
|
|
|
|
return(
|
|
|
|
|
<Col span={3} className={"Statisticscenter"}>
|
|
|
|
|
<Col>{item.user_name}</Col>
|
|
|
|
|
<Col>5th</Col>
|
|
|
|
|
</Col>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
})}
|
|
|
|
|
|
|
|
|
|
</Row>
|
|
|
|
|
</p>
|
|
|
|
|
</Row>
|
|
|
|
|
</p>
|
|
|
|
|
</Spin>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
@ -494,31 +490,30 @@ class Statistics extends Component{
|
|
|
|
|
}
|
|
|
|
|
.ant-table-thead > tr > th, .ant-table-tbody > tr > td {
|
|
|
|
|
padding: 16px 0px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
|
}</style>
|
|
|
|
|
<Tabs className="statisticsTabs" activeKey={this.state.activeKey} onChange={this.activeKey}
|
|
|
|
|
tabBarExtraContent={this.props.isAdmin() === true ? operations : ""}>
|
|
|
|
|
<TabPane tab="学习成绩" key="1" className={"statisticsTabs1"}>
|
|
|
|
|
<Table
|
|
|
|
|
columns={columns}
|
|
|
|
|
dataSource={bomdata}
|
|
|
|
|
pagination={false}
|
|
|
|
|
onChange={this.handleTableChange}
|
|
|
|
|
/>
|
|
|
|
|
</TabPane>
|
|
|
|
|
<TabPane tab="课堂活跃度" key="2">
|
|
|
|
|
<Dynamiclist
|
|
|
|
|
{...this.state}
|
|
|
|
|
{...this.props}
|
|
|
|
|
/>
|
|
|
|
|
</TabPane>
|
|
|
|
|
</Tabs>
|
|
|
|
|
<Tabs className="statisticsTabs" activeKey={this.state.activeKey} onChange={this.activeKey} tabBarExtraContent={this.props.isAdmin()===true?operations:""}>
|
|
|
|
|
<TabPane tab="学习成绩" key="1" className={"statisticsTabs1"} >
|
|
|
|
|
{bomdata===undefined||bomdata===null?"":bomdata.length===0?<NoneData/>:<Table
|
|
|
|
|
columns={columns}
|
|
|
|
|
dataSource={bomdata}
|
|
|
|
|
pagination={false}
|
|
|
|
|
onChange={this.handleTableChange}
|
|
|
|
|
/>}
|
|
|
|
|
</TabPane>
|
|
|
|
|
<TabPane tab="课堂活跃度" key="2">
|
|
|
|
|
{course_members===undefined||course_members===null?"":course_members.length===0?<NoneData/>:<Dynamiclist
|
|
|
|
|
{...this.state}
|
|
|
|
|
{...this.props}
|
|
|
|
|
/>}
|
|
|
|
|
</TabPane>
|
|
|
|
|
</Tabs>
|
|
|
|
|
</Spin>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{this.state.all_count === undefined || this.state.all_count === null || this.state.activeKey === "2" ? '' : this.state.all_count > 20 && this.props.isAdmin() === true ?
|
|
|
|
|
<div className="mb40 edu-txt-center padding20-30"
|
|
|
|
|
{this.state.all_count===undefined||this.state.all_count===null||this.state.activeKey==="2"?'':this.state.all_count >20&&this.props.isAdmin()===true?<div className="mb40 edu-txt-center padding20-30"
|
|
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
@ -526,12 +521,12 @@ class Statistics extends Component{
|
|
|
|
|
showQuickJumper
|
|
|
|
|
defaultCurrent={1}
|
|
|
|
|
pageSize={20}
|
|
|
|
|
total={this.state.all_count === undefined ? 0 : this.state.all_count === null ? 0 : this.state.all_count}
|
|
|
|
|
total={this.state.all_count===undefined?0:this.state.all_count===null?0:this.state.all_count}
|
|
|
|
|
current={this.state.page}
|
|
|
|
|
onChange={this.PaginationCourse}
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
</div> : ""}
|
|
|
|
|
</div>:""}
|
|
|
|
|
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
)
|
|
|
|
|