开启调战

chromesetting
杨树明 5 years ago
parent a2ab39335f
commit 2563ab1401

@ -52,7 +52,7 @@ export function initAxiosInterceptors(props) {
//proxy="http://47.96.87.25:48080" //proxy="http://47.96.87.25:48080"
proxy="https://pre-newweb.educoder.net" proxy="https://pre-newweb.educoder.net"
proxy="https://test-newweb.educoder.net" proxy="https://test-newweb.educoder.net"
//proxy="http://192.168.2.63:3001" proxy="https://test-jupyterweb.educoder.net"
// 在这里使用requestMap控制避免用户通过双击等操作发出重复的请求 // 在这里使用requestMap控制避免用户通过双击等操作发出重复的请求
// 如果需要支持重复的请求考虑config里面自定义一个allowRepeat参考来控制 // 如果需要支持重复的请求考虑config里面自定义一个allowRepeat参考来控制

@ -1,16 +1,16 @@
import React, { Component } from 'react'; import React, {Component} from 'react';
import { Redirect } from 'react-router'; import {Redirect} from 'react-router';
import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom";
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Rating ,Progress} from "@icedesign/base"; import {Rating, Progress} from "@icedesign/base";
import {Modal,Input,Radio,Pagination,message,Spin,Icon,Tooltip,Rate} from 'antd'; import {Modal, Input, Radio, Pagination, message, Spin, Icon, Tooltip, Rate} from 'antd';
import AccountProfile from"../user/AccountProfile"; import AccountProfile from "../user/AccountProfile";
import 'antd/lib/pagination/style/index.css'; import 'antd/lib/pagination/style/index.css';
@ -29,34 +29,34 @@ const RadioGroup = Radio.Group;
class TPMBanner extends Component { class TPMBanner extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state={ this.state = {
Forkvisible: false, Forkvisible: false,
Senttothetype:false, Senttothetype: false,
Senttothevcalue:undefined, Senttothevcalue: undefined,
courses_count:1, courses_count: 1,
course_list:[], course_list: [],
pagenum:1, pagenum: 1,
publishbox:"", publishbox: "",
publishboxstatus:0, publishboxstatus: 0,
pages:1, pages: 1,
Issuevisible:false, Issuevisible: false,
evaluation_set_position:[], evaluation_set_position: [],
tag_position:[], tag_position: [],
Forkauthentication:false, Forkauthentication: false,
can_fork:undefined, can_fork: undefined,
certi_url:undefined, certi_url: undefined,
showradios:false, showradios: false,
startbtn:false, startbtn: false,
Searchvalue:"", Searchvalue: "",
startshixunCombattype:false, startshixunCombattype: false,
shixunsmessage:"", shixunsmessage: "",
shixunsreplace:false, shixunsreplace: false,
hidestartshixunsreplacevalue:"", hidestartshixunsreplacevalue: "",
isIE:false, isIE: false,
Forkvisibletype: false, Forkvisibletype: false,
isSpin:false, isSpin: false,
Senttothevcaluetype:false, Senttothevcaluetype: false,
jupyterbool:false, jupyterbool: false,
} }
} }
@ -70,46 +70,48 @@ class TPMBanner extends Component {
// }); // });
// } // }
IEVersion=()=>{ IEVersion = () => {
var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串 var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器 var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器
var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器 var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器
var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1; var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1;
if(isIE) { if (isIE) {
var reIE = new RegExp("MSIE (\\d+\\.\\d+);"); var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
reIE.test(userAgent); reIE.test(userAgent);
var fIEVersion = parseFloat(RegExp["$1"]); var fIEVersion = parseFloat(RegExp["$1"]);
if(fIEVersion == 7) { if (fIEVersion == 7) {
return 7; return 7;
} else if(fIEVersion == 8) { } else if (fIEVersion == 8) {
return 8; return 8;
} else if(fIEVersion == 9) { } else if (fIEVersion == 9) {
return 9; return 9;
} else if(fIEVersion == 10) { } else if (fIEVersion == 10) {
return 10; return 10;
} else { } else {
return 6;//IE版本<=7 return 6;//IE版本<=7
} }
} else if(isEdge) { } else if (isEdge) {
return 'edge';//edge return 'edge';//edge
} else if(isIE11) { } else if (isIE11) {
return 11; //IE11 return 11; //IE11
}else{ } else {
return -1;//不是ie浏览器 return -1;//不是ie浏览器
} }
} }
componentDidMount() { componentDidMount() {
let thiisie=this.IEVersion(); let thiisie = this.IEVersion();
if(thiisie!=-1){ if (thiisie != -1) {
this.setState({ this.setState({
isIE:true isIE: true
}) })
}else{ } else {
this.setState({ this.setState({
isIE:false isIE: false
}) })
} }
} }
/* /*
* Fork * Fork
* */ * */
@ -133,7 +135,7 @@ class TPMBanner extends Component {
hideForkvisible = () => { hideForkvisible = () => {
this.setState({ this.setState({
Forkvisible: false, Forkvisible: false,
Forkauthentication:false Forkauthentication: false
}) })
} }
@ -144,9 +146,9 @@ class TPMBanner extends Component {
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
let url = "/shixuns/" + id + "/copy.json"; let url = "/shixuns/" + id + "/copy.json";
axios.post(url).then((response) => { axios.post(url).then((response) => {
if(response.data.status===401){ if (response.data.status === 401) {
}else{ } else {
this.setState({ this.setState({
Forkvisible: false, Forkvisible: false,
Forkauthentication: false, Forkauthentication: false,
@ -163,8 +165,8 @@ class TPMBanner extends Component {
/* /*
* 发送至按钮 * 发送至按钮
* */ * */
Senttothe=()=>{ Senttothe = () => {
if(this.props.checkIfLogin()===false){ if (this.props.checkIfLogin() === false) {
this.props.showLoginDialog() this.props.showLoginDialog()
return return
} }
@ -183,61 +185,64 @@ class TPMBanner extends Component {
// return // return
// } // }
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
let url="/shixuns/" + id +"/search_user_courses.json"; let url = "/shixuns/" + id + "/search_user_courses.json";
this.setState({ this.setState({
Senttothetype:true Senttothetype: true
}) })
axios.get(url, { axios.get(url, {
params: { params: {
page:1, page: 1,
limit:10 limit: 10
}}).then((response) => { }
}).then((response) => {
this.setState({ this.setState({
courses_count:response.data.courses_count, courses_count: response.data.courses_count,
course_list:response.data.course_list course_list: response.data.course_list
}) })
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });
} }
SenttotheSearch=(value)=>{ SenttotheSearch = (value) => {
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
let url="/shixuns/" + id +"/search_user_courses.json?search="+value; let url = "/shixuns/" + id + "/search_user_courses.json?search=" + value;
axios.get(encodeURI(url), { axios.get(encodeURI(url), {
params: { params: {
page:1, page: 1,
limit:10 limit: 10
}}).then((response) => { }
}).then((response) => {
this.setState({ this.setState({
courses_count:response.data.courses_count, courses_count: response.data.courses_count,
course_list:response.data.course_list, course_list: response.data.course_list,
pages:1, pages: 1,
Searchvalue:value Searchvalue: value
}) })
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });
} }
onChangeSenttothevcalue=(e)=>{ onChangeSenttothevcalue = (e) => {
this.setState({ this.setState({
Senttothevcalue:e.target.value Senttothevcalue: e.target.value
}) })
} }
onChangesendeSenttothe=(pageNumber)=>{ onChangesendeSenttothe = (pageNumber) => {
let{Searchvalue}=this.state; let {Searchvalue} = this.state;
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
let url="/shixuns/" + id +"/search_user_courses.json?search="+Searchvalue; let url = "/shixuns/" + id + "/search_user_courses.json?search=" + Searchvalue;
axios.get(url, { axios.get(url, {
params: { params: {
page:pageNumber, page: pageNumber,
limit:10 limit: 10
}}).then((response) => { }
}).then((response) => {
this.setState({ this.setState({
courses_count:response.data.courses_count, courses_count: response.data.courses_count,
course_list:response.data.course_list, course_list: response.data.course_list,
pagenum: pageNumber, pagenum: pageNumber,
pages: pageNumber pages: pageNumber
}) })
@ -245,27 +250,27 @@ class TPMBanner extends Component {
console.log(error) console.log(error)
}); });
} }
sendeSenttothevcalue=()=>{ sendeSenttothevcalue = () => {
let {Senttothevcalue}=this.state; let {Senttothevcalue} = this.state;
if(Senttothevcalue===undefined){ if (Senttothevcalue === undefined) {
this.setState({ this.setState({
Senttothevcaluetype:true Senttothevcaluetype: true
}) })
return return
} }
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
let url="/shixuns/" + id +"/send_to_course.json"; let url = "/shixuns/" + id + "/send_to_course.json";
axios.post(url,{ axios.post(url, {
course_id:Senttothevcalue course_id: Senttothevcalue
}).then((response) => { }).then((response) => {
this.props.showSnackbar(response.data.message); this.props.showSnackbar(response.data.message);
this.setState({ this.setState({
Senttothetype:false, Senttothetype: false,
Searchvalue:"", Searchvalue: "",
pages:1 pages: 1
}) })
// window.location.href = response.data.url; // window.location.href = response.data.url;
// response.data.course_id // response.data.course_id
@ -277,11 +282,11 @@ class TPMBanner extends Component {
} }
hideSenttothevcalue=()=>{ hideSenttothevcalue = () => {
this.setState({ this.setState({
Senttothetype:false, Senttothetype: false,
Searchvalue:"", Searchvalue: "",
pages:1 pages: 1
}) })
@ -291,14 +296,14 @@ class TPMBanner extends Component {
* 撤销发布按钮 * 撤销发布按钮
* */ * */
ModalCancel=()=>{ ModalCancel = () => {
this.setState({ this.setState({
Modalstype:false Modalstype: false
}) })
} }
ModalSave=()=>{ ModalSave = () => {
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
let url="/shixuns/" + id +"/cancel_publish.json"; let url = "/shixuns/" + id + "/cancel_publish.json";
axios.get(url).then((response) => { axios.get(url).then((response) => {
this.props.showSnackbar(response.data.message); this.props.showSnackbar(response.data.message);
window.location.reload() window.location.reload()
@ -306,12 +311,12 @@ class TPMBanner extends Component {
console.log(error) console.log(error)
}); });
} }
cancel_publish=()=>{ cancel_publish = () => {
this.setState({ this.setState({
Modalstype:true, Modalstype: true,
Modalstopval:"是否确认撤销发布?", Modalstopval: "是否确认撤销发布?",
ModalCancel:this.ModalCancel, ModalCancel: this.ModalCancel,
ModalSave:this.ModalSave, ModalSave: this.ModalSave,
}) })
} }
@ -319,32 +324,32 @@ class TPMBanner extends Component {
/* /*
* 申请发布按钮 * 申请发布按钮
* */ * */
applyrelease=()=>{ applyrelease = () => {
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
let url="/shixuns/" + id +"/publish.json"; let url = "/shixuns/" + id + "/publish.json";
axios.get(url).then((response) => { axios.get(url).then((response) => {
let evaluation_set_position let evaluation_set_position
if(response.data.evaluation_set_position===null){ if (response.data.evaluation_set_position === null) {
evaluation_set_position=[] evaluation_set_position = []
}else{ } else {
evaluation_set_position=response.data.evaluation_set_position evaluation_set_position = response.data.evaluation_set_position
} }
this.setState({ this.setState({
Issuevisible:true, Issuevisible: true,
tag_position:response.data.tag_position, tag_position: response.data.tag_position,
evaluation_set_position:evaluation_set_position, evaluation_set_position: evaluation_set_position,
publishboxstatus:response.data.status, publishboxstatus: response.data.status,
}) })
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });
}; };
hiddenIssuevisible=(val)=>{ hiddenIssuevisible = (val) => {
this.setState({ this.setState({
Issuevisible:false Issuevisible: false
}) })
if(val===0||val===1){ if (val === 0 || val === 1) {
window.location.reload() window.location.reload()
} }
@ -362,29 +367,30 @@ class TPMBanner extends Component {
// } // }
// reset_my_game // reset_my_game
hidestartshixunsreplace=(url)=>{ hidestartshixunsreplace = (url) => {
this.setState({ this.setState({
isSpin:true, isSpin: true,
}) })
axios.get(url).then((response) => { axios.get(url).then((response) => {
if(response.status===200){ if (response.status === 200) {
// let path="/shixuns/"+response.data.shixun_identifier+"/challenges"; // let path="/shixuns/"+response.data.shixun_identifier+"/challenges";
// this.props.history.push(path); // this.props.history.push(path);
message.success('重置成功,正在进入实训!'); message.success('重置成功,正在进入实训!');
this.startshixunCombat(response.data.shixun_identifier, 1); this.startshixunCombat(response.data.shixun_identifier, 1);
this.setState({ this.setState({
shixunsreplace:false, shixunsreplace: false,
isSpin:false, isSpin: false,
}) })
// message.success('重置成功,正在进入实训!'); // message.success('重置成功,正在进入实训!');
// this.startshixunCombat(); // this.startshixunCombat();
}} }
}
).catch((error) => { ).catch((error) => {
this.setState({ this.setState({
startbtn:false, startbtn: false,
shixunsreplace:false, shixunsreplace: false,
isSpin:false isSpin: false
}) })
}); });
@ -392,16 +398,17 @@ class TPMBanner extends Component {
//开始实战按钮 //开始实战按钮
startshixunCombat=(id, reset)=>{ startshixunCombat = (id, reset) => {
if(this.props.checkIfLogin()===false){ if(this.props.shixunsDetails&&this.props.shixunsDetails.is_jupyter===true){
if (this.props.checkIfLogin() === false) {
this.props.showLoginDialog() this.props.showLoginDialog()
return return
} }
if(this.props.checkIfProfileCompleted()===false){ if (this.props.checkIfProfileCompleted() === false) {
this.setState({ this.setState({
AccountProfiletype:true AccountProfiletype: true
}) })
return return
} }
@ -414,97 +421,172 @@ class TPMBanner extends Component {
// } // }
let {shixunsDetails} = this.props let {shixunsDetails} = this.props
if( shixunsDetails.shixun_status>1){ if (shixunsDetails.shixun_status > 1) {
this.setState({ this.setState({
startbtn:true, startbtn: true,
hidestartshixunsreplacevalue:"" hidestartshixunsreplacevalue: ""
}) })
}else{ } else {
this.setState({ this.setState({
hidestartshixunsreplacevalue:"" hidestartshixunsreplacevalue: ""
}) })
} }
let url="/shixuns/"+id+"/shixun_exec.json" ; let url = "/shixuns/" + id + "/jupyter_exec.json";
if (reset) { if (reset) {
url += '?reset=' + reset url += '?reset=' + reset
} }
axios.get(url).then((response) => { axios.get(url).then((response) => {
if(response.status===200){ if (response.status === 200) {
if(response.data.status===-2){ if (response.data.status === -2) {
// this.resetshixunCombat(response.data.message); // this.resetshixunCombat(response.data.message);
this.setState({ this.setState({
startbtn:false, startbtn: false,
shixunsreplace:true, shixunsreplace: true,
hidestartshixunsreplacevalue:response.data.message+".json" hidestartshixunsreplacevalue: response.data.message + ".json"
}) })
// this.shixunexec(response.data.message+".json") // this.shixunexec(response.data.message+".json")
}else if(response.data.status===-1){ } else if (response.data.status === -1) {
console.log(response) console.log(response)
}else if(response.data.status===-3){ } else if (response.data.status === -3) {
this.setState({ this.setState({
shixunsmessage:response.data.message, shixunsmessage: response.data.message,
startshixunCombattype:true, startshixunCombattype: true,
startbtn:false startbtn: false
}) })
} else {
// let path="/tasks/"+response.data.game_identifier;
// this.props.history.push(path);
// this.context.router.history.push(path);
if (response.data.status != 401) {
window.location.href = "/tasks/" + response.data.identifier+`/jupyter`;
}
}
}
}).catch((error) => {
this.setState({
startbtn: false
})
});
}else{ }else{
if (this.props.checkIfLogin() === false) {
this.props.showLoginDialog()
return
}
if (this.props.checkIfProfileCompleted() === false) {
this.setState({
AccountProfiletype: true
})
return
}
// if(this.props.checkIfProfessionalCertification()===false){
// this.setState({
// AccountProfiletype:true
// })
// return
// }
let {shixunsDetails} = this.props
if (shixunsDetails.shixun_status > 1) {
this.setState({
startbtn: true,
hidestartshixunsreplacevalue: ""
})
} else {
this.setState({
hidestartshixunsreplacevalue: ""
})
}
let url = "/shixuns/" + id + "/shixun_exec.json";
if (reset) {
url += '?reset=' + reset
}
axios.get(url).then((response) => {
if (response.status === 200) {
if (response.data.status === -2) {
// this.resetshixunCombat(response.data.message);
this.setState({
startbtn: false,
shixunsreplace: true,
hidestartshixunsreplacevalue: response.data.message + ".json"
})
// this.shixunexec(response.data.message+".json")
} else if (response.data.status === -1) {
console.log(response)
} else if (response.data.status === -3) {
this.setState({
shixunsmessage: response.data.message,
startshixunCombattype: true,
startbtn: false
})
} else {
// let path="/tasks/"+response.data.game_identifier; // let path="/tasks/"+response.data.game_identifier;
// this.props.history.push(path); // this.props.history.push(path);
// this.context.router.history.push(path); // this.context.router.history.push(path);
if(response.data.status!=401){ if (response.data.status != 401) {
window.location.href = "/tasks/"+response.data.game_identifier; window.location.href = "/tasks/" + response.data.game_identifier;
} }
} }
} }
}).catch((error) => { }).catch((error) => {
this.setState({ this.setState({
startbtn:false startbtn: false
}) })
}); });
} }
tocertification=()=>{
let{certi_url}=this.state; }
tocertification = () => {
let {certi_url} = this.state;
this.setState({ this.setState({
Forkauthentication:false Forkauthentication: false
}) })
window.location.href=certi_url; window.location.href = certi_url;
} }
SenttotheValue=(e)=>{ SenttotheValue = (e) => {
this.setState({ this.setState({
Searchvalue:e.target.value Searchvalue: e.target.value
}) })
} }
hidestartshixunCombattype=()=>{ hidestartshixunCombattype = () => {
this.setState({ this.setState({
startshixunCombattype:false startshixunCombattype: false
}) })
} }
hideAccountProfile=()=>{ hideAccountProfile = () => {
this.setState({ this.setState({
AccountProfiletype:false AccountProfiletype: false
}) })
} }
showonMouseOver=()=>{ showonMouseOver = () => {
$("#ratePanel").show(); $("#ratePanel").show();
this.setState({ this.setState({
showradios:true showradios: true
}) })
} }
hideonMouseOut=()=>{ hideonMouseOut = () => {
$("#ratePanel").hide(); $("#ratePanel").hide();
this.setState({ this.setState({
showradios:false showradios: false
}) })
} }
@ -532,7 +614,8 @@ class TPMBanner extends Component {
hidestartshixunsreplacevalue, hidestartshixunsreplacevalue,
Forkvisibletype, Forkvisibletype,
AccountProfiletype, AccountProfiletype,
isIE} = this.state; isIE
} = this.state;
let {shixunsDetails, shixunId, star_info, star_infos} = this.props; let {shixunsDetails, shixunId, star_info, star_infos} = this.props;
let challengeBtnTipText = ''; let challengeBtnTipText = '';
let challengeBtnText = '模拟实战'; let challengeBtnText = '模拟实战';
@ -545,14 +628,14 @@ class TPMBanner extends Component {
// challengeBtnTipText = '开始学习并完成实战任务' // challengeBtnTipText = '开始学习并完成实战任务'
// //
// } // }
if(shixunsDetails!=undefined){ if (shixunsDetails != undefined) {
if (shixunsDetails.shixun_status === 0 ) { if (shixunsDetails.shixun_status === 0) {
challengeBtnText = '继续实战' challengeBtnText = '继续实战'
} else if (shixunsDetails.shixun_status === 1) { } else if (shixunsDetails.shixun_status === 1) {
challengeBtnText = '查看实战' challengeBtnText = '查看实战'
} else if (shixunsDetails.shixun_status === 3) { } else if (shixunsDetails.shixun_status === 3) {
challengeBtnText = '继续实战' challengeBtnText = '继续实战'
}else{ } else {
challengeBtnText = "开始实战" challengeBtnText = "开始实战"
} }
} }
@ -584,37 +667,40 @@ class TPMBanner extends Component {
lineHeight: '30px', lineHeight: '30px',
}; };
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />; const antIcon = <Icon type="loading" style={{fontSize: 24}} spin/>;
const MyRate = ({ defaultValue, ...rest }) => { const MyRate = ({defaultValue, ...rest}) => {
let myValue = defaultValue; let myValue = defaultValue;
// console.log(myValue-Math.floor(myValue)) // console.log(myValue-Math.floor(myValue))
// if (myValue < Math.ceil(myValue)) { // if (myValue < Math.ceil(myValue)) {
// myValue = Math.floor(myValue) + 0.5; // myValue = Math.floor(myValue) + 0.5;
// } // }
return <Rating {...rest} value={myValue} />; return <Rating {...rest} value={myValue}/>;
}; };
console.log(this.props.shixunsDetails&&this.props.shixunsDetails.is_jupyter)
return ( return (
shixunsDetails===undefined?"": shixunsDetails === undefined ? "" :
<div className="shixunDetail"> <div className="shixunDetail">
<div className="shixunDetail_top"> <div className="shixunDetail_top">
{AccountProfiletype===true?<AccountProfile {AccountProfiletype === true ? <AccountProfile
hideAccountProfile={()=>this.hideAccountProfile()} hideAccountProfile={() => this.hideAccountProfile()}
{...this.props} {...this.props}
{...this.state} {...this.state}
/>:""} /> : ""}
{this.state.Modalstype===true?<Modals {this.state.Modalstype === true ? <Modals
modalsType={this.state.Modalstype} modalsType={this.state.Modalstype}
modalsTopval={this.state.Modalstopval} modalsTopval={this.state.Modalstopval}
modalCancel={this.state.ModalCancel} modalCancel={this.state.ModalCancel}
modalSave={this.state.ModalSave} modalSave={this.state.ModalSave}
modalsBottomval={this.state.ModalsBottomval} modalsBottomval={this.state.ModalsBottomval}
loadtype={this.state.Loadtype} loadtype={this.state.Loadtype}
/>:""} /> : ""}
<div className="educontent clearfix"> <div className="educontent clearfix">
<p className="clearfix"> <p className="clearfix">
@ -647,7 +733,7 @@ class TPMBanner extends Component {
{/*`*/} {/*`*/}
{/*}*/} {/*}*/}
{/*</style>*/} {/*</style>*/}
<ul className="fl color-grey-c pathInfo" > <ul className="fl color-grey-c pathInfo">
<li> <li>
<span>学习人数</span> <span>学习人数</span>
<span className="mt10">{shixunsDetails.stu_num}</span> <span className="mt10">{shixunsDetails.stu_num}</span>
@ -663,12 +749,14 @@ class TPMBanner extends Component {
</li> </li>
</ul> </ul>
<div className="pr fl" id="commentsStar" onMouseOver={()=>this.showonMouseOver()} onMouseOut={()=>this.hideonMouseOut()}> <div className="pr fl" id="commentsStar" onMouseOver={() => this.showonMouseOver()}
<div className={"color-grey-c ml15"} style={{color: "#Fff",textAlign: "center"}}>学员评分</div> onMouseOut={() => this.hideonMouseOut()}>
<div className={"color-grey-c ml15"} style={{color: "#Fff", textAlign: "center"}}>学员评分</div>
<div className="rateYo"> <div className="rateYo">
<MyRate allowHalf defaultValue={star_info[0]} disabled/> <MyRate allowHalf defaultValue={star_info[0]} disabled/>
</div> </div>
<div id="ratePanel" className="showratePanel" style={{"width":"530px"}} onMouseOut={()=>this.hideonMouseOut()}> <div id="ratePanel" className="showratePanel" style={{"width": "530px"}}
onMouseOut={() => this.hideonMouseOut()}>
<div className="pr"> <div className="pr">
<span className="rateTrangle"></span> <span className="rateTrangle"></span>
<div className="pr clearfix ratePanelContent" style={{height: '177px'}}> <div className="pr clearfix ratePanelContent" style={{height: '177px'}}>
@ -744,7 +832,7 @@ class TPMBanner extends Component {
shixunsDetails.task_operation[0] === "查看实战" ? "查看我的实战光辉历史" : shixunsDetails.task_operation[0] === "查看实战" ? "查看我的实战光辉历史" :
shixunsDetails.task_operation[0] === "模拟实战" ? "模拟完成实战任务" : shixunsDetails.task_operation[0] === "开启挑战" ? "开始学习并完成实战任务" : "" shixunsDetails.task_operation[0] === "模拟实战" ? "模拟完成实战任务" : shixunsDetails.task_operation[0] === "开启挑战" ? "开始学习并完成实战任务" : ""
}> }>
<a onClick={()=>this.startshixunCombat(this.props.match.params.shixunId)} <a onClick={() => this.startshixunCombat(this.props.match.params.shixunId)}
className="fr user_default_btn task-btn-orange font-18" className="fr user_default_btn task-btn-orange font-18"
id="shixun_operation" data-remote="true" id="shixun_operation" data-remote="true"
> >
@ -844,7 +932,7 @@ class TPMBanner extends Component {
evaluation_set_position.map((item, key) => { evaluation_set_position.map((item, key) => {
return ( return (
<span key={key}>{item}<span <span key={key}>{item}<span
style={{display: key != evaluation_set_position.length-1 ? "inline-block" : 'none'}}>,</span></span> style={{display: key != evaluation_set_position.length - 1 ? "inline-block" : 'none'}}>,</span></span>
) )
}) })
} }
@ -859,7 +947,7 @@ class TPMBanner extends Component {
tag_position.map((item, key) => { tag_position.map((item, key) => {
return ( return (
<span key={key}>{item}<span <span key={key}>{item}<span
style={{display: key != tag_position.length-1 ? "inline-block" : 'none'}}>,</span></span> style={{display: key != tag_position.length - 1 ? "inline-block" : 'none'}}>,</span></span>
) )
}) })
} }
@ -888,7 +976,7 @@ class TPMBanner extends Component {
<a onClick={this.Senttothe} <a onClick={this.Senttothe}
className="fr user_default_btn user_blue_btn mr20 font-18" className="fr user_default_btn user_blue_btn mr20 font-18"
data-tip-down="" data-tip-down=""
style={{display: shixunsDetails.shixun_status === 0 || shixunsDetails.shixun_status === 3 ||shixunsDetails.shixun_status === 1 ||shixunsDetails.shixun_status === -1 ? "none" : "block"}} style={{display: shixunsDetails.shixun_status === 0 || shixunsDetails.shixun_status === 3 || shixunsDetails.shixun_status === 1 || shixunsDetails.shixun_status === -1 ? "none" : "block"}}
data-remote="true"> data-remote="true">
<Tooltip placement="bottom" title={"以实训作业的形式发送到我的课堂"}> <Tooltip placement="bottom" title={"以实训作业的形式发送到我的课堂"}>
发送至 发送至
@ -928,7 +1016,7 @@ class TPMBanner extends Component {
`} `}
</style> </style>
<div id="search_course_list" className={courses_count > 12?"cdefault ":"cdefault "}> <div id="search_course_list" className={courses_count > 12 ? "cdefault " : "cdefault "}>
<div className="clearfix mb20 edu-bg-light-blue edu-h270"> <div className="clearfix mb20 edu-bg-light-blue edu-h270">
<ul> <ul>
<RadioGroup onChange={this.onChangeSenttothevcalue} value={Senttothevcalue}> <RadioGroup onChange={this.onChangeSenttothevcalue} value={Senttothevcalue}>
@ -944,7 +1032,7 @@ class TPMBanner extends Component {
</ul> </ul>
</div> </div>
</div> </div>
{this.state.Senttothevcaluetype===true?<div className={"color-red"}>请选择你要发送的课堂</div>:""} {this.state.Senttothevcaluetype === true ? <div className={"color-red"}>请选择你要发送的课堂</div> : ""}
<div className="mt10 marginauto" style={{display: courses_count > 12 ? "block" : "none"}}> <div className="mt10 marginauto" style={{display: courses_count > 12 ? "block" : "none"}}>
<Pagination size="small" className="mb20" <Pagination size="small" className="mb20"
showQuickJumper defaultCurrent={1} current={pages} pageSize={12} showQuickJumper defaultCurrent={1} current={pages} pageSize={12}
@ -978,7 +1066,8 @@ class TPMBanner extends Component {
} }
{this.props.identity < 8&&shixunsDetails.shixun_status != -1 ?<div className="fr user_default_btn user_blue_btn mr20" {this.props.identity < 8 && shixunsDetails.shixun_status != -1 ?
<div className="fr user_default_btn user_blue_btn mr20"
style={{display: shixunsDetails.can_copy === false || shixunsDetails.can_copy === null ? "none" : "flex"}}> style={{display: shixunsDetails.can_copy === false || shixunsDetails.can_copy === null ? "none" : "flex"}}>
<Tooltip placement="bottom" title={"基于这个实训修改形成新的实训"}> <Tooltip placement="bottom" title={"基于这个实训修改形成新的实训"}>
<span className="flex1 edu-txt-center fl font-18" <span className="flex1 edu-txt-center fl font-18"
@ -996,12 +1085,12 @@ class TPMBanner extends Component {
closable={false} closable={false}
footer={null} footer={null}
> >
{Forkvisibletype===true? {Forkvisibletype === true ?
<Spin <Spin
tip="请等待正在复制中..." tip="请等待正在复制中..."
style={{marginLeft:'38%'}} style={{marginLeft: '38%'}}
> >
</Spin>: </Spin> :
<div> <div>
<div className="task-popup-content"><p <div className="task-popup-content"><p
className="task-popup-text-center font-16 pb20">复制将在后台执行平台将为你创建<br/>一个新的同名实训和内容请问是否继续</p> className="task-popup-text-center font-16 pb20">复制将在后台执行平台将为你创建<br/>一个新的同名实训和内容请问是否继续</p>
@ -1037,7 +1126,7 @@ class TPMBanner extends Component {
</Link> </Link>
} }
</div>:""} </div> : ""}
</div> </div>
@ -1045,9 +1134,10 @@ class TPMBanner extends Component {
</div> </div>
<div className="alert alert-orange mb15 mt15 clearfix" <div className="alert alert-orange mb15 mt15 clearfix"
style={{display:shixunsDetails.shixun_status === 1?"block":"none"}} style={{display: shixunsDetails.shixun_status === 1 ? "block" : "none"}}
>正在等待管理员的审核在审核通过前可以随时撤销发布</div> >正在等待管理员的审核在审核通过前可以随时撤销发布
</div> </div>
</div>
); );
} }

@ -64,6 +64,7 @@ class Shixuninformation extends Component {
choice_main_type:this.props.data.shixun.choice_main_type, choice_main_type:this.props.data.shixun.choice_main_type,
choice_small_type:this.props.data.shixun.choice_small_type, choice_small_type:this.props.data.shixun.choice_small_type,
choice_standard_scripts:this.props.data.shixun.choice_standard_scripts, choice_standard_scripts:this.props.data.shixun.choice_standard_scripts,
shixunmemoMDvalue:this.props.data.shixun.evaluate_script,
}) })
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
@ -316,7 +317,10 @@ class Shixuninformation extends Component {
let operateauthority=this.props.identity===1?true:this.props.identity<5&&this.props.data.shixun.status==0?true:false; let operateauthority=this.props.identity===1?true:this.props.identity<5&&this.props.data.shixun.status==0?true:false;
console.log(operateauthority) console.log(operateauthority)
const {getFieldDecorator} = this.props.form; const {getFieldDecorator} = this.props.form;
const {newshixunlist, languagewrite, systemenvironment, testcoderunmode, fileList, choice_standard_scripts, postapplyvisible, shixunmemoMDvalue} = this.state; const {languagewrite, systemenvironment, testcoderunmode, fileList, choice_standard_scripts, postapplyvisible, shixunmemoMDvalue} = this.state;
console.log("1222")
console.log(choice_standard_scripts)
const {shixun_service_configs}=this.props; const {shixun_service_configs}=this.props;
const uploadProps = { const uploadProps = {
width: 600, width: 600,
@ -478,6 +482,7 @@ class Shixuninformation extends Component {
})( })(
<div className=" fl pr mr20"> <div className=" fl pr mr20">
<Select placeholder="请选择小类别" <Select placeholder="请选择小类别"
mode="multiple"
onChange={this.selectright} onChange={this.selectright}
value={this.state.choice_small_type.length===0||this.state.choice_small_type[0]===""||this.state.choice_small_type===[]?undefined:this.state.choice_small_type} value={this.state.choice_small_type.length===0||this.state.choice_small_type[0]===""||this.state.choice_small_type===[]?undefined:this.state.choice_small_type}
style={{width: 180,height:30}} style={{width: 180,height:30}}

@ -99,7 +99,7 @@ export default class TPMsettings extends Component {
} }
</style> </style>
<Tabs tabBarExtraContent={ <Tabs tabBarExtraContent={
<div className={"mb20"}> <div className={"mb20 mr20"}>
<Button type="primary" ghost className={"Permanentban"}> <Button type="primary" ghost className={"Permanentban"}>
永久关闭 永久关闭
</Button> </Button>

@ -73,8 +73,8 @@ class Challengesjupyter extends Component {
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{
console.log("componentDidMountChallengesjupyter"); // console.log("componentDidMountChallengesjupyter");
console.log(response.data); // console.log(response.data);
if(response.data.status===0){ if(response.data.status===0){
this.setState({ this.setState({
jupyter_url:response.data.url, jupyter_url:response.data.url,

Loading…
Cancel
Save