合并最近的修改。

dev_aliyun2
harry 5 years ago
parent ae22ebeeeb
commit 5be361e2ef

@ -12316,6 +12316,21 @@
"resolved": "https://registry.npm.taobao.org/q/download/q-1.5.1.tgz",
"integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc="
},
"qr.js": {
"version": "0.0.0",
"resolved": "https://registry.npm.taobao.org/qr.js/download/qr.js-0.0.0.tgz",
"integrity": "sha1-ys6GOG9ZoNuAUPqQ2baw6IoeNk8="
},
"qrcode.react": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/qrcode.react/download/qrcode.react-1.0.0.tgz",
"integrity": "sha1-foiJ2zt2nlVejrRj1MbeIhw21d4=",
"requires": {
"loose-envify": "^1.4.0",
"prop-types": "^15.6.0",
"qr.js": "0.0.0"
}
},
"qs": {
"version": "6.9.2",
"resolved": "https://registry.npm.taobao.org/qs/download/qs-6.9.2.tgz?cache=0&sync_timestamp=1584892552959&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fqs%2Fdownload%2Fqs-6.9.2.tgz",
@ -17826,51 +17841,6 @@
}
}
},
"webpack-parallel-uglify-plugin": {
"version": "1.1.2",
"resolved": "https://registry.npm.taobao.org/webpack-parallel-uglify-plugin/download/webpack-parallel-uglify-plugin-1.1.2.tgz",
"integrity": "sha1-zBxG3YscTttnbUd0Skt4avSNNl4=",
"requires": {
"babel-code-frame": "^6.26.0",
"glob": "^7.0.5",
"mkdirp": "^0.5.1",
"pify": "^3.0.0",
"tmp": "0.0.29",
"uglify-es": "^3.3.9",
"uglify-js": "^3.6.0",
"webpack-sources": "^1.0.0",
"worker-farm": "^1.3.1"
},
"dependencies": {
"commander": {
"version": "2.20.3",
"resolved": "https://registry.npm.taobao.org/commander/download/commander-2.20.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.20.3.tgz",
"integrity": "sha1-/UhehMA+tIgcIHIrpIA16FMa6zM="
},
"pify": {
"version": "3.0.0",
"resolved": "https://registry.npm.taobao.org/pify/download/pify-3.0.0.tgz",
"integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY="
},
"tmp": {
"version": "0.0.29",
"resolved": "https://registry.npm.taobao.org/tmp/download/tmp-0.0.29.tgz",
"integrity": "sha1-8lEl/w3Z2jzLDC3Tce4SiLuRKMA=",
"requires": {
"os-tmpdir": "~1.0.1"
}
},
"uglify-js": {
"version": "3.8.0",
"resolved": "https://registry.npm.taobao.org/uglify-js/download/uglify-js-3.8.0.tgz?cache=0&sync_timestamp=1582036421880&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fuglify-js%2Fdownload%2Fuglify-js-3.8.0.tgz",
"integrity": "sha1-81Qa6XsvBI1+fjqk85/YofXXqAU=",
"requires": {
"commander": "~2.20.3",
"source-map": "~0.6.1"
}
}
}
},
"webpack-sources": {
"version": "1.4.3",
"resolved": "https://registry.npm.taobao.org/webpack-sources/download/webpack-sources-1.4.3.tgz",
@ -17902,11 +17872,6 @@
"resolved": "https://registry.npm.taobao.org/websocket-extensions/download/websocket-extensions-0.1.3.tgz",
"integrity": "sha1-XS/yKXcAPsaHpLhwc9+7rBRszyk="
},
"webworkify": {
"version": "1.5.0",
"resolved": "https://registry.npm.taobao.org/webworkify/download/webworkify-1.5.0.tgz",
"integrity": "sha1-c0rYendN5uvdVG4dPgJ9pbj0pCw="
},
"whatwg-encoding": {
"version": "1.0.5",
"resolved": "https://registry.npm.taobao.org/whatwg-encoding/download/whatwg-encoding-1.0.5.tgz",

@ -28,6 +28,7 @@
"object-assign": "4.1.1",
"promise": "8.0.1",
"prop-types": "^15.6.1",
"qrcode.react": "^1.0.0",
"qs": "^6.9.2",
"quill": "^1.3.7",
"quill-delta-to-html": "^0.11.0",

@ -1,13 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!--<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">-->
<!-- width=device-width, initial-scale=1 , shrink-to-fit=no -->
<!-- <meta name="viewport" content=""> -->
<meta name=”Keywords” Content=”EduCoder,信息技术实践教学,精品课程网,慕课MOOC″>
<meta name=”Keywords” Content=”实践课程,项目实战,java实训,python实战,人工智能技术,后端开发学习,移动开发入门″>
<meta name=”Keywords” Content=”翻转课堂,高效课堂创建,教学模式″>
@ -21,81 +15,15 @@
Content=”EduCoder翻转课堂教学模式颠覆了传统教学模式让教师与学生的关系由“权威”变成了“伙伴”。将学习的主动权转交给学生使学生可个性化化学学生的学习主体得到了彰显。”>
<meta name=”Description” Content=”EduCoder实训项目为单个知识点关卡实践训练帮助学生巩固单一弱点强化学习。 >
<meta name=”Description” Content=”EduCoder实践教学平台各类大赛为进一步提高各类学生综合运用高级语言程序设计能力培养创新意识和实践探索精神发掘优秀软件人才。 >
<!-- <meta name="viewport" id="viewport" content="width=device-width, initial-scale=0.3, maximum-scale=0.3, user-scalable=no">-->
<!-- <meta name="viewport" id="viewport" content="width=device-width, initial-scale=0.3, maximum-scale=0.3">-->
<meta name="viewport" id="viewport" content="width=device-width, initial-scale=0.3, maximum-scale=0.3">
<meta name="theme-color" content="#000000">
<!--<meta http-equiv="cache-control" content="no-cache,no-store, must-revalidate" />-->
<!--<meta http-equiv="pragma" content="no-cache" />-->
<!--<meta http-equiv="Expires" content="0" />-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<!-- <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">-->
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<!-- <title>EduCoder</title>-->
<!--react-ssr-head-->
<script type="text/javascript">
window.__isR = true;
// 不支持ie9 ie10
if (
(navigator.userAgent.indexOf('MSIE 9') != -1
|| navigator.userAgent.indexOf('MSIE 10') != -1)
&&
location.pathname.indexOf("/compatibility") == -1) {
debugger;
// location.href = './compatibility'
location.href = '/compatibility.html'
}
// const isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
const isWeiXin = (/MicroMessenger/i.test(navigator.userAgent.toLowerCase()));
if (isWeiXin) {
document.write('<script type="text/javascript" src="/javascripts/wx/jweixin-1.3.0.js"><\/script>');
}
</script>
<!-- <link rel="stylesheet" type="text/css" href="/css/edu-common.css">
<link rel="stylesheet" type="text/css" href="/css/edu-public.css">
<link rel="stylesheet" type="text/css" href="/css/taskstyle.css">
<link rel="stylesheet" type="text/css" href="/css/font-awesome.css">
<link rel="stylesheet" type="text/css" href="/css/editormd.min.css">
<head>
<meta charset="utf-8">
<meta name=”Keywords” Content=”EduCoder,信息技术实践教学,精品课程网,慕课MOOC″>
<meta name=”Keywords” Content=”实践课程,项目实战,java实训,python实战,人工智能技术,后端开发学习,移动开发入门″>
<meta name=”Keywords” Content=”翻转课堂,高效课堂创建,教学模式″>
<meta name=”Keywords” Content=”实训项目,python教程,C语言入门,java书,php后端开发,app前端开发,数据库技术″>
<meta name=”Keywords” Content=”在线竞赛,计算机应用大赛,编程大赛,大学生计算机设计大赛,全国高校绿色计算机大赛″>
<meta name=”Description”
Content=”EduCoder是信息技术类实践教学平台。EduCoder涵盖了计算机、大数据、云计算、人工智能、软件工程、物联网等专业课程。超10000个实训案例及22000个技能评测点建立学、练、评、测一体化实验环境。”>
<meta name=”Description”
Content=”EduCoder实践课程旨在于通过企业级实战实训案例帮助众多程序员提升各项业务能力。解决学生、学员、企业员工等程序设计能力、算法设计能力、问题求解能力、应用开发能力、系统运维能力等。”>
<meta name=”Description”
Content=”EduCoder翻转课堂教学模式颠覆了传统教学模式让教师与学生的关系由“权威”变成了“伙伴”。将学习的主动权转交给学生使学生可个性化化学学生的学习主体得到了彰显。”>
<meta name=”Description” Content=”EduCoder实训项目为单个知识点关卡实践训练帮助学生巩固单一弱点强化学习。 >
<meta name=”Description” Content=”EduCoder实践教学平台各类大赛为进一步提高各类学生综合运用高级语言程序设计能力培养创新意识和实践探索精神发掘优秀软件人才。 >
<meta name="theme-color" content="#000000">
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<script type="text/javascript">
window.__isR = true;
if (
(navigator.userAgent.indexOf('MSIE 9') != -1
|| navigator.userAgent.indexOf('MSIE 10') != -1)
@ -107,17 +35,9 @@
<link rel="stylesheet" type="text/css" href="/css/css_min_all.css">
<!--需要去build js配置-->
<link rel="stylesheet" type="text/css" href="/css/iconfont.css">
<link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/quill/1.3.7/quill.core.min.css">
<style>
/*<!--去除浏览器点击操作后有蓝色的底块-->*/
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
</style>
</head>
@ -144,94 +64,10 @@
document.write('<script type="text/javascript" src="https://newweb.educoder.net/javascripts/educoder/edu_application.js"><\/script>');
} else if (href.indexOf('/paths/') != -1) {
document.write('<script type="text/javascript" src="https://newweb.educoder.net/javascripts/educoder/edu_application.js"><\/script>');
<link rel="stylesheet" type="text/css" href="/css/css_min_all.css">
<!--<link rel="stylesheet" type="text/css" href="/css/css_min_all.css">-->
<!--<link rel="stylesheet" type="text/css" href="//at.alicdn.com/t/font_653600_nm6lho7nxxq.css">-->
<!-- <link href="/react/build/css/iconfont.css" rel="stylesheet" type="text/css"> -->
<!--<link href="http://47.96.87.25:48080/stylesheets/educoder/edu-all.css" rel="stylesheet" type="text/css">-->
<!--<link href="https://pandao.github.io/editor.md/examples/css/style.css" rel="stylesheet" type="text/css">-->
<!--<link href="https://pandao.github.io/editor.md/css/editormd.preview.css" rel="stylesheet" type="text/css">-->
<!-- <link href="https://testeduplus2.educoder.net/stylesheets/css/edu-common.css" rel="stylesheet" type="text/css">
<link href="https://testeduplus2.educoder.net/stylesheets/educoder/edu-main.css" rel="stylesheet" type="text/css">
<link href="https://testeduplus2.educoder.net/stylesheets/educoder/antd.min.css" rel="stylesheet" type="text/css"> -->
<!-- <link rel="stylesheet" type="text/css" href="https://www.educoder.net/stylesheets/css/font-awesome.css?1510652321"> -->
<!--<link rel="stylesheet" type="text/css" href="http://47.96.87.25:48080/stylesheets/educoder/iconfont/iconfont.css">-->
<!--需要去build js配置-->
<link rel="stylesheet" type="text/css" href="/css/iconfont.css">
<link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/quill/1.3.7/quill.core.min.css">
<style>
/*<!--去除浏览器点击操作后有蓝色的底块-->*/
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
</style>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<!--用于markdown转html -->
<div id="md_div" style="display: none;"></div>
<div id="root" class="page -layout-v -fit widthunit">
<!--<div class="d2-home">-->
<!--<div class="d2-home__main">-->
<!--&lt;!&ndash;<img class="d2-home__loading"&ndash;&gt;-->
<!--&lt;!&ndash;src="loading-spin.svg"&ndash;&gt;-->
<!--&lt;!&ndash;alt="loading">&ndash;&gt;-->
<!--<div class="lds-ripple"><div></div><div></div></div>-->
<!--<div class="d2-home__title">-->
<!--正在加载资源-->
<!--</div>-->
<!--<div class="d2-home__sub-title">-->
<!--加载资源可能需要较多时间 请耐心等待-->
<!--</div>-->
<!--</div>-->
<!--<div class="d2-home__footer">-->
<!--&lt;!&ndash;<a href="www.educoder.net"&ndash;&gt;-->
<!--&lt;!&ndash;target="_blank">&ndash;&gt;-->
<!--&lt;!&ndash;&ndash;&gt;-->
<!--&lt;!&ndash;</a>&ndash;&gt;-->
<!--EduCoder-->
<!--</div>-->
<!--</div>-->
</div>
<div id="picture_display" style="display: none;"></div>
<!-- js css合并 文件优先级的问题 -->
<script type="text/javascript" src="/js/js_min_all.js"></script>
<script type="text/javascript" src="/js/flv.min.js"></script>
<!-- 在tpi js里加载这3个脚本 -->
<script>
(function () { // Scoping function to avoid globals
var href = location.href;
if (window.location.port === "3007") {
if (href.indexOf('/tasks/') != -1) {
document.write('<script type="text/javascript" src="https://newweb.educoder.net/assets/kindeditor/kindeditor.js"><\/script>');
// build.js中会将这个url附加一个前缀 react/build
document.write('<script type="text/javascript" src="/js/create_kindeditor.js"><\/script>');
document.write('<script type="text/javascript" src="https://newweb.educoder.net/javascripts/educoder/edu_application.js"><\/script>');
} else if (href.indexOf('/paths/') != -1) {
document.write('<script type="text/javascript" src="https://newweb.educoder.net/javascripts/educoder/edu_application.js"><\/script>');
}
} else {
if (href.indexOf('/tasks/') != -1) {
document.write('<script type="text/javascript" src="/assets/kindeditor/kindeditor.js"><\/script>');
// build.js中会将这个url附加一个前缀 react/build
document.write('<script type="text/javascript" src="/js/create_kindeditor.js"><\/script>');
document.write('<script type="text/javascript" src="/javascripts/educoder/edu_application.js"><\/script>');
} else if (href.indexOf('/paths/') != -1) {
@ -239,21 +75,9 @@
}
}
</body>
})();
</script>
<!-- <script type="text/javascript" src="https://testeduplus2.educoder.net/assets/kindeditor/kindeditor.js"></script>
<script type="text/javascript" src="/js/create_kindeditor.js"></script>
<script type="text/javascript" src="https://testeduplus2.educoder.net/javascripts/educoder/edu_application.js"></script> -->
<script type="text/javascript" src="https://cdn.bootcss.com/quill/1.3.7/quill.core.min.js"></script>
<!-- <script>-->
<!-- document.body.addEventListener('touchmove', function (e) {-->
<!-- e.preventDefault(); //阻止默认的处理方式(阻止下拉滑动的效果)-->
<!-- }, {passive: false});-->
<!-- </script>-->
</body>
</html>

@ -1,5 +1,6 @@
import React, { Component } from 'react';
import './public-path';
import zhCN from 'antd/lib/locale-provider/zh_CN';
import { ConfigProvider } from 'antd'
import {
BrowserRouter as Router,
@ -407,13 +408,10 @@ class App extends Component {
};
render() {
let { mygetHelmetapi } = this.state;
// console.log("appappapp");
// console.log(mygetHelmetapi);
return (
<Provider store={store}>
<ConfigProvider locale={zhCN}>
<MuiThemeProvider theme={theme}>
<Accountnewprofile {...this.props}{...this.state} />
<LoginDialog {...this.props} {...this.state} Modifyloginvalue={() => this.Modifyloginvalue()}></LoginDialog>
<Notcompletedysl {...this.props} {...this.state}></Notcompletedysl>
@ -706,7 +704,7 @@ class App extends Component {
</Switch>
</Router>
</MuiThemeProvider>
</ConfigProvider>
</Provider >

@ -2,6 +2,7 @@ body {
margin: 0;
padding: 0;
font-family: sans-serif;
user-select: none;
}
.page--header {

@ -1,10 +1,8 @@
import "../css/Signinstatistics.css"
import React from 'react'
import { Modal , Form, Input, Radio,DatePicker,Select,Button} from 'antd';
import { Modal , Form, Input, Radio,DatePicker,Select,Button,TimePicker} from 'antd';
import moment from 'moment';
import axios from 'axios';
import TimePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";
function range(start, end) {
const result = [];
for (let i = start; i < end; i++) {

@ -1,9 +1,7 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import { Modal,Icon} from 'antd';
import axios from 'axios';
import { Modal} from 'antd';
import './../questioncss/questioncom.css'
import './../../../common/components/comment/index.scss';
import './../../../common/components/comment/index.less';
//立即申请试用
class QuestionModalPicture extends Component {

@ -1,15 +1,15 @@
import React, { Component } from 'react';
import { Route, Link, Switch } from "react-router-dom";
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import { Row, Col, Menu, } from 'antd';
import { Row, Col ,Menu,Popover,Button} from 'antd';
import Loading from '../../Loading';
import TPMIndexHOC from './TPMIndexHOC';
import TPMIndexHOC from './TPMIndexHOC';
import { SnackbarHOC, Loadable } from 'educoder';
import { SnackbarHOC,Loadable } from 'educoder';
import TPMBanner from './TPMBanner';
@ -32,52 +32,104 @@ import TPMDataset from './TPMDataset';
import '../page/tpiPage.css';
//任务
// const TPMChallengeComponent = Loadable({
// loader: () => import('./TPMChallengeContainer'),
// loading: Loading,
// })
//背景知识
// const TPMPropaedeuticsComponent = Loadable({
// loader: () => import('./TPMPropaedeuticsComponent'),
// loading: Loading,
// })
//版本库
// const TPMRepositoryComponent = Loadable({
// loader: () => import('./TPMRepositoryComponent'),
// loading: Loading,
// })
// const TPMRepositoryComponent = Loadable({
// loader: () => import('./TPMRepositoryComponent'),
// loading: Loading,
// })
//合作
// const TPMCollaboratorsComponent = Loadable({
// loader: () => import('./TPMCollaboratorsContainer'),
// loading: Loading,
// })
//评论
// const TPMShixunDiscussComponent = Loadable({
// loader: () => import('./TPMShixunDiscussContainer'),
// loading: Loading,
// })
//排行版
// const TPMRanking_listComponent = Loadable({
// loader: () => import('./TPMRanking_listContainer'),
// loading: Loading,
// })
// //编辑实训
// const TPMModifysettings = Loadable({
// loader: () =>import('./modules/tpm/TPMsettings/TPMsettings'),
// loading: Loading,
// })
//新建实训
const TPMchallengesnew = Loadable({
loader: () => import('./challengesnew/TPMchallengesnew'),
loading: Loading,
loader: () => import('./challengesnew/TPMchallengesnew'),
loading: Loading,
})
//新建实训
// const TPMchallengesnew = Loadable({
// loader: () => import('./challengesnew/TpmTask/TpmTaskIndex'),
// loading: Loading,
// })
//新建tab2
const TPMevaluation = Loadable({
loader: () => import('./challengesnew/TPMevaluation'),
loading: Loading,
loader: () => import('./challengesnew/TPMevaluation'),
loading: Loading,
})
//新建tab3答案
// const TPManswer = Loadable({
// loader: () => import('./challengesnew/TPManswer'),
// loading: Loading,
// })
const TPManswer = Loadable({
loader: () => import('./challengesnew/TPManswer2'),
loading: Loading,
loader: () => import('./challengesnew/TPManswer2'),
loading: Loading,
})
//选择题
const TPMquestion = Loadable({
loader: () => import('./challengesnew/TPMquestion'),
loading: Loading,
loader: () => import('./challengesnew/TPMquestion'),
loading: Loading,
})
//fork列表
const TPMFork_listComponent = Loadable({
loader: () => import('./TPMFork/TPMForklist'),
loading: Loading,
loader: () => import('./TPMFork/TPMForklist'),
loading: Loading,
})
//背景知识修改
const TPMUpdatepropaede = Loadable({
loader: () => import('./TPMUpdatepropaede/TPMUpdatepropaede'),
loading: Loading,
loader: () => import('./TPMUpdatepropaede/TPMUpdatepropaede'),
loading: Loading,
})
// 版本库添加文件
const AddFile = Loadable({
loader: () => import('./shixunchild/Repository/RepositoryAddFile'),
loading: Loading,
})
// 版本库上传文件
const Uploadfile = Loadable({
loader: () => import('./shixunchild/Repository/RepositoryAddFileupload_file'),
loading: Loading,
loader: () => import('./shixunchild/Repository/RepositoryAddFile'),
loading: Loading,
})
// 版本库上传文件
const Uploadfile= Loadable({
@ -85,6 +137,8 @@ const Uploadfile= Loadable({
loading: Loading,
})
const interceptorUrlArray = ['repository.json', 'commits.json', 'propaedeutics.json'
, 'challenges.json', 'discusses.json', 'ranking_list.json', 'collaborators.json']
const cacheInterceptorUrlMap = {}
class TPMIndex extends Component {
constructor(props) {
@ -106,35 +160,34 @@ class TPMIndex extends Component {
newathArray:[]
}
}
}
openknow = () => {
let storage = window.localStorage;
this.setState({
openknows: false
})
let newTPMsettings = this.props.user && this.props.user.user_id + 'newTPMsettings'
storage.setItem(newTPMsettings, false);
}
openknow=()=>{
let storage=window.localStorage;
this.setState({
openknows:false
})
let newTPMsettings=this.props.user&&this.props.user.user_id+'newTPMsettings'
storage.setItem(newTPMsettings,false);
}
componentDidUpdate(prevProps, prevState) {
if (prevProps != this.props) {
if (this.props.user && this.props.user.user_id) {
let getnewTPMsettings = this.props.user && this.props.user.user_id + 'newTPMsettings';
let newTPMsettings = window.localStorage.getItem(getnewTPMsettings)
if (newTPMsettings === undefined || newTPMsettings === false || newTPMsettings === null) {
this.setState({
openknows: false
})
} else {
this.setState({
openknows: false
})
if (prevProps!=this.props) {
if(this.props.user&&this.props.user.user_id){
let getnewTPMsettings=this.props.user&&this.props.user.user_id+'newTPMsettings';
let newTPMsettings=window.localStorage.getItem(getnewTPMsettings)
if(newTPMsettings===undefined||newTPMsettings===false||newTPMsettings===null){
this.setState({
openknows:false
})
}else{
this.setState({
openknows:false
})
}
}
}
}
}
getcomponentdidmount=()=>{
@ -203,20 +256,19 @@ class TPMIndex extends Component {
}
}
}
}
let newstar_infos = response.data.score_info;
}).catch((error) => {
this.setState({
shixunsDetails: response.data,
shixunId: id,
star_info: newstar_info,
star_infos: newstar_infos,
power: response.data.power,
identity: response.data.identity,
propaedeutics: response.data.propaedeutics,
status: response.data.shixun_status,
secret_repository: response.data.secret_repository,
public: response.data.public,
is_jupyter: response.data.is_jupyter === undefined || response.data.is_jupyter === null ? false : response.data.is_jupyter,
shixunsDetails: undefined,
shixunId: undefined,
star_info: undefined,
star_infos: undefined,
power: undefined,
identity: undefined,
status: undefined,
propaedeutics:undefined,
is_jupyter:false,
});
});
@ -238,84 +290,88 @@ class TPMIndex extends Component {
// return Promise.reject(error);
// });
// Add a response interceptor
this.tpmContentResponseInterceptor = axios.interceptors.response.use((response) => {
let url = response.config.url.split('api')[1];
url = url.split('?')[0]
if (cacheInterceptorUrlMap[url]) {
this.setState({ loadingContent: false })
delete cacheInterceptorUrlMap[response.url]
}
return response;
}, function (error) {
// Do something with response error
return Promise.reject(error);
});
//右侧数据
let shixunsDetailsURL = `/shixuns/` + id + `/show_right.json`;
axios.get(shixunsDetailsURL).then((response) => {
if (response.data) {
// Add a response interceptor
this.tpmContentResponseInterceptor = axios.interceptors.response.use((response) => {
// console.log('loadingContent finished, url:', response.config.url)
// TODO 依赖了api这个前缀
let url = response.config.url.split('api')[1];
url = url.split('?')[0]
if (cacheInterceptorUrlMap[url]) {
}
this.setState({
TPMRightSectionData: response.data
this.setState({ loadingContent: false })
delete cacheInterceptorUrlMap[response.url]
}
return response;
}, function (error) {
// Do something with response error
return Promise.reject(error);
});
})
this.getnavdatas()
}
componentDidMount = () => {
this.getcomponentdidmount()
//右侧数据
let shixunsDetailsURL=`/shixuns/`+id+`/show_right.json`;
axios.get(shixunsDetailsURL).then((response)=> {
if(response.data){
}
}
this.setState({
TPMRightSectionData: response.data
});
})
this.getnavdatas()
}
componentDidMount = () => {
this.getcomponentdidmount()
componentWillUnmount = () => {
axios.interceptors.request.eject(this.tpmContentRequestInterceptor);
this.tpmContentRequestInterceptor = null;
// this.getnavdatas()
}
}
setLoadingContent = (isLoadingContent) => {
// this.setState({ loadingContent: isLoadingContent })
}
componentWillUnmount = () => {
axios.interceptors.request.eject(this.tpmContentRequestInterceptor);
this.tpmContentRequestInterceptor = null;
axios.interceptors.request.eject(this.tpmContentResponseInterceptor);
this.tpmContentResponseInterceptor = null;
// this.getnavdatas()
}
setLoadingContent = (isLoadingContent) => {
// this.setState({ loadingContent: isLoadingContent })
}
getnavdatas = () => {
let selectedKeys;
const { location } = this.props;
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"
getnavdatas=()=>{
let selectedKeys;
const {location} = this.props;
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"
}
this.setState({
selectedKeys:selectedKeys
})
}
this.setState({
selectedKeys: selectedKeys
})
}
handleClick = (e) => {
handleClick=(e)=>{
this.setState({
selectedKeys: e.key,
});
let id = this.props.match.params.shixunId;
if (e.key === "1") {
if(e.key==="1"){
this.props.history.replace(`/shixuns/${id}/challenges`);
} else if (e.key === "2") {
}else if(e.key==="2"){
this.props.history.replace(`/shixuns/${id}/propaedeutics`);
}else if(e.key==="3"){
// window.location.href=`/shixuns/${id}/repository`;
@ -325,13 +381,13 @@ class TPMIndex extends Component {
this.props.history.push(`/shixuns/${id}/secret_repository`);
}else if(e.key==="5"){
this.props.history.replace(`/shixuns/${id}/collaborators`);
} else if (e.key === "6") {
}else if(e.key==="6"){
this.props.history.replace(`/shixuns/${id}/dataset`);
} else if (e.key === "7") {
}else if(e.key==="7"){
this.props.history.replace(`/shixuns/${id}/shixun_discuss`);
} else if (e.key === "8") {
}else if(e.key==="8"){
this.props.history.replace(`/shixuns/${id}/ranking_list`);
} else if (e.key === "9") {
}else if(e.key==="9"){
this.props.history.replace(`/shixuns/${id}/settings`);
}
}
@ -360,9 +416,9 @@ class TPMIndex extends Component {
}
<style>
{
`
<style>
{
`
.ant-menu-item{
margin:0 40px 0 0;
padding:0px;
@ -371,56 +427,75 @@ class TPMIndex extends Component {
z-index:1000 !important;
}
`
}
</style>
<Row type="flex" className={"backgroudwhite"}>
<div className={"educontent clearfix"}>
<Col span={24}>
<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.identity > 4 || this.state.identity === undefined ? "" : 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>
}
</style>
<Row type="flex" className={"backgroudwhite"}>
<div className={"educontent clearfix"}>
<Col span={24}>
<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.identity >4||this.state.identity===undefined ? "":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 ? "":this.state.openknows===true?<span>*/}
{/* <Popover*/}
{/* content={*/}
{/* <pre className={"bannerpd201"}>*/}
{/* <div>更多设置在这里,点击“配置”看一看~</div>*/}
{/* <div className={"wechatcenter mt15"}><Button type="primary" onClick={this.openknow} >我知道了</Button></div>*/}
{/* </pre>*/}
{/* }*/}
{/* trigger="click"*/}
{/* placement="top"*/}
{/* visible={this.state.openknows}*/}
{/* >*/}
{/* </Popover>*/}
{/*</span>:""}*/}
{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>
</div>
</Row>
@ -598,4 +673,4 @@ class TPMIndex extends Component {
}
}
export default SnackbarHOC()(TPMIndexHOC(TPMIndex));
export default SnackbarHOC() (TPMIndexHOC ( TPMIndex ));

Loading…
Cancel
Save