Merge remote-tracking branch 'origin/master'

# Conflicts:
#	public/react/src/modules/courses/coursesPublic/Startshixuntask.js
#	public/react/src/modules/tpm/TPMBanner.js
dev_forum
杨树明 6 years ago
commit ce57c052a0

@ -4,6 +4,7 @@ import axios from 'axios';
import { requestProxy } from "./indexEduplus2RequestProxy"; import { requestProxy } from "./indexEduplus2RequestProxy";
import { broadcastChannelOnmessage } from 'educoder' import { broadcastChannelOnmessage } from 'educoder'
import { notification } from 'antd'; import { notification } from 'antd';
import './index.css'
broadcastChannelOnmessage('refreshPage', () => { broadcastChannelOnmessage('refreshPage', () => {
window.location.reload() window.location.reload()
}) })
@ -114,7 +115,9 @@ export function initAxiosInterceptors(props) {
notification.open({ notification.open({
message:"提示", message:"提示",
description: response.data.message || '服务器异常,请联系管理员。', description: response.data.message || '服务器异常,请联系管理员。',
style: {
zIndex: 99999999
},
}); });
// notification['error']({ // notification['error']({
// message:"提示", // message:"提示",

@ -34,3 +34,6 @@ body {
.anticon anticon-paper-clip{ .anticon anticon-paper-clip{
color: #29bd8b !important; color: #29bd8b !important;
} }
.notificationmystyle{
z-index: 99999999;
}

@ -1,17 +1,17 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import { WordsBtn } from 'educoder'; import { WordsBtn } from 'educoder';
import {Tooltip,message,Modal} from 'antd'; import {Tooltip,message,Modal,Spin} from 'antd';
import {Link} from 'react-router-dom'; import {Link} from 'react-router-dom';
import axios from 'axios'; import axios from 'axios';
import Modals from '../../modals/Modals'; import Modals from '../../modals/Modals';
class Startshixuntask extends Component{ class Startshixuntask extends Component{
constructor(props){ constructor(props){
super(props); super(props);
this.state = { this.state = {
startbtn:false startbtn:false,
isSpin:false,
} }
} }
@ -60,11 +60,15 @@ class Startshixuntask extends Component{
} }
hidestartshixunsreplace=(url)=>{ hidestartshixunsreplace=(url)=>{
this.setState({
isSpin:true
})
axios.get(url).then((response) => { axios.get(url).then((response) => {
if(response.status===200){ if(response.status===200){
this.setState({ this.setState({
shixunsreplace:false shixunsreplace:false,
isSpin:false,
}) })
message.success('重置成功,正在进入实训!'); message.success('重置成功,正在进入实训!');
let path="/shixuns/"+response.data.shixun_identifier+"/challenges"; let path="/shixuns/"+response.data.shixun_identifier+"/challenges";
@ -74,7 +78,8 @@ class Startshixuntask extends Component{
).catch((error) => { ).catch((error) => {
this.setState({ this.setState({
startbtn:false, startbtn:false,
shixunsreplace:false shixunsreplace:false,
isSpin:false,
}) })
}); });
@ -120,6 +125,7 @@ class Startshixuntask extends Component{
footer={null} footer={null}
keyboard={false} keyboard={false}
> >
<Spin size="large" spinning={isSpin}>
<div className="task-popup-content"> <div className="task-popup-content">
<p className="task-popup-text-center font-16 pb20">实训已经更新了正在为您重置!</p> <p className="task-popup-text-center font-16 pb20">实训已经更新了正在为您重置!</p>
</div> </div>
@ -127,6 +133,7 @@ class Startshixuntask extends Component{
<a className="task-btn task-btn-orange fr mr51" <a className="task-btn task-btn-orange fr mr51"
onClick={() => this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了</a> onClick={() => this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了</a>
</div> </div>
</Spin>
</Modal> </Modal>
<Modal <Modal
title="提示" title="提示"

@ -212,6 +212,7 @@ button.buttonHoverColor:hover a {
margin: 0 auto; margin: 0 auto;
} }
/* Dialog */ /* Dialog */
#alert-dialog-title>h2 { #alert-dialog-title>h2 {
text-align: center; text-align: center;

@ -331,21 +331,21 @@ class NewHeader extends Component {
} }
educoderlogin=()=>{ educoderlogin=()=>{
//退出账号 //退出账号
// this.setState({ this.setState({
// isRender:true isRender:true
// })
var url = `/accounts/logout.json`;
axios.get((url)).then((result) => {
if(result!==undefined){
// this.setState({
// isRender:true
// })
window.location.href = "/";
}
}).catch((error) => {
console.log(error);
}) })
// var url = `/accounts/logout.json`;
// axios.get((url)).then((result) => {
// if(result!==undefined){
// // this.setState({
// // isRender:true
// // })
// window.location.href = "/";
// }
// }).catch((error) => {
// console.log(error);
// })
} }
onKeywordSearch = () => { onKeywordSearch = () => {

@ -59,6 +59,7 @@ class TPMBanner extends Component {
hidestartshixunsreplacevalue:"", hidestartshixunsreplacevalue:"",
isIE:false, isIE:false,
Forkvisibletype: false, Forkvisibletype: false,
isSpin:false,
} }
} }
@ -322,12 +323,42 @@ class TPMBanner extends Component {
// } // }
hidestartshixunsreplace=(url)=>{ hidestartshixunsreplace=(url)=>{
this.setState({
isSpin:true,
})
axios.get(url).then((response) => {
if(response.status===200){
// let path="/shixuns/"+response.data.shixun_identifier+"/challenges";
// this.props.history.push(path);
this.setState({
shixunsreplace:false,
isSpin:false,
})
message.success('重置成功,正在进入实训!');
this.startshixunCombat();
}}
).catch((error) => {
this.setState({
startbtn:false,
shixunsreplace:false,
isSpin:false
})
});
}
shixunexec=(url)=>{
this.setState({
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);
this.setState({ this.setState({
shixunsreplace:false shixunsreplace:false,
isSpin:false,
}) })
message.success('重置成功,正在进入实训!'); message.success('重置成功,正在进入实训!');
this.startshixunCombat(); this.startshixunCombat();
@ -335,7 +366,8 @@ class TPMBanner extends Component {
).catch((error) => { ).catch((error) => {
this.setState({ this.setState({
startbtn:false, startbtn:false,
shixunsreplace:false shixunsreplace:false,
isSpin:false
}) })
}); });
@ -667,7 +699,7 @@ class TPMBanner extends Component {
</div> </div>
<div className="task-popup-submit clearfix"> <div className="task-popup-submit clearfix">
<a className="task-btn task-btn-orange fr mr51" <a className="task-btn task-btn-orange fr mr51"
onClick={() => this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了</a> onClick={() => this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了</a>
</div> </div>
</Modal> </Modal>

Loading…
Cancel
Save