|
|
|
@ -2,6 +2,8 @@ import React, { Component } from 'react';
|
|
|
|
|
|
|
|
|
|
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
|
|
|
|
|
|
|
|
|
|
import { Row, Col ,Menu} from 'antd';
|
|
|
|
|
|
|
|
|
|
import Loading from '../../Loading';
|
|
|
|
|
|
|
|
|
|
import Loadable from 'react-loadable';
|
|
|
|
@ -22,18 +24,16 @@ import TPMRepositoryCommits from './shixunchild/Repository/TPMRepositoryCommits'
|
|
|
|
|
|
|
|
|
|
import TPMsettings from './TPMsettings/TPMsettings';
|
|
|
|
|
|
|
|
|
|
//import TPMsettings from './TPMsettings/oldTPMsettings';
|
|
|
|
|
|
|
|
|
|
import TPMChallengeComponent from './TPMChallengeContainer';
|
|
|
|
|
import TPMPropaedeuticsComponent from './TPMPropaedeuticsComponent';
|
|
|
|
|
import TPMRanking_listComponent from './TPMRanking_listContainer';
|
|
|
|
|
import TPMCollaboratorsComponent from './TPMCollaboratorsContainer';
|
|
|
|
|
import Audit_situationComponent from './Audit_situationComponent';
|
|
|
|
|
import TPMDataset from './TPMDataset';
|
|
|
|
|
import '../page/tpiPage.css'
|
|
|
|
|
import TPMNav from "./component/TPMNav";
|
|
|
|
|
import TPMNav from './component/TPMNav';
|
|
|
|
|
|
|
|
|
|
import '../page/tpiPage.css';
|
|
|
|
|
|
|
|
|
|
const $ = window.$
|
|
|
|
|
//任务
|
|
|
|
|
// const TPMChallengeComponent = Loadable({
|
|
|
|
|
// loader: () => import('./TPMChallengeContainer'),
|
|
|
|
@ -147,6 +147,7 @@ class TPMIndex extends Component {
|
|
|
|
|
PropaedeuticsList: undefined,
|
|
|
|
|
tpmindexjupyterbool:false,
|
|
|
|
|
is_jupyter:false,
|
|
|
|
|
selectedKeys:""
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -248,38 +249,97 @@ class TPMIndex extends Component {
|
|
|
|
|
// Do something with response error
|
|
|
|
|
return Promise.reject(error);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//右侧数据
|
|
|
|
|
let shixunsDetailsURL=`/shixuns/`+id+`/show_right.json`;
|
|
|
|
|
axios.get(shixunsDetailsURL).then((response)=> {
|
|
|
|
|
this.setState({
|
|
|
|
|
TPMRightSectionData: response.data
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
//右侧数据
|
|
|
|
|
let shixunsDetailsURL=`/shixuns/`+id+`/show_right.json`;
|
|
|
|
|
axios.get(shixunsDetailsURL).then((response)=> {
|
|
|
|
|
this.setState({
|
|
|
|
|
TPMRightSectionData: response.data
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
this.getnavdatas()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentWillUnmount = () => {
|
|
|
|
|
axios.interceptors.request.eject(this.tpmContentRequestInterceptor);
|
|
|
|
|
this.tpmContentRequestInterceptor = null;
|
|
|
|
|
axios.interceptors.request.eject(this.tpmContentResponseInterceptor);
|
|
|
|
|
this.tpmContentResponseInterceptor = null;
|
|
|
|
|
// this.getnavdatas()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// componentDidUpdate=()=>{
|
|
|
|
|
// this.getnavdatas()
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
setLoadingContent = (isLoadingContent) => {
|
|
|
|
|
this.setState({ loadingContent: isLoadingContent })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TpmTPMBannertype(type){
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
getnavdatas=()=>{
|
|
|
|
|
let selectedKeys;
|
|
|
|
|
const {location} = this.props;
|
|
|
|
|
|
|
|
|
|
console.log(location.pathname)
|
|
|
|
|
|
|
|
|
|
if(location.pathname.indexOf('/challenges')!=-1){
|
|
|
|
|
selectedKeys="1"
|
|
|
|
|
}else if(location.pathname.indexOf('/propaedeutics')!=-1){
|
|
|
|
|
selectedKeys="2"
|
|
|
|
|
}else if(location.pathname.indexOf('/repository')!=-1){
|
|
|
|
|
selectedKeys="3"
|
|
|
|
|
}else if(location.pathname.indexOf('/secret_repository')!=-1){
|
|
|
|
|
selectedKeys="4"
|
|
|
|
|
} else if(location.pathname.indexOf('/collaborators')!=-1){
|
|
|
|
|
selectedKeys="5"
|
|
|
|
|
}else if(location.pathname.indexOf('/dataset')!=-1){
|
|
|
|
|
selectedKeys="6"
|
|
|
|
|
}else if(location.pathname.indexOf('/shixun_discuss')!=-1){
|
|
|
|
|
selectedKeys="7"
|
|
|
|
|
}else if(location.pathname.indexOf('/ranking_list')!=-1){
|
|
|
|
|
selectedKeys="8"
|
|
|
|
|
}else if(location.pathname.indexOf('/settings')!=-1){
|
|
|
|
|
selectedKeys="9"
|
|
|
|
|
}
|
|
|
|
|
console.log("进入")
|
|
|
|
|
console.log(selectedKeys)
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
selectedKeys:selectedKeys
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handleClick=(e)=>{
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
selectedKeys: e.key,
|
|
|
|
|
});
|
|
|
|
|
let id = this.props.match.params.shixunId;
|
|
|
|
|
if(e.key==="1"){
|
|
|
|
|
this.props.history.replace(`/shixuns/${id}/challenges`);
|
|
|
|
|
}else if(e.key==="2"){
|
|
|
|
|
this.props.history.replace(`/shixuns/${id}/propaedeutics`);
|
|
|
|
|
}else if(e.key==="3"){
|
|
|
|
|
this.props.history.replace(`/shixuns/${id}/repository`);
|
|
|
|
|
}else if(e.key==="4"){
|
|
|
|
|
this.props.history.replace(`/shixuns/${id}/secret_repository`);
|
|
|
|
|
}else if(e.key==="5"){
|
|
|
|
|
this.props.history.replace(`/shixuns/${id}/collaborators`);
|
|
|
|
|
}else if(e.key==="6"){
|
|
|
|
|
this.props.history.replace(`/shixuns/${id}/dataset`);
|
|
|
|
|
}else if(e.key==="7"){
|
|
|
|
|
this.props.history.replace(`/shixuns/${id}/shixun_discuss`);
|
|
|
|
|
}else if(e.key==="8"){
|
|
|
|
|
this.props.history.replace(`/shixuns/${id}/ranking_list`);
|
|
|
|
|
}else if(e.key==="9"){
|
|
|
|
|
this.props.history.replace(`/shixuns/${id}/settings`);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
render() {
|
|
|
|
|
|
|
|
|
|
let url = window.location.href;
|
|
|
|
|
let flag = url.indexOf("add_file")>-1;
|
|
|
|
|
// console.log(this.state.is_jupyter);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="newMain clearfix">
|
|
|
|
|
{/*头部*/}
|
|
|
|
@ -291,6 +351,77 @@ class TPMIndex extends Component {
|
|
|
|
|
is_jupyter={this.state. is_jupyter}
|
|
|
|
|
></TPMBanner>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
{
|
|
|
|
|
`
|
|
|
|
|
.ant-menu-item{
|
|
|
|
|
margin:0 40px 0 0;
|
|
|
|
|
padding:0px;
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<Row type="flex" className={"backgroudwhite"}>
|
|
|
|
|
<Col span={5}></Col>
|
|
|
|
|
|
|
|
|
|
<Col span={14}>
|
|
|
|
|
|
|
|
|
|
<Menu onClick={this.handleClick} selectedKeys={[this.state.selectedKeys]} mode="horizontal">
|
|
|
|
|
|
|
|
|
|
<Menu.Item key="1" className={"competitionmr50"}>
|
|
|
|
|
<span className={"tpmbannernavstyler"}>任务</span>
|
|
|
|
|
</Menu.Item>
|
|
|
|
|
|
|
|
|
|
{ this.state.propaedeutics===undefined?"":this.state.propaedeutics===false?"":<Menu.Item key="2" className={"competitionmr50"}>
|
|
|
|
|
<span className={"tpmbannernavstyler"}>背景知识</span>
|
|
|
|
|
</Menu.Item>}
|
|
|
|
|
|
|
|
|
|
{ this.state.identity >4||this.state.identity===undefined ?"":
|
|
|
|
|
this.state.is_jupyter===false?<Menu.Item key="3" className={"competitionmr50"}>
|
|
|
|
|
<span className={"tpmbannernavstyler"}>版本库</span>
|
|
|
|
|
</Menu.Item>:""}
|
|
|
|
|
|
|
|
|
|
{this.state.identity >4||this.state.identity===undefined ?"": this.state.secret_repository && <Menu.Item key="4" className={"competitionmr50"}>
|
|
|
|
|
<span className={"tpmbannernavstyler"}>私密版本库</span>
|
|
|
|
|
</Menu.Item>}
|
|
|
|
|
|
|
|
|
|
<Menu.Item key="5" className={"competitionmr50"}>
|
|
|
|
|
<span className={"tpmbannernavstyler"}>合作者</span>
|
|
|
|
|
</Menu.Item>
|
|
|
|
|
|
|
|
|
|
{ this.state.is_jupyter===true?<Menu.Item key="6" className={"competitionmr50"}>
|
|
|
|
|
<span className={"tpmbannernavstyler"}>数据集</span>
|
|
|
|
|
</Menu.Item>:""}
|
|
|
|
|
|
|
|
|
|
{ this.state.is_jupyter===false?<Menu.Item key="7" className={"competitionmr50"}>
|
|
|
|
|
<span className={"tpmbannernavstyler"}>评论</span>
|
|
|
|
|
</Menu.Item>:""}
|
|
|
|
|
|
|
|
|
|
{ this.state.is_jupyter===false? <Menu.Item key="8" className={"competitionmr50"}>
|
|
|
|
|
<span className={"tpmbannernavstyler"}>排行榜</span>
|
|
|
|
|
</Menu.Item>:""}
|
|
|
|
|
|
|
|
|
|
{this.state.identity >4||this.state.identity===undefined ? "":<Menu.Item key="9" className={"competitionmr50"}>
|
|
|
|
|
<span className={"tpmbannernavstyler"}>配置</span>
|
|
|
|
|
</Menu.Item>}
|
|
|
|
|
|
|
|
|
|
{this.state.identity >2||this.state.identity===undefined?"":
|
|
|
|
|
<div className={"fr"}>
|
|
|
|
|
<Link to={`/shixuns/${this.props.match.params.shixunId}/audit_situation`}
|
|
|
|
|
className={`${this.props.match.url.indexOf('audit_situation') != -1 ? 'font-16 audit_situationactive' : 'font-16 audit_situationactive'} fl`}>审核情况</Link>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
</Menu>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
|
|
<Col span={5}></Col>
|
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
|
|
{/*筛选*/}
|
|
|
|
|
{/*{*/}
|
|
|
|
|
{/* tpmindexjupyterbool===false?*/}
|
|
|
|
|