|
|
@ -1,6 +1,6 @@
|
|
|
|
import React,{ Component } from "react";
|
|
|
|
import React,{ Component } from "react";
|
|
|
|
import {Table, Pagination,Tooltip,Spin, Row, Col ,Tabs} from "antd";
|
|
|
|
import {Table, Pagination,Tooltip,Spin, Row, Col ,Tabs} from "antd";
|
|
|
|
import { WordsBtn,on, off, trigger } from 'educoder';
|
|
|
|
import { WordsBtn,on, off, trigger ,getImageUrl} from 'educoder';
|
|
|
|
import {BrowserRouter as Router,Route,Switch,Link} from 'react-router-dom';
|
|
|
|
import {BrowserRouter as Router,Route,Switch,Link} from 'react-router-dom';
|
|
|
|
import axios from'axios';
|
|
|
|
import axios from'axios';
|
|
|
|
import './Statistics.css';
|
|
|
|
import './Statistics.css';
|
|
|
@ -11,14 +11,28 @@ class Statistics extends Component{
|
|
|
|
this.state={
|
|
|
|
this.state={
|
|
|
|
nd1:60,
|
|
|
|
nd1:60,
|
|
|
|
nd2:40,
|
|
|
|
nd2:40,
|
|
|
|
nd3:20
|
|
|
|
nd3:20,
|
|
|
|
|
|
|
|
data:undefined
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
componentDidMount() {
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
isSpin:true,
|
|
|
|
isSpin:true,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
|
|
|
console.log(error);
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
isSpins:false,
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -28,7 +42,7 @@ class Statistics extends Component{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
render(){
|
|
|
|
render(){
|
|
|
|
let {nd1,nd2,nd3}=this.state;
|
|
|
|
let {nd1,nd2,nd3,data}=this.state;
|
|
|
|
|
|
|
|
|
|
|
|
return(
|
|
|
|
return(
|
|
|
|
<React.Fragment >
|
|
|
|
<React.Fragment >
|
|
|
@ -42,80 +56,148 @@ class Statistics extends Component{
|
|
|
|
</Row>
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
|
|
|
|
<Row type="flex" justify="center" align="bottom">
|
|
|
|
<Row type="flex" justify="center" align="bottom">
|
|
|
|
<Col span={3}>
|
|
|
|
{data&&data.map((item,key)=>{
|
|
|
|
<li className="pr rankingss">
|
|
|
|
if(key===3){
|
|
|
|
<a href="https://test-newweb.educoder.net/users/cao_jl" className="color-dark">
|
|
|
|
return(
|
|
|
|
<img src="https://test-newweb.educoder.net/images/avatars/User/g"/>
|
|
|
|
<Col span={3}>
|
|
|
|
</a>
|
|
|
|
<li className="pr rankingss">
|
|
|
|
</li>
|
|
|
|
<a href={`/users/${item.user_login}`} className="color-dark">
|
|
|
|
</Col>
|
|
|
|
<img src={getImageUrl(`images/${item.avatar_url}`)}/>
|
|
|
|
|
|
|
|
</a>
|
|
|
|
<Col span={5}>
|
|
|
|
</li>
|
|
|
|
<li className="pr rankingss">
|
|
|
|
</Col>
|
|
|
|
<a href="https://test-newweb.educoder.net/users/cao_jl" className="color-dark">
|
|
|
|
)
|
|
|
|
<img src="https://test-newweb.educoder.net/images/avatars/User/g" className={"mb10"}/>
|
|
|
|
}
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
})}
|
|
|
|
<Col className={`height-${nd2}`}>
|
|
|
|
{data&&data.map((item,key)=>{
|
|
|
|
|
|
|
|
if(key===1){
|
|
|
|
</Col>
|
|
|
|
return(
|
|
|
|
</Col>
|
|
|
|
<Col span={5}>
|
|
|
|
|
|
|
|
<li className="pr rankingss">
|
|
|
|
<Col span={5} className={"relatives"}>
|
|
|
|
<a href={`/users/${item.user_login}`} className="color-dark">
|
|
|
|
<li className="pr rankingss">
|
|
|
|
<img src={getImageUrl(`images/${item.avatar_url}`)} className={"mb10"}/>
|
|
|
|
<img src="https://test-newweb.educoder.net/images/educoder/huangguan.png" className="huangguans mb5" />
|
|
|
|
</a>
|
|
|
|
<a href="https://test-newweb.educoder.net/users/cao_jl" className="color-dark">
|
|
|
|
</li>
|
|
|
|
<img src="https://test-newweb.educoder.net/images/avatars/User/g" className={"mb10"}/>
|
|
|
|
<Col className={`height-${nd2}`}>
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
</Col>
|
|
|
|
<Col className={`height-${nd1}`}>
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
)
|
|
|
|
</Col>
|
|
|
|
}
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
|
|
|
|
})}
|
|
|
|
<Col span={5}>
|
|
|
|
|
|
|
|
<li className="pr rankingss">
|
|
|
|
{data&&data.map((item,key)=>{
|
|
|
|
<a href="https://test-newweb.educoder.net/users/cao_jl" className="color-dark">
|
|
|
|
if(key===0){
|
|
|
|
<img src="https://test-newweb.educoder.net/images/avatars/User/g" className={"mb10"}/>
|
|
|
|
return(
|
|
|
|
</a>
|
|
|
|
<Col span={5} className={"relatives"}>
|
|
|
|
</li>
|
|
|
|
<li className="pr rankingss">
|
|
|
|
<Col className={`height-${nd3}`}>
|
|
|
|
<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}`}>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{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>
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Col span={3}>
|
|
|
|
|
|
|
|
<li className="pr rankingss">
|
|
|
|
|
|
|
|
<a href="https://test-newweb.educoder.net/users/cao_jl" className="color-dark">
|
|
|
|
|
|
|
|
<img src="https://test-newweb.educoder.net/images/avatars/User/g"/>
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Row>
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Row className="mt10" type="flex" justify="center" align="bottom">
|
|
|
|
<Row className="mt10" type="flex" justify="center" align="bottom">
|
|
|
|
<Col span={3} className={"Statisticscenter"}>
|
|
|
|
|
|
|
|
<Col>威震江湖</Col>
|
|
|
|
{data&&data.map((item,key)=>{
|
|
|
|
<Col>4th</Col>
|
|
|
|
if(key===3){
|
|
|
|
</Col>
|
|
|
|
return(
|
|
|
|
<Col span={5} className={"Statisticscenter"}>
|
|
|
|
<Col span={3} className={"Statisticscenter"}>
|
|
|
|
<Col>神魔遮天</Col>
|
|
|
|
<Col>{item.user_name}</Col>
|
|
|
|
<Col>2th</Col>
|
|
|
|
<Col>4th</Col>
|
|
|
|
</Col>
|
|
|
|
</Col>
|
|
|
|
<Col span={5} className={"Statisticscenter"}>
|
|
|
|
)
|
|
|
|
<Col>雄霸天下</Col>
|
|
|
|
}
|
|
|
|
<Col>1th</Col>
|
|
|
|
})}
|
|
|
|
</Col>
|
|
|
|
{data&&data.map((item,key)=>{
|
|
|
|
<Col span={5} className={"Statisticscenter"}>
|
|
|
|
if(key===1){
|
|
|
|
<Col>不灭战神</Col>
|
|
|
|
return(
|
|
|
|
<Col>3th</Col>
|
|
|
|
<Col span={5} className={"Statisticscenter"}>
|
|
|
|
</Col>
|
|
|
|
<Col>{item.user_name}</Col>
|
|
|
|
<Col span={3} className={"Statisticscenter"}>
|
|
|
|
<Col>2th</Col>
|
|
|
|
<Col>霸气初现</Col>
|
|
|
|
</Col>
|
|
|
|
<Col>5th</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>
|
|
|
|
</p>
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|