调整竞赛权限

dev_local_cqdsj
杨树明 6 years ago
parent 921f6be755
commit 1e1cc79daa

@ -268,7 +268,7 @@ class CompetitionCommon extends Component{
<Row className={"CompetitionCommonbanner"}> <Row className={"CompetitionCommonbanner"}>
{data.competition_status==="nearly_published"? {data.competition_status==="nearly_published"?
this.props.current_user&&this.props.current_user.admin===true?"":this.props.current_user&&this.props.current_user.business===true?"":<div className={"CompetitionsListzhezhao"}>即将发布 敬请期待</div>:""} data&&data.permission.editable===true?"":<div className={"CompetitionsListzhezhao"}>即将发布 敬请期待</div>:""}
<img className={"Commonimg"} <img className={"Commonimg"}
src={data.competition_status==="ended"?getImageUrl(`images/educoder/competitions/groups1.png`):data.competition_status==="nearly_published"?getImageUrl(`images/educoder/competitions/groups2.png`):data.competition_status==="progressing"?getImageUrl(`images/educoder/competitions/groups3.png`):""} /> src={data.competition_status==="ended"?getImageUrl(`images/educoder/competitions/groups1.png`):data.competition_status==="nearly_published"?getImageUrl(`images/educoder/competitions/groups2.png`):data.competition_status==="progressing"?getImageUrl(`images/educoder/competitions/groups3.png`):""} />
<Col span={15} className={"Commonimgbox"}> <Col span={15} className={"Commonimgbox"}>
@ -334,7 +334,7 @@ class CompetitionCommon extends Component{
<Button type="primary" block className={"Competitionfontsize22"} disabled={true}> <Button type="primary" block className={"Competitionfontsize22"} disabled={true}>
已结束 已结束
</Button>:data.enroll_end===true?<Button type="primary" block className={"Competitionfontsize22"} disabled={true}> </Button>:data.enroll_end===true?<Button type="primary" block className={"Competitionfontsize22"} disabled={true}>
报名截止 {data.competition_status==="nearly_published"?"未发布":"报名截止"}
</Button>: </Button>:
data.competition_status==="progressing"?<Button type="primary" block className={"Competitionfontsize22"}> data.competition_status==="progressing"?<Button type="primary" block className={"Competitionfontsize22"}>
{data.mode===2?<a onClick={()=>this.gotocourse()}>立即报名</a>:<a onClick={()=>this.gotocourse(`/competitions/${this.props.match.params.identifier}/enroll`)}></a>} {data.mode===2?<a onClick={()=>this.gotocourse()}>立即报名</a>:<a onClick={()=>this.gotocourse(`/competitions/${this.props.match.params.identifier}/enroll`)}></a>}

@ -19,13 +19,13 @@ class CompetitionContents extends Component{
} }
render() { render() {
let{mdContentdata}=this.props; let{mdContentdata,data}=this.props;
//mdhash滚动 //mdhash滚动
this.props.MdifHasAnchorJustScorll(); this.props.MdifHasAnchorJustScorll();
return ( return (
<div className={"fr"}> <div className={"fr"}>
{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?<Button className={"fr"} type="primary" ghost onClick={()=>this.props.Competitionedit()}> {data&&data.permission.editable===true?this.props.Competitionedittype===false?this.props.has_url===false?<Button className={"fr"} type="primary" ghost onClick={()=>this.props.Competitionedit()}>
编辑 编辑
</Button>:"":"":""} </Button>:"":"":""}
<div className={this.props.current_user&&this.props.current_user.admin===true||this.props.current_user&&this.props.current_user.business===true?"mt50 mb100 ":"mb100 "}> <div className={this.props.current_user&&this.props.current_user.admin===true||this.props.current_user&&this.props.current_user.business===true?"mt50 mb100 ":"mb100 "}>

@ -115,8 +115,8 @@ class CompetitionContents extends Component{
}, },
]; ];
const data = []; const datas = [];
let {chart_rules,chartdata}=this.props; let {chart_rules,chartdata,data}=this.props;
let {personal}=this.state; let {personal}=this.state;
chartdata===undefined?"":chartdata.teams.length===0||chartdata.teams.length<3?"":chartdata.teams.map((item,key)=>{ chartdata===undefined?"":chartdata.teams.length===0||chartdata.teams.length<3?"":chartdata.teams.map((item,key)=>{
@ -130,7 +130,7 @@ class CompetitionContents extends Component{
score:item.score, score:item.score,
user_login:item.user_login user_login:item.user_login
} }
data.push(list) datas.push(list)
} }
}) })
@ -139,7 +139,7 @@ class CompetitionContents extends Component{
//console.log(chartdata&&chartdata.teams) //console.log(chartdata&&chartdata.teams)
return ( return (
<div> <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?this.props.has_url===false?operations:"":"":""}> {chart_rules===undefined?"":<Tabs onChange={(e)=>this.props.Competitioncallback(e)} activeKey={this.props.tabkey} tabBarExtraContent={data&&data.permission.editable===true?this.props.Competitionedittype===false?this.props.has_url===false?operations:"":"":""}>
{chart_rules.stages.map((item,key)=>{ {chart_rules.stages.map((item,key)=>{
return( return(
<TabPane tab={item.name} key={item.id===null?0:item.id}> <TabPane tab={item.name} key={item.id===null?0:item.id}>
@ -343,7 +343,7 @@ class CompetitionContents extends Component{
` `
} }
</style> </style>
{chartdata===undefined?"":chartdata.teams.length===0||chartdata.teams.length<4?"":<Table className="Competitiontransparent" columns={columns} dataSource={data} showHeader={false} pagination={false}/>} {chartdata===undefined?"":chartdata.teams.length===0||chartdata.teams.length<4?"":<Table className="Competitiontransparent" columns={columns} dataSource={datas} showHeader={false} pagination={false}/>}
</Row> </Row>

Loading…
Cancel
Save