Merge branch 'master' of https://bdgit.educoder.net/Hjqreturn/educoder
commit
572dd32fee
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,16 +1,27 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
|
|
||||||
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
|
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
|
||||||
|
|
||||||
class Loading extends Component {
|
import { Spin } from 'antd';
|
||||||
render() {
|
|
||||||
// Loading
|
class Loading extends Component {
|
||||||
return (
|
render() {
|
||||||
<div className="App" style={{minHeight: '800px'}}>
|
// Loading
|
||||||
|
return (
|
||||||
</div>
|
<div className="App" style={{minHeight: '800px'}}>
|
||||||
);
|
<style>
|
||||||
}
|
{
|
||||||
}
|
`
|
||||||
|
.margintop{
|
||||||
export default Loading;
|
margin-top:20%;
|
||||||
|
}
|
||||||
|
`
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<Spin size="large" className={"margintop"}/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Loading;
|
||||||
|
@ -1,75 +1,75 @@
|
|||||||
.slider-img-wrapper img {
|
.slider-img-wrapper img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-radius: 15px;
|
/*border-radius: 15px;*/
|
||||||
height: 350px;
|
height: 350px;
|
||||||
}
|
}
|
||||||
.next-slick-list{
|
.next-slick-list{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.user_navlist{
|
.user_navlist{
|
||||||
margin-left: 40px;
|
margin-left: 40px;
|
||||||
}
|
}
|
||||||
.next-slick-list{
|
.next-slick-list{
|
||||||
margin-left: 12px;
|
margin-left: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.black_nav_span{
|
.black_nav_span{
|
||||||
display: block;
|
display: block;
|
||||||
margin: 0px 20px;
|
margin: 0px 20px;
|
||||||
border-bottom: 1px solid #4B4B4B;
|
border-bottom: 1px solid #4B4B4B;
|
||||||
padding-left: 8px;
|
padding-left: 8px;
|
||||||
color: #FAFAFA;
|
color: #FAFAFA;
|
||||||
}
|
}
|
||||||
|
|
||||||
.user_navlist_white{
|
.user_navlist_white{
|
||||||
z-index: 100 !important;
|
z-index: 100 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.next-slick.next-slick-horizontal.next-slick-outer{
|
.next-slick.next-slick-horizontal.next-slick-outer{
|
||||||
height: 350px;
|
height: 350px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.black_nav_list li span a{
|
.black_nav_list li span a{
|
||||||
color:#fff;
|
color:#fff;
|
||||||
}
|
}
|
||||||
.black_nav_list li span a:hover{
|
.black_nav_list li span a:hover{
|
||||||
color:#000;
|
color:#000;
|
||||||
}
|
}
|
||||||
.black_nav_list li:hover span a{
|
.black_nav_list li:hover span a{
|
||||||
color:#000;
|
color:#000;
|
||||||
}
|
}
|
||||||
.little-titles{
|
.little-titles{
|
||||||
height: 22px !important;
|
height: 22px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.user_navlist_white a{
|
.user_navlist_white a{
|
||||||
color: #989898 !important;
|
color: #989898 !important;
|
||||||
}
|
}
|
||||||
.user_navlist_white .navlistpanel-line .little-titles a{
|
.user_navlist_white .navlistpanel-line .little-titles a{
|
||||||
color: #000 !important;
|
color: #000 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.newnext-loading{
|
.newnext-loading{
|
||||||
display:block;
|
display:block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.educontentSlider{
|
.educontentSlider{
|
||||||
width: 1282px !important;
|
width: 1282px !important;
|
||||||
}
|
}
|
||||||
.user_navlist_white{
|
.user_navlist_white{
|
||||||
max-height:350px !important;
|
max-height:350px !important;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconfontzhangjie{
|
.iconfontzhangjie{
|
||||||
font-size: 10px !important;
|
font-size: 10px !important;
|
||||||
line-height: 23px;
|
line-height: 23px;
|
||||||
}
|
}
|
||||||
.iconfontshixundaibeijing{
|
.iconfontshixundaibeijing{
|
||||||
font-size: 18px !important;
|
font-size: 18px !important;
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
}
|
}
|
@ -1,49 +1,49 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { Redirect } from 'react-router';
|
import { Redirect } from 'react-router';
|
||||||
import { getImageUrl, toPath } from 'educoder'
|
import { getImageUrl, toPath } from 'educoder'
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
class NewFooter extends Component {
|
class NewFooter extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(newProps, newContext) {
|
componentWillReceiveProps(newProps, newContext) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div className="newFooter edu-txt-center">
|
<div className="newFooter edu-txt-center newContainers">
|
||||||
<div className="inner-footer_con">
|
<div className="inner-footer_con">
|
||||||
<div className="footercon">
|
<div className="footercon">
|
||||||
<div className="inline mt40 mb5">
|
<div className="inline mt40 mb5">
|
||||||
<a href="/" className="fl" style={{height:'70px'}}>
|
<a href="/" className="fl" style={{height:'70px'}}>
|
||||||
<img alt="高校智能化教学与实训平台" src={getImageUrl(`images/educoder/headNavLogo.png?1526520218`)} width="70px">
|
<img alt="高校智能化教学与实训平台" src={getImageUrl(`images/educoder/headNavLogo.png?1526520218`)} width="70px">
|
||||||
</img>
|
</img>
|
||||||
</a>
|
</a>
|
||||||
<span className="fl color-grey-c cdefault font-28 ml22" style={{lineHeight:'74px'}}>EduCoder.net</span>
|
<span className="fl color-grey-c cdefault font-28 ml22" style={{lineHeight:'74px'}}>EduCoder.net</span>
|
||||||
</div>
|
</div>
|
||||||
<ul className="clearfix inner-footernav">
|
<ul className="clearfix inner-footernav">
|
||||||
<li><a href="/" className="fl" target="_blank">网站首页</a></li>
|
<li><a href="/" className="fl" target="_blank">网站首页</a></li>
|
||||||
<li><a href={this.props.Footerdown===undefined?"":this.props.Footerdown.about_us} className="fl" target="_blank">关于我们</a></li>
|
<li><a href={this.props.Footerdown===undefined?"":this.props.Footerdown.about_us} className="fl" target="_blank">关于我们</a></li>
|
||||||
<li><a href={this.props.Footerdown===undefined?"":this.props.Footerdown.connect_us} className="fl" target="_blank">联系我们</a></li>
|
<li><a href={this.props.Footerdown===undefined?"":this.props.Footerdown.connect_us} className="fl" target="_blank">联系我们</a></li>
|
||||||
<li><a href={this.props.Footerdown===undefined?"":this.props.Footerdown.cooperation_partner} className="fl" target="_blank">合作伙伴</a></li>
|
<li><a href={this.props.Footerdown===undefined?"":this.props.Footerdown.cooperation_partner} className="fl" target="_blank">合作伙伴</a></li>
|
||||||
<li><a href={this.props.Footerdown===undefined?"":this.props.Footerdown.service_agreement} className="fl" target="_blank">服务协议</a></li>
|
<li><a href={this.props.Footerdown===undefined?"":this.props.Footerdown.service_agreement} className="fl" target="_blank">服务协议</a></li>
|
||||||
<li><a href={this.props.Footerdown===undefined?"":this.props.Footerdown.help_center} className="fl" target="_blank">帮助中心</a></li>
|
<li><a href={this.props.Footerdown===undefined?"":this.props.Footerdown.help_center} className="fl" target="_blank">帮助中心</a></li>
|
||||||
<li><a href={this.props.Footerdown===undefined?"":this.props.Footerdown.feedback} className="fl" target="_blank">意见反馈</a></li>
|
<li><a href={this.props.Footerdown===undefined?"":this.props.Footerdown.feedback} className="fl" target="_blank">意见反馈</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<p className="footer_con-p inline lineh-30 font-14"><span className="font-18 fl">©</span> 2019 EduCoder<span className="ml15 mr15">湘ICP备17009477号</span><a href="https://team.trustie.net" style={{"color":"#888"}} target="_blank">Trustie</a> & IntelliDE inside.</p>
|
<p className="footer_con-p inline lineh-30 font-14"><span className="font-18 fl">©</span> 2019 EduCoder<span className="ml15 mr15">湘ICP备17009477号</span><a href="https://team.trustie.net" style={{"color":"#888"}} target="_blank">Trustie</a> & IntelliDE inside.</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="cl"></div>
|
<div className="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default NewFooter;
|
export default NewFooter;
|
||||||
|
@ -1,382 +1,382 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
|
|
||||||
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
|
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
|
||||||
|
|
||||||
import Loading from '../../Loading';
|
import Loading from '../../Loading';
|
||||||
|
|
||||||
import Loadable from 'react-loadable';
|
import Loadable from 'react-loadable';
|
||||||
|
|
||||||
import { TPMIndexHOC } from './TPMIndexHOC';
|
import { TPMIndexHOC } from './TPMIndexHOC';
|
||||||
|
|
||||||
import { SnackbarHOC } from 'educoder';
|
import { SnackbarHOC } from 'educoder';
|
||||||
|
|
||||||
import TPMBanner from './TPMBanner';
|
import TPMBanner from './TPMBanner';
|
||||||
|
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
import TPMShixunDiscussContainer from './TPMShixunDiscussContainer';
|
import TPMShixunDiscussContainer from './TPMShixunDiscussContainer';
|
||||||
|
|
||||||
import TPMRepositoryComponent from './TPMRepositoryComponent';
|
import TPMRepositoryComponent from './TPMRepositoryComponent';
|
||||||
|
|
||||||
import TPMRepositoryCommits from './shixunchild/Repository/TPMRepositoryCommits';
|
import TPMRepositoryCommits from './shixunchild/Repository/TPMRepositoryCommits';
|
||||||
|
|
||||||
import TPMsettings from './TPMsettings/TPMsettings';
|
import TPMsettings from './TPMsettings/TPMsettings';
|
||||||
|
|
||||||
import TPMChallengeComponent from './TPMChallengeContainer'
|
import TPMChallengeComponent from './TPMChallengeContainer'
|
||||||
import TPMPropaedeuticsComponent from './TPMPropaedeuticsComponent'
|
import TPMPropaedeuticsComponent from './TPMPropaedeuticsComponent'
|
||||||
import TPMRanking_listComponent from './TPMRanking_listContainer'
|
import TPMRanking_listComponent from './TPMRanking_listContainer'
|
||||||
import TPMCollaboratorsComponent from './TPMCollaboratorsContainer'
|
import TPMCollaboratorsComponent from './TPMCollaboratorsContainer'
|
||||||
|
|
||||||
import '../page/tpiPage.css'
|
import '../page/tpiPage.css'
|
||||||
//任务
|
//任务
|
||||||
// const TPMChallengeComponent = Loadable({
|
// const TPMChallengeComponent = Loadable({
|
||||||
// loader: () => import('./TPMChallengeContainer'),
|
// loader: () => import('./TPMChallengeContainer'),
|
||||||
// loading: Loading,
|
// loading: Loading,
|
||||||
// })
|
// })
|
||||||
|
|
||||||
//背景知识
|
//背景知识
|
||||||
// const TPMPropaedeuticsComponent = Loadable({
|
// const TPMPropaedeuticsComponent = Loadable({
|
||||||
// loader: () => import('./TPMPropaedeuticsComponent'),
|
// loader: () => import('./TPMPropaedeuticsComponent'),
|
||||||
// loading: Loading,
|
// loading: Loading,
|
||||||
// })
|
// })
|
||||||
|
|
||||||
//版本库
|
//版本库
|
||||||
// const TPMRepositoryComponent = Loadable({
|
// const TPMRepositoryComponent = Loadable({
|
||||||
// loader: () => import('./TPMRepositoryComponent'),
|
// loader: () => import('./TPMRepositoryComponent'),
|
||||||
// loading: Loading,
|
// loading: Loading,
|
||||||
// })
|
// })
|
||||||
|
|
||||||
// const TPMRepositoryComponent = Loadable({
|
// const TPMRepositoryComponent = Loadable({
|
||||||
// loader: () => import('./TPMRepositoryComponent'),
|
// loader: () => import('./TPMRepositoryComponent'),
|
||||||
// loading: Loading,
|
// loading: Loading,
|
||||||
// })
|
// })
|
||||||
|
|
||||||
//合作
|
//合作
|
||||||
// const TPMCollaboratorsComponent = Loadable({
|
// const TPMCollaboratorsComponent = Loadable({
|
||||||
// loader: () => import('./TPMCollaboratorsContainer'),
|
// loader: () => import('./TPMCollaboratorsContainer'),
|
||||||
// loading: Loading,
|
// loading: Loading,
|
||||||
// })
|
// })
|
||||||
|
|
||||||
|
|
||||||
//评论
|
//评论
|
||||||
// const TPMShixunDiscussComponent = Loadable({
|
// const TPMShixunDiscussComponent = Loadable({
|
||||||
// loader: () => import('./TPMShixunDiscussContainer'),
|
// loader: () => import('./TPMShixunDiscussContainer'),
|
||||||
// loading: Loading,
|
// loading: Loading,
|
||||||
// })
|
// })
|
||||||
|
|
||||||
//排行版
|
//排行版
|
||||||
// const TPMRanking_listComponent = Loadable({
|
// const TPMRanking_listComponent = Loadable({
|
||||||
// loader: () => import('./TPMRanking_listContainer'),
|
// loader: () => import('./TPMRanking_listContainer'),
|
||||||
// loading: Loading,
|
// loading: Loading,
|
||||||
// })
|
// })
|
||||||
|
|
||||||
// //编辑实训
|
// //编辑实训
|
||||||
// const TPMModifysettings = Loadable({
|
// const TPMModifysettings = Loadable({
|
||||||
// loader: () =>import('./modules/tpm/TPMsettings/TPMsettings'),
|
// loader: () =>import('./modules/tpm/TPMsettings/TPMsettings'),
|
||||||
// loading: Loading,
|
// loading: Loading,
|
||||||
// })
|
// })
|
||||||
|
|
||||||
//新建实训
|
//新建实训
|
||||||
const TPMchallengesnew = Loadable({
|
const TPMchallengesnew = Loadable({
|
||||||
loader: () => import('./challengesnew/TPMchallengesnew'),
|
loader: () => import('./challengesnew/TPMchallengesnew'),
|
||||||
loading: Loading,
|
loading: Loading,
|
||||||
})
|
})
|
||||||
|
|
||||||
//新建tab2
|
//新建tab2
|
||||||
const TPMevaluation = Loadable({
|
const TPMevaluation = Loadable({
|
||||||
loader: () => import('./challengesnew/TPMevaluation'),
|
loader: () => import('./challengesnew/TPMevaluation'),
|
||||||
loading: Loading,
|
loading: Loading,
|
||||||
})
|
})
|
||||||
|
|
||||||
//新建tab3答案
|
//新建tab3答案
|
||||||
// const TPManswer = Loadable({
|
// const TPManswer = Loadable({
|
||||||
// loader: () => import('./challengesnew/TPManswer'),
|
// loader: () => import('./challengesnew/TPManswer'),
|
||||||
// loading: Loading,
|
// loading: Loading,
|
||||||
// })
|
// })
|
||||||
const TPManswer = Loadable({
|
const TPManswer = Loadable({
|
||||||
loader: () => import('./challengesnew/TPManswer2'),
|
loader: () => import('./challengesnew/TPManswer2'),
|
||||||
loading: Loading,
|
loading: Loading,
|
||||||
})
|
})
|
||||||
|
|
||||||
//选择题
|
//选择题
|
||||||
const TPMquestion = Loadable({
|
const TPMquestion = Loadable({
|
||||||
loader: () => import('./challengesnew/TPMquestion'),
|
loader: () => import('./challengesnew/TPMquestion'),
|
||||||
loading: Loading,
|
loading: Loading,
|
||||||
})
|
})
|
||||||
|
|
||||||
//fork列表
|
//fork列表
|
||||||
const TPMFork_listComponent = Loadable({
|
const TPMFork_listComponent = Loadable({
|
||||||
loader: () => import('./TPMFork/TPMForklist'),
|
loader: () => import('./TPMFork/TPMForklist'),
|
||||||
loading: Loading,
|
loading: Loading,
|
||||||
})
|
})
|
||||||
//背景知识修改
|
//背景知识修改
|
||||||
const TPMUpdatepropaede = Loadable({
|
const TPMUpdatepropaede = Loadable({
|
||||||
loader: () => import('./TPMUpdatepropaede/TPMUpdatepropaede'),
|
loader: () => import('./TPMUpdatepropaede/TPMUpdatepropaede'),
|
||||||
loading: Loading,
|
loading: Loading,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
const interceptorUrlArray = ['repository.json', 'commits.json', 'propaedeutics.json'
|
const interceptorUrlArray = ['repository.json', 'commits.json', 'propaedeutics.json'
|
||||||
, 'challenges.json', 'discusses.json', 'ranking_list.json', 'collaborators.json']
|
, 'challenges.json', 'discusses.json', 'ranking_list.json', 'collaborators.json']
|
||||||
const cacheInterceptorUrlMap = {}
|
const cacheInterceptorUrlMap = {}
|
||||||
class TPMIndex extends Component {
|
class TPMIndex extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
this.state = {
|
this.state = {
|
||||||
loadingContent: false,
|
loadingContent: false,
|
||||||
power: false,
|
power: false,
|
||||||
shixunsDetails: {},
|
shixunsDetails: {},
|
||||||
shixunId: undefined,
|
shixunId: undefined,
|
||||||
star_info: [0, 0, 0, 0, 0, 0],
|
star_info: [0, 0, 0, 0, 0, 0],
|
||||||
star_infos: [0, 0, 0, 0, 0, 0],
|
star_infos: [0, 0, 0, 0, 0, 0],
|
||||||
identity:undefined,
|
identity:undefined,
|
||||||
TPMRightSectionData:undefined,
|
TPMRightSectionData:undefined,
|
||||||
PropaedeuticsList: undefined,
|
PropaedeuticsList: undefined,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount = () => {
|
componentDidMount = () => {
|
||||||
|
|
||||||
let id = this.props.match.params.shixunId;
|
let id = this.props.match.params.shixunId;
|
||||||
|
|
||||||
// let collaborators = `/shixuns/` + id + `/propaedeutics.json`;
|
// let collaborators = `/shixuns/` + id + `/propaedeutics.json`;
|
||||||
//
|
//
|
||||||
// axios.get(collaborators).then((response) => {
|
// axios.get(collaborators).then((response) => {
|
||||||
// if (response.status === 200) {
|
// if (response.status === 200) {
|
||||||
// if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
|
// if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
|
||||||
//
|
//
|
||||||
// }else{
|
// }else{
|
||||||
// this.setState({
|
// this.setState({
|
||||||
// PropaedeuticsList: response.data,
|
// PropaedeuticsList: response.data,
|
||||||
// shixunId: id
|
// shixunId: id
|
||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// }
|
// }
|
||||||
// }).catch((error) => {
|
// }).catch((error) => {
|
||||||
// console.log(error)
|
// console.log(error)
|
||||||
// });
|
// });
|
||||||
|
|
||||||
let Url = `/shixuns/` + id + `.json`;
|
let Url = `/shixuns/` + id + `.json`;
|
||||||
axios.get(Url).then((response) => {
|
axios.get(Url).then((response) => {
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
document.title=response.data.name;
|
document.title=response.data.name;
|
||||||
let newstar_info = [];
|
let newstar_info = [];
|
||||||
// let start1=
|
// let start1=
|
||||||
for (var i = 0; i < response.data.score_info.length; i++) {
|
for (var i = 0; i < response.data.score_info.length; i++) {
|
||||||
|
|
||||||
if (i === 0) {
|
if (i === 0) {
|
||||||
newstar_info.push(response.data.score_info[i])
|
newstar_info.push(response.data.score_info[i])
|
||||||
} else {
|
} else {
|
||||||
newstar_info.push((response.data.score_info[i] / 100) * 5)
|
newstar_info.push((response.data.score_info[i] / 100) * 5)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let newstar_infos = response.data.score_info;
|
let newstar_infos = response.data.score_info;
|
||||||
this.setState({
|
this.setState({
|
||||||
shixunsDetails: response.data,
|
shixunsDetails: response.data,
|
||||||
shixunId: id,
|
shixunId: id,
|
||||||
star_info: newstar_info,
|
star_info: newstar_info,
|
||||||
star_infos: newstar_infos,
|
star_infos: newstar_infos,
|
||||||
power: response.data.power,
|
power: response.data.power,
|
||||||
identity: response.data.identity,
|
identity: response.data.identity,
|
||||||
propaedeutics:response.data.propaedeutics,
|
propaedeutics:response.data.propaedeutics,
|
||||||
status: response.data.status,
|
status: response.data.shixun_status,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
shixunsDetails: undefined,
|
shixunsDetails: undefined,
|
||||||
shixunId: undefined,
|
shixunId: undefined,
|
||||||
star_info: undefined,
|
star_info: undefined,
|
||||||
star_infos: undefined,
|
star_infos: undefined,
|
||||||
power: undefined,
|
power: undefined,
|
||||||
identity: undefined,
|
identity: undefined,
|
||||||
status: undefined,
|
status: undefined,
|
||||||
propaedeutics:undefined
|
propaedeutics:undefined
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
this.tpmContentRequestInterceptor = axios.interceptors.request.use((config) => {
|
this.tpmContentRequestInterceptor = axios.interceptors.request.use((config) => {
|
||||||
let url = config.url;
|
let url = config.url;
|
||||||
// console.log('tpmContentRequestInterceptor:', url)
|
// console.log('tpmContentRequestInterceptor:', url)
|
||||||
for ( let i = 0; i < interceptorUrlArray.length; i++ ) {
|
for ( let i = 0; i < interceptorUrlArray.length; i++ ) {
|
||||||
if (url.indexOf(interceptorUrlArray[i]) != -1) {
|
if (url.indexOf(interceptorUrlArray[i]) != -1) {
|
||||||
url = url.split('?')[0]
|
url = url.split('?')[0]
|
||||||
console.log('loadingContent, url:', url)
|
console.log('loadingContent, url:', url)
|
||||||
|
|
||||||
this.setState({ loadingContent: true })
|
this.setState({ loadingContent: true })
|
||||||
|
|
||||||
cacheInterceptorUrlMap[url] = true
|
cacheInterceptorUrlMap[url] = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return config;
|
return config;
|
||||||
}, function (error) {
|
}, function (error) {
|
||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add a response interceptor
|
// Add a response interceptor
|
||||||
this.tpmContentResponseInterceptor = axios.interceptors.response.use((response) => {
|
this.tpmContentResponseInterceptor = axios.interceptors.response.use((response) => {
|
||||||
// console.log('loadingContent finished, url:', response.config.url)
|
// console.log('loadingContent finished, url:', response.config.url)
|
||||||
// TODO 依赖了api这个前缀
|
// TODO 依赖了api这个前缀
|
||||||
let url = response.config.url.split('api')[1];
|
let url = response.config.url.split('api')[1];
|
||||||
url = url.split('?')[0]
|
url = url.split('?')[0]
|
||||||
if (cacheInterceptorUrlMap[url]) {
|
if (cacheInterceptorUrlMap[url]) {
|
||||||
|
|
||||||
this.setState({ loadingContent: false })
|
this.setState({ loadingContent: false })
|
||||||
delete cacheInterceptorUrlMap[response.url]
|
delete cacheInterceptorUrlMap[response.url]
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}, function (error) {
|
}, function (error) {
|
||||||
// Do something with response error
|
// Do something with response error
|
||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
//右侧数据
|
//右侧数据
|
||||||
let shixunsDetailsURL=`/shixuns/`+id+`/show_right.json`;
|
let shixunsDetailsURL=`/shixuns/`+id+`/show_right.json`;
|
||||||
axios.get(shixunsDetailsURL).then((response)=> {
|
axios.get(shixunsDetailsURL).then((response)=> {
|
||||||
this.setState({
|
this.setState({
|
||||||
TPMRightSectionData: response.data
|
TPMRightSectionData: response.data
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
componentWillUnmount = () => {
|
componentWillUnmount = () => {
|
||||||
axios.interceptors.request.eject(this.tpmContentRequestInterceptor);
|
axios.interceptors.request.eject(this.tpmContentRequestInterceptor);
|
||||||
this.tpmContentRequestInterceptor = null;
|
this.tpmContentRequestInterceptor = null;
|
||||||
axios.interceptors.request.eject(this.tpmContentResponseInterceptor);
|
axios.interceptors.request.eject(this.tpmContentResponseInterceptor);
|
||||||
this.tpmContentResponseInterceptor = null;
|
this.tpmContentResponseInterceptor = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
setLoadingContent = (isLoadingContent) => {
|
setLoadingContent = (isLoadingContent) => {
|
||||||
this.setState({ loadingContent: isLoadingContent })
|
this.setState({ loadingContent: isLoadingContent })
|
||||||
}
|
}
|
||||||
|
|
||||||
// TpmTPMBannertype(type){
|
// TpmTPMBannertype(type){
|
||||||
//
|
//
|
||||||
// }
|
// }
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="newMain clearfix">
|
<div className="newMain clearfix">
|
||||||
|
|
||||||
<TPMBanner
|
<TPMBanner
|
||||||
{...this.props}
|
{...this.props}
|
||||||
{...this.state}
|
{...this.state}
|
||||||
></TPMBanner>
|
></TPMBanner>
|
||||||
|
|
||||||
<Switch {...this.props}>
|
<Switch {...this.props}>
|
||||||
|
|
||||||
<Route path="/shixuns/:shixunId/repository/:repoId/commits" render={
|
<Route path="/shixuns/:shixunId/repository/:repoId/commits" render={
|
||||||
(props) => (<TPMRepositoryCommits {...this.props} {...this.state} {...props}
|
(props) => (<TPMRepositoryCommits {...this.props} {...this.state} {...props}
|
||||||
/>)
|
/>)
|
||||||
}></Route>
|
}></Route>
|
||||||
|
|
||||||
<Route exact path="/shixuns/:shixunId/challenges" render={
|
<Route exact path="/shixuns/:shixunId/challenges" render={
|
||||||
(props) => (<TPMChallengeComponent {...this.props} {...this.state} {...props}
|
(props) => (<TPMChallengeComponent {...this.props} {...this.state} {...props}
|
||||||
/>)
|
/>)
|
||||||
}></Route>
|
}></Route>
|
||||||
|
|
||||||
<Route path="/shixuns/:shixunId/repository" render={
|
<Route path="/shixuns/:shixunId/repository" render={
|
||||||
(props) => (<TPMRepositoryComponent {...this.props} {...this.state} {...props}
|
(props) => (<TPMRepositoryComponent {...this.props} {...this.state} {...props}
|
||||||
/>)
|
/>)
|
||||||
}></Route>
|
}></Route>
|
||||||
{/* <Route exact path="/shixuns/:shixunId/propaedeutics" component={TPMPropaedeuticsComponent}></Route> */}
|
{/* <Route exact path="/shixuns/:shixunId/propaedeutics" component={TPMPropaedeuticsComponent}></Route> */}
|
||||||
|
|
||||||
<Route exact path="/shixuns/:shixunId/propaedeutics" render={
|
<Route exact path="/shixuns/:shixunId/propaedeutics" render={
|
||||||
(props) => (<TPMPropaedeuticsComponent {...this.props} {...this.state} {...props}
|
(props) => (<TPMPropaedeuticsComponent {...this.props} {...this.state} {...props}
|
||||||
/>)
|
/>)
|
||||||
}></Route>
|
}></Route>
|
||||||
|
|
||||||
|
|
||||||
<Route exact path="/shixuns/:shixunId/collaborators" render={
|
<Route exact path="/shixuns/:shixunId/collaborators" render={
|
||||||
(props) => (<TPMCollaboratorsComponent {...this.props} {...this.state} {...props}
|
(props) => (<TPMCollaboratorsComponent {...this.props} {...this.state} {...props}
|
||||||
/>)
|
/>)
|
||||||
}></Route>
|
}></Route>
|
||||||
|
|
||||||
|
|
||||||
{/* <Route exact path="/shixuns/:shixunId/repository/:shixunId/" component={TPMRepositoryComponent}></Route> */}
|
{/* <Route exact path="/shixuns/:shixunId/repository/:shixunId/" component={TPMRepositoryComponent}></Route> */}
|
||||||
|
|
||||||
|
|
||||||
<Route path="/shixuns/:shixunId/shixun_discuss" render={
|
<Route path="/shixuns/:shixunId/shixun_discuss" render={
|
||||||
(props) => (<TPMShixunDiscussContainer {...this.props} {...this.state} {...props}
|
(props) => (<TPMShixunDiscussContainer {...this.props} {...this.state} {...props}
|
||||||
initForumState={(data)=>this.initForumState(data)}
|
initForumState={(data)=>this.initForumState(data)}
|
||||||
setSearchValue={this.setSearchValue}
|
setSearchValue={this.setSearchValue}
|
||||||
setHotLabelIndex={this.setHotLabelIndex}
|
setHotLabelIndex={this.setHotLabelIndex}
|
||||||
/>)
|
/>)
|
||||||
}></Route>
|
}></Route>
|
||||||
|
|
||||||
|
|
||||||
<Route path="/shixuns/:shixunId/settings" render={
|
<Route path="/shixuns/:shixunId/settings" render={
|
||||||
(props) => (<TPMsettings {...this.props} {...this.state} {...props} />)
|
(props) => (<TPMsettings {...this.props} {...this.state} {...props} />)
|
||||||
}></Route>
|
}></Route>
|
||||||
|
|
||||||
|
|
||||||
<Route exact path="/shixuns/:shixunId/ranking_list" render={
|
<Route exact path="/shixuns/:shixunId/ranking_list" render={
|
||||||
(props) => (<TPMRanking_listComponent {...this.props} {...this.state} {...props}
|
(props) => (<TPMRanking_listComponent {...this.props} {...this.state} {...props}
|
||||||
/>)
|
/>)
|
||||||
}></Route>
|
}></Route>
|
||||||
|
|
||||||
<Route exact path="/shixuns/:shixunId/fork_list" render={
|
<Route exact path="/shixuns/:shixunId/fork_list" render={
|
||||||
(props) => (<TPMFork_listComponent {...this.props} {...props}
|
(props) => (<TPMFork_listComponent {...this.props} {...props}
|
||||||
/>)
|
/>)
|
||||||
}></Route>
|
}></Route>
|
||||||
|
|
||||||
<Route exact path="/shixuns/:shixunId/update_propaedeutics" render={
|
<Route exact path="/shixuns/:shixunId/update_propaedeutics" render={
|
||||||
(props) => (<TPMUpdatepropaede {...this.props} {...props}
|
(props) => (<TPMUpdatepropaede {...this.props} {...props}
|
||||||
/>)
|
/>)
|
||||||
}></Route>
|
}></Route>
|
||||||
|
|
||||||
{/*评测设置*/}
|
{/*评测设置*/}
|
||||||
<Route path="/shixuns/:shixunId/challenges/:checkpointId/tab=2" render={
|
<Route path="/shixuns/:shixunId/challenges/:checkpointId/tab=2" render={
|
||||||
(props) => (<TPMevaluation {...this.props} {...props} {...this.state}/>)
|
(props) => (<TPMevaluation {...this.props} {...props} {...this.state}/>)
|
||||||
}></Route>
|
}></Route>
|
||||||
|
|
||||||
|
|
||||||
{/*参考答案*/}
|
{/*参考答案*/}
|
||||||
<Route path="/shixuns/:shixunId/challenges/:checkpointId/tab=3" render={
|
<Route path="/shixuns/:shixunId/challenges/:checkpointId/tab=3" render={
|
||||||
(props) => (<TPManswer {...this.props} {...props} {...this.state}/>)
|
(props) => (<TPManswer {...this.props} {...props} {...this.state}/>)
|
||||||
}></Route>
|
}></Route>
|
||||||
|
|
||||||
{/*新建关卡*/}
|
{/*新建关卡*/}
|
||||||
<Route path="/shixuns/:shixunId/challenges/new" render={
|
<Route path="/shixuns/:shixunId/challenges/new" render={
|
||||||
(props) => (<TPMchallengesnew {...this.props} {...props} {...this.state}/>)
|
(props) => (<TPMchallengesnew {...this.props} {...props} {...this.state}/>)
|
||||||
}></Route>
|
}></Route>
|
||||||
|
|
||||||
{/*编辑关卡*/}
|
{/*编辑关卡*/}
|
||||||
<Route path="/shixuns/:shixunId/challenges/:checkpointId/editcheckpoint" render={
|
<Route path="/shixuns/:shixunId/challenges/:checkpointId/editcheckpoint" render={
|
||||||
(props) => (<TPMchallengesnew {...this.props} {...props} {...this.state} />)
|
(props) => (<TPMchallengesnew {...this.props} {...props} {...this.state} />)
|
||||||
}></Route>
|
}></Route>
|
||||||
|
|
||||||
{/*新建选择题*/}
|
{/*新建选择题*/}
|
||||||
<Route path="/shixuns/:shixunId/challenges/newquestion" render={
|
<Route path="/shixuns/:shixunId/challenges/newquestion" render={
|
||||||
(props) => (<TPMquestion {...this.props} {...props} {...this.state} />)
|
(props) => (<TPMquestion {...this.props} {...props} {...this.state} />)
|
||||||
}></Route>
|
}></Route>
|
||||||
|
|
||||||
{/*修改选择题*/}
|
{/*修改选择题*/}
|
||||||
<Route path="/shixuns/:shixunId/challenges/:checkpointId/editquestion/:choose_id" render={
|
<Route path="/shixuns/:shixunId/challenges/:checkpointId/editquestion/:choose_id" render={
|
||||||
(props) => (<TPMquestion {...this.props} {...props} {...this.state}/>)
|
(props) => (<TPMquestion {...this.props} {...props} {...this.state}/>)
|
||||||
}></Route>
|
}></Route>
|
||||||
|
|
||||||
{/*修改选择题*/}
|
{/*修改选择题*/}
|
||||||
<Route path="/shixuns/:shixunId/challenges/:checkpointId/editquestion" render={
|
<Route path="/shixuns/:shixunId/challenges/:checkpointId/editquestion" render={
|
||||||
(props) => (<TPMquestion {...this.props} {...props} {...this.state}/>)
|
(props) => (<TPMquestion {...this.props} {...props} {...this.state}/>)
|
||||||
}></Route>
|
}></Route>
|
||||||
|
|
||||||
<Route exact path="/shixuns/:shixunId" render={
|
<Route exact path="/shixuns/:shixunId" render={
|
||||||
(props) => (<TPMChallengeComponent {...this.props} {...this.state} {...props}
|
(props) => (<TPMChallengeComponent {...this.props} {...this.state} {...props}
|
||||||
/>)
|
/>)
|
||||||
}></Route>
|
}></Route>
|
||||||
|
|
||||||
|
|
||||||
{/*<Route exact path="/shixuns/:shixunId" component={TPMChallengeComponent}></Route>*/}
|
{/*<Route exact path="/shixuns/:shixunId" component={TPMChallengeComponent}></Route>*/}
|
||||||
</Switch>
|
</Switch>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default SnackbarHOC() (TPMIndexHOC ( TPMIndex ));
|
export default SnackbarHOC() (TPMIndexHOC ( TPMIndex ));
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue