|
|
|
@ -19,9 +19,14 @@ class CompetitionContents extends Component{
|
|
|
|
|
window.document.title = '竞赛';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
const operations = <Button className={"fr"} type="primary" ghost onClick={()=>this.props.Competitionedit()}>编辑</Button>;
|
|
|
|
|
const operations =
|
|
|
|
|
<div>
|
|
|
|
|
<Button className={"fr"} type="primary" ghost onClick={()=>this.props.Competitionedit()}>编辑</Button>
|
|
|
|
|
<Button className={"fr mr20"} type="primary" ghost>
|
|
|
|
|
<a href={`/competitions/${this.props.match.params.identifier}/charts.xlsx`}>导出</a>
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
const columns = [
|
|
|
|
|
{
|
|
|
|
|
title: 'usersum',
|
|
|
|
@ -61,143 +66,163 @@ class CompetitionContents extends Component{
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const data = [
|
|
|
|
|
{
|
|
|
|
|
usersum: '1',
|
|
|
|
|
userimg: 'John Brown',
|
|
|
|
|
username: "小头鹰",
|
|
|
|
|
school: '吉首大学',
|
|
|
|
|
spendtime: '15:00:00',
|
|
|
|
|
score:123123
|
|
|
|
|
const data = [];
|
|
|
|
|
let {chart_rules,chartdata}=this.props;
|
|
|
|
|
chartdata===undefined?"":chartdata.teams.length===0?"":chartdata.teams.map((item,key)=>{
|
|
|
|
|
if(key>3){
|
|
|
|
|
let list={
|
|
|
|
|
usersum:key,
|
|
|
|
|
userimg:item.user_image,
|
|
|
|
|
username:item.record_user_name,
|
|
|
|
|
school:item.school_name,
|
|
|
|
|
spendtime:item.spend_time,
|
|
|
|
|
score:item.score,
|
|
|
|
|
user_login:item.user_login
|
|
|
|
|
}
|
|
|
|
|
data.push(list)
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
let {chart_rules,tabkey}=this.props;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log(this.props.chartdata&&this.props.chartdata.user_ranks)
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
{chart_rules===undefined?"":<Tabs onChange={(e)=>this.props.Competitioncallback(e)} activeKey={this.props.tabkey} tabBarExtraContent={this.props.current_user&&this.props.current_user.admin===true||this.props.current_user&&this.props.current_user.business===true?this.props.Competitionedittype===false?operations:"":""}>
|
|
|
|
|
|
|
|
|
|
{chart_rules.stages.map((item,key)=>{
|
|
|
|
|
return(
|
|
|
|
|
<TabPane tab={item.name} key={item.id===null?0:item.id}>
|
|
|
|
|
{chart_rules.rule_contents.map((items,keys)=>{
|
|
|
|
|
if(item.id===items.competition_stage_id){
|
|
|
|
|
return(
|
|
|
|
|
<Content key={keys} className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(items.content).replace(/▁/g, "▁▁▁")}}>
|
|
|
|
|
</Content>
|
|
|
|
|
<Content key={keys} className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(items.content).replace(/▁/g, "▁▁▁")}}></Content>
|
|
|
|
|
)
|
|
|
|
|
}else if(item.id===null&&items.competition_stage_id===0){
|
|
|
|
|
return(
|
|
|
|
|
<Content key={keys} className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(items.content).replace(/▁/g, "▁▁▁")}}>
|
|
|
|
|
</Content>
|
|
|
|
|
<Content key={keys} className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(items.content).replace(/▁/g, "▁▁▁")}}></Content>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
})}
|
|
|
|
|
</TabPane>
|
|
|
|
|
)
|
|
|
|
|
})}
|
|
|
|
|
|
|
|
|
|
</Tabs>}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Col className="gutter-row Competitioncharts mt30 mb30">
|
|
|
|
|
总排名
|
|
|
|
|
</Col>
|
|
|
|
|
<Col className="gutter-row Competitioncharts mt30 mb30">总排名</Col>
|
|
|
|
|
|
|
|
|
|
<Row calssName={"Competition399"}>
|
|
|
|
|
<Col className="mt40" xs={{ span: 5, offset: 1 }} lg={{ span: 6, offset: 2 }}>
|
|
|
|
|
<Card
|
|
|
|
|
className={"Competitionthird"}
|
|
|
|
|
cover={
|
|
|
|
|
<div className={"Competitionthirdbox center"}>
|
|
|
|
|
<li className="pr Competitioncenter">
|
|
|
|
|
<img src={getImageUrl("images/educoder/huangguan-two.png")}/>
|
|
|
|
|
<div className={"mt10"}>
|
|
|
|
|
<a href="/users/p45296381" className="color-dark">
|
|
|
|
|
<img className={"rankingimg"} src={getImageUrl("images/avatars/User/45459?t=1566570434")} />
|
|
|
|
|
<p className="task-hide rankName mt5 jinshaifont">蒙睿</p>
|
|
|
|
|
</a>
|
|
|
|
|
{chartdata===undefined?"":chartdata.teams.length===0?"":chartdata.teams.map((item,key)=>{
|
|
|
|
|
|
|
|
|
|
if(key===1){
|
|
|
|
|
return(
|
|
|
|
|
<Col xs={{ span: 11, offset: 1 }} lg={{ span: 6, offset: 1 }}>
|
|
|
|
|
<Card
|
|
|
|
|
className={"Competitionfirst"}
|
|
|
|
|
cover={
|
|
|
|
|
<div className={"Competitionfirstbox center"}>
|
|
|
|
|
<li className="pr Competitioncenter">
|
|
|
|
|
<img src={getImageUrl("images/educoder/huangguan.png")}/>
|
|
|
|
|
<div className={"mt10"}>
|
|
|
|
|
<a href={`/users/${item.user_login}`} className="color-dark">
|
|
|
|
|
<img className={"rankingimg"} src={getImageUrl(item.user_image)} />
|
|
|
|
|
<p className="task-hide rankName mt5 jinshaifont">{item.record_user_name}</p>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
</li>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
<Meta
|
|
|
|
|
title={<div className={"center"}>
|
|
|
|
|
<div className={"rankfonttop"}>{item.school_name}</div>
|
|
|
|
|
<div className={"rankfontmid"}>{item.spend_time}</div>
|
|
|
|
|
</div>}
|
|
|
|
|
description={
|
|
|
|
|
<div className={"rankfontbottoms"}>{item.score}分</div>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
</Card>
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(key===2){
|
|
|
|
|
return(
|
|
|
|
|
<Col className="mt30" xs={{ span: 5, offset: 1 }} lg={{ span: 6, offset: 1 }}>
|
|
|
|
|
<Card
|
|
|
|
|
className={"Competitionsecondary "}
|
|
|
|
|
cover={
|
|
|
|
|
<div className={"Competitionsecondarybox center"}>
|
|
|
|
|
<li className=" pr Competitioncenter ">
|
|
|
|
|
<img src={getImageUrl("images/educoder/huangguan-three.png")}/>
|
|
|
|
|
<div className={"mt10"}>
|
|
|
|
|
<a href={`/users/${item.user_login}`} className="color-dark">
|
|
|
|
|
<img className={"rankingimg"} src={getImageUrl(item.user_image)} />
|
|
|
|
|
<p className="task-hide rankName mt5 jinshaifont">{item.record_user_name}</p>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
</li>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
<Meta
|
|
|
|
|
title={<div className={"center"}>
|
|
|
|
|
<div className={"rankfonttop"}>{item.school_name}</div>
|
|
|
|
|
<div className={"rankfontmid"}>{item.spend_time}</div>
|
|
|
|
|
</div>}
|
|
|
|
|
description={
|
|
|
|
|
<div className={"rankfontbottom"}>{item.score}分</div>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
</Card>
|
|
|
|
|
</Col>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(key===3){
|
|
|
|
|
return(
|
|
|
|
|
<Col className="mt40" xs={{ span: 5, offset: 1 }} lg={{ span: 6, offset: 2 }}>
|
|
|
|
|
<Card
|
|
|
|
|
className={"Competitionthird"}
|
|
|
|
|
cover={
|
|
|
|
|
<div className={"Competitionthirdbox center"}>
|
|
|
|
|
<li className="pr Competitioncenter">
|
|
|
|
|
<img src={getImageUrl("images/educoder/huangguan-two.png")}/>
|
|
|
|
|
<div className={"mt10"}>
|
|
|
|
|
<a href={`/users/${item.user_login}`} className="color-dark">
|
|
|
|
|
<img className={"rankingimg"} src={getImageUrl(item.user_image)} />
|
|
|
|
|
<p className="task-hide rankName mt5 jinshaifont">{item.user_name}</p>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
</li>
|
|
|
|
|
</div>
|
|
|
|
|
</li>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
<Meta
|
|
|
|
|
title={<div className={"center"}>
|
|
|
|
|
<div className={"rankfonttop"}>吉首大学</div>
|
|
|
|
|
<div className={"rankfontmid"}>78:01:02</div>
|
|
|
|
|
</div>}
|
|
|
|
|
description={
|
|
|
|
|
<div className={"rankfontbottom"}>3423.45分</div>
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
</Card>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col xs={{ span: 11, offset: 1 }} lg={{ span: 6, offset: 1 }}>
|
|
|
|
|
<Card
|
|
|
|
|
className={"Competitionfirst"}
|
|
|
|
|
cover={
|
|
|
|
|
<div className={"Competitionfirstbox center"}>
|
|
|
|
|
<li className="pr Competitioncenter">
|
|
|
|
|
<img src={getImageUrl("images/educoder/huangguan.png")}/>
|
|
|
|
|
<div className={"mt10"}>
|
|
|
|
|
<a href="/users/p37219480" className="color-dark">
|
|
|
|
|
<img className={"rankingimg"} src={getImageUrl("images/avatars/User/46128?t=1561087919")} />
|
|
|
|
|
<p className="task-hide rankName mt5 jinshaifont">李羿锟</p>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
</li>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
<Meta
|
|
|
|
|
title={<div className={"center"}>
|
|
|
|
|
<div className={"rankfonttop"}>吉首大学</div>
|
|
|
|
|
<div className={"rankfontmid"}>78:01:02</div>
|
|
|
|
|
</div>}
|
|
|
|
|
description={
|
|
|
|
|
<div className={"rankfontbottoms"}>3423.45分</div>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
</Card>
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
<Col className="mt30" xs={{ span: 5, offset: 1 }} lg={{ span: 6, offset: 1 }}>
|
|
|
|
|
<Card
|
|
|
|
|
className={"Competitionsecondary "}
|
|
|
|
|
cover={
|
|
|
|
|
<div className={"Competitionsecondarybox center"}>
|
|
|
|
|
<li className=" pr Competitioncenter ">
|
|
|
|
|
<img src={getImageUrl("images/educoder/huangguan-three.png")}/>
|
|
|
|
|
<div className={"mt10"}>
|
|
|
|
|
<a href="/users/p53601847" className="color-dark">
|
|
|
|
|
<img className={"rankingimg"} src={getImageUrl("images/avatars/User/26650?t=1561087884")} />
|
|
|
|
|
<p className="task-hide rankName mt5 jinshaifont">陈翊</p>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
</li>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
<Meta
|
|
|
|
|
title={<div className={"center"}>
|
|
|
|
|
<div className={"rankfonttop"}>吉首大学</div>
|
|
|
|
|
<div className={"rankfontmid"}>78:01:02</div>
|
|
|
|
|
</div>}
|
|
|
|
|
description={
|
|
|
|
|
<div className={"rankfontbottom"}>3423.45分</div>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
</Card>
|
|
|
|
|
</Col>
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
<Meta
|
|
|
|
|
title={<div className={"center"}>
|
|
|
|
|
<div className={"rankfonttop"}>{item.school_name}</div>
|
|
|
|
|
<div className={"rankfontmid"}>{item.spend_time}</div>
|
|
|
|
|
</div>}
|
|
|
|
|
description={
|
|
|
|
|
<div className={"rankfontbottom"}>{item.score}分</div>
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
</Card>
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})}
|
|
|
|
|
|
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
|
|
<Row className={"mt80 mb80"}>
|
|
|
|
|
<Table className="Competitiontransparent" columns={columns} dataSource={data} showHeader={false} pagination={false}/>
|
|
|
|
|
{chartdata===undefined?"":chartdata.teams.length===0?"":<Table className="Competitiontransparent" columns={columns} dataSource={data} showHeader={false} pagination={false}/>}
|
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|