@@ -123,10 +124,10 @@ class CompetitionsIndex extends Component{
size="large"
dataSource={datas&&datas}
renderItem={(item,key) => (
-
this.setcompetitonurl(item.competition_status==="ended"?`/newcompetitions/${item.identifier}/common_header`:item.competition_status==="nearly_published"? this.props.current_user&&this.props.current_user.business===true?`/newcompetitions/${item.identifier}/common_header`:this.props.current_user&&this.props.current_user.admin===true?`/newcompetitions/${item.identifier}/common_header`:null:item.competition_status==="progressing"?`/newcompetitions/${item.identifier}/common_header`:null)}>
+ >
{item.competition_status==="nearly_published"?
@@ -180,18 +181,18 @@ class CompetitionsIndex extends Component{
- this.setcompetitonurl(item.competition_status==="ended"?`/newcompetitions/${item.identifier}/common_header`:item.competition_status==="nearly_published"? this.props.current_user&&this.props.current_user.business===true?`/newcompetitions/${item.identifier}/common_header`:this.props.current_user&&this.props.current_user.admin===true?`/newcompetitions/${item.identifier}/common_header`:null:item.competition_status==="progressing"?`/newcompetitions/${item.identifier}/common_header`:null)}
- >{item.name}{item.sub_title===null?"":`——${item.sub_title}`}
+ {item.name}{item.sub_title===null?"":`——${item.sub_title}`}
{/*{item.sub_title===null?"":*/}
{/*{item.sub_title}}*/}
{/**/}
}
/>
- {item.description}
+ {item.description}
-
+
)
diff --git a/public/react/src/modules/competitions/Competitimain/Competitionsindex.css b/public/react/src/modules/competitions/Competitimain/Competitionsindex.css
index dda7fcf40..aa2c347f3 100644
--- a/public/react/src/modules/competitions/Competitimain/Competitionsindex.css
+++ b/public/react/src/modules/competitions/Competitimain/Competitionsindex.css
@@ -102,6 +102,7 @@
white-space: nowrap;
display: inline-block;
margin-right: 15px;
+ color:#000 !important;
}
.competitionsrelative{
@@ -130,13 +131,14 @@
text-align: center;
color: #fff;
font-size: 22px;
- display: flex;
+
align-items: center;
justify-content: space-around;
flex-direction: column;
}
.CompetitionsList:hover .CompetitionsListzhezhao{
display: block;
+ display: flex;
}
.competitionstitlesshou:hover a{
cursor: pointer;
@@ -154,4 +156,8 @@
background-position: center !important;
background-position: 50% !important;
background-repeat: no-repeat !important;
+}
+
+.span666{
+ color:#666666 !important;
}
\ No newline at end of file
diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.css b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.css
index 22810c4b5..264642b7d 100644
--- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.css
+++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.css
@@ -56,7 +56,7 @@
}
.teamsLayoucolor-orange {
- color: #ff6800!important;
+ color: #ff6800 !important;
font-size: 16px;
}
@@ -69,7 +69,7 @@
.CompetitionCommonbannerfont{
height:100%;
- width: 365px;
+ width: 365px !important;
line-height: 34px;
}
@@ -333,16 +333,19 @@
text-align: center;
color: #fff;
font-size: 22px;
+
+}
+
+.relative{position: relative;}
+
+.relative:hover .CompetitionsListzhezhao{
+ display: block;
display: flex;
align-items: center;
justify-content: space-around;
flex-direction: column;
}
-.relative{position: relative;}
-
-.relative:hover .CompetitionsListzhezhao{ display: block;}
-
.image_urlbox{
width: 705px;
/*height: 400px;*/
@@ -379,4 +382,19 @@
.ranknameslast{
font-size:16px;
color:rgba(12,158,254,1);
+}
+
+.textleft{
+ text-align: left;
+}
+
+.textright{
+ text-align: right;
+}
+
+.userranksclass{
+ text-align: left;
+ width: 18%;
+ padding-left: 12px;
+ margin-right: 28px;
}
\ No newline at end of file
diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js
index 9c80366f3..e82cb52d7 100644
--- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js
+++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js
@@ -22,7 +22,8 @@ class CompetitionCommon extends Component{
mdContentdata:undefined,
chart_rules:undefined,
Competitionedittype:false,
- chartdata:undefined
+ chartdata:undefined,
+ has_url:false
}
}
@@ -148,16 +149,19 @@ class CompetitionCommon extends Component{
})
}else{
if(module_url.substring(0,7)=='http://'||module_url.substring(0,8)=='https://') {
- window.location.href= module_url
+ // window.location.href= module_url
+ window.open(module_url)
}else{
- window.location.href="https://"+module_url;
+ window.open(`https://${module_url}`)
+ // window.location.href=;
}
return
}
this.setState({
module_id:id,
- module_type:typeid
+ module_type:typeid,
+ has_url:has_url
})
}
@@ -214,10 +218,23 @@ class CompetitionCommon extends Component{
this.setState({
tabkey:key
})
+ let url=`/competitions/${this.props.match.params.identifier}/charts.json`;
+ axios.get(url,{params:{
+ stage_id:key===0||key===null?undefined:key
+ }}).then((response) => {
+ if(response.status===200){
+ this.setState({
+ chartdata:response.data
+ })
+ }
+ }).catch((error) => {
+ console.log(error)
+ })
+
}
render() {
- let {data,bannerdata,module_type,Competitionedittype,mdContentdata}=this.state;
+ let {data,has_url,module_type,Competitionedittype,mdContentdata}=this.state;
return (
data===undefined?"":
diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionContents.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionContents.js
index a49384f71..ca99fde8e 100644
--- a/public/react/src/modules/competitions/Competitioncommon/CompetitionContents.js
+++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionContents.js
@@ -26,9 +26,9 @@ class CompetitionContents extends Component{
return (
- {this.props.current_user&&this.props.current_user.admin===true||this.props.current_user&&this.props.current_user.business===true?this.props.Competitionedittype===false?
:"":"":""}
diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionContentsChart.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionContentsChart.js
index 8432613e3..f287b66a5 100644
--- a/public/react/src/modules/competitions/Competitioncommon/CompetitionContentsChart.js
+++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionContentsChart.js
@@ -1,6 +1,7 @@
import React, { Component } from 'react';
import {Button,Layout,Tabs,Icon, Card, Avatar, Row, Col ,Table} from 'antd';
import {markdownToHTML,getImageUrl} from 'educoder';
+import axios from 'axios';
import NoneData from "../../courses/shixunHomework/shixunHomework";
const { Content } = Layout;
@@ -11,20 +12,63 @@ class CompetitionContents extends Component{
constructor(props) {
super(props)
this.state={
-
+ personal:undefined
}
}
componentDidMount(){
window.document.title = '竞赛';
+ let url=`/competitions/${this.props.match.params.identifier}/competition_staff.json`;
+ axios.get(url)
+ .then((response) => {
+ if(response.status===200){
+ console.log(response)
+ this.setState({
+ personal:response.data.personal
+ })
+ }
+ }).catch((error) => {
+ console.log(error)
+ })
}
+ derivefun=(url)=>{
+ axios.get(url).then((response)=>{
+ if(response === undefined){
+ return
+ }
+ if(response.data.status&&response.data.status===-1){
+ this.props.showNotification(response.data.message);
+ }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
+ // })
+ // }
+ this.props.showNotification(response.data.message);
+ }else {
+ // this.props.showNotification(`正在下载中`);
+ // window.open("/api"+url, '_blank');
+ this.props.slowDownload(url);
+ }
+ }).catch((error) => {
+ console.log(error)
+ });
+ }
render() {
- const operations =
-
+ const operations =
const columns = [
@@ -71,13 +115,14 @@ class CompetitionContents extends Component{
const data = [];
let {chart_rules,chartdata}=this.props;
+ let {personal}=this.state;
chartdata===undefined?"":chartdata.teams.length===0||chartdata.teams.length<3?"":chartdata.teams.map((item,key)=>{
if(key>2){
let list={
usersum:key+1,
userimg:item.user_image,
- username:item.record_user_name,
+ username:personal===undefined||personal===null?item.record_user_name:personal===true?item.record_user_name:item.team_name,
school:item.school_name,
spendtime:item.spend_time,
score:item.score,
@@ -89,10 +134,10 @@ class CompetitionContents extends Component{
//
- // console.log(this.props.chartdata&&this.props.chartdata.user_ranks)
+ //console.log(chartdata&&chartdata.teams)
return (
- {chart_rules===undefined?"":
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===undefined?"":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?this.props.has_url===false?operations:"":"":""}>
{chart_rules.stages.map((item,key)=>{
return(
@@ -122,7 +167,7 @@ class CompetitionContents extends Component{
{chartdata===undefined?"":chartdata.teams.length===0?"":chartdata.teams.map((item,key)=>{
- if(key===3){
+ if(key===2){
return(
- {item.user_name}
+ {personal===undefined||personal===null?item.record_user_name:personal===true?item.record_user_name:item.team_name}
@@ -158,7 +203,7 @@ class CompetitionContents extends Component{
})}
{chartdata===undefined?"":chartdata.teams.length===0?"":chartdata.teams.map((item,key)=>{
- if(key===1){
+ if(key===0){
return(
- {item.record_user_name}
+ {personal===undefined||personal===null?item.record_user_name:personal===true?item.record_user_name:item.team_name}
@@ -194,7 +239,7 @@ class CompetitionContents extends Component{
}
})}
{chartdata===undefined?"":chartdata.teams.length===0?"":chartdata.teams.map((item,key)=>{
- if(key===2){
+ if(key===1){
return(
- {item.record_user_name}
+ {personal===undefined||personal===null?item.record_user_name:personal===true?item.record_user_name:item.team_name}
@@ -237,9 +282,9 @@ class CompetitionContents extends Component{