From f5150efa7a1b3cd4bc3aba6345750b94d53378b4 Mon Sep 17 00:00:00 2001 From: ysl <904079904@qq.com> Date: Sat, 22 Jun 2019 18:54:03 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 5 +- public/react/src/index.css | 3 + .../courses/coursesPublic/Startshixuntask.js | 330 ++++---- public/react/src/modules/page/tpiPage.css | 751 +++++++++--------- public/react/src/modules/tpm/NewHeader.js | 28 +- 5 files changed, 565 insertions(+), 552 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index bd3bb68fa..aa99f16f5 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -4,6 +4,7 @@ import axios from 'axios'; import { requestProxy } from "./indexEduplus2RequestProxy"; import { broadcastChannelOnmessage } from 'educoder' import { notification } from 'antd'; +import './index.css' broadcastChannelOnmessage('refreshPage', () => { window.location.reload() }) @@ -114,7 +115,9 @@ export function initAxiosInterceptors(props) { notification.open({ message:"提示", description: response.data.message || '服务器异常,请联系管理员。', - + style: { + zIndex: 99999999 + }, }); // notification['error']({ // message:"提示", diff --git a/public/react/src/index.css b/public/react/src/index.css index 6249aa94a..5b7639ce3 100644 --- a/public/react/src/index.css +++ b/public/react/src/index.css @@ -33,4 +33,7 @@ body { } .anticon anticon-paper-clip{ color: #29bd8b !important; +} +.notificationmystyle{ + z-index: 99999999; } \ No newline at end of file diff --git a/public/react/src/modules/courses/coursesPublic/Startshixuntask.js b/public/react/src/modules/courses/coursesPublic/Startshixuntask.js index 064ec645a..3a7b7408c 100644 --- a/public/react/src/modules/courses/coursesPublic/Startshixuntask.js +++ b/public/react/src/modules/courses/coursesPublic/Startshixuntask.js @@ -1,163 +1,169 @@ -import React,{ Component } from "react"; -import { WordsBtn } from 'educoder'; -import {Tooltip,message,Modal} from 'antd'; -import {Link} from 'react-router-dom'; -import axios from 'axios'; -import Modals from '../../modals/Modals'; - - - -class Startshixuntask extends Component{ - constructor(props){ - super(props); - this.state = { - startbtn:false - } - - } - - componentDidMount() { - - } - - taskoperationId=(list)=>{ - this.setState({ - startbtn:true, - }) - let url= list+".json"; - axios.get(url).then((response) => { - - if(response.status===200){ - if(response.data.status===-2){ - - this.setState({ - startbtn:false, - shixunsreplace:true, - hidestartshixunsreplacevalue: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{ - - if(response.data.status!=401&&response.data.status!=403){ - window.location.href = "/tasks/"+response.data.game_identifier; - } - - } - } - }).catch((error) => { - this.setState({ - startbtn:false - }) - }); - - } - - hidestartshixunsreplace=(url)=>{ - axios.get(url).then((response) => { - if(response.status===200){ - - this.setState({ - shixunsreplace:false - }) - message.success('重置成功,正在进入实训!'); - let path="/shixuns/"+response.data.shixun_identifier+"/challenges"; - this.props.history.push(path); - - }} - ).catch((error) => { - this.setState({ - startbtn:false, - shixunsreplace:false - }) - }); - - } - - hidestartshixunCombattype=()=>{ - this.setState({ - startshixunCombattype:false - }) - } - - render(){ - let { - Modalstype, - Modalstopval, - Modalsbottomval, - cardsModalcancel, - cardsModalsavetype, - loadtype, - shixunsreplace, - hidestartshixunsreplacevalue, - startshixunCombattype, - shixunsmessage, - startbtn - } = this.state; - - return( - - - - - -
-

实训已经更新了,正在为您重置!

-
-
- this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了! -
- - -
-

本实训的开启时间:{shixunsmessage}
开启时间之前不能挑战 -

-
-
- {/*取消*/} - 知道啦 -
- {/*

*/} - {/*知道了*/} - {/*

*/} -
- - {this.props.isStudent? - - {this.props.data.task_operation&&this.props.data.task_operation?startbtn===false?this.taskoperationId( this.props.data.task_operation[1])}> - {this.props.data.task_operation[0]} - :"开启中":""} - :"" - } - - - ) - } -} +import React,{ Component } from "react"; +import { WordsBtn } from 'educoder'; +import {Tooltip,message,Modal,Spin} from 'antd'; +import {Link} from 'react-router-dom'; +import axios from 'axios'; +import Modals from '../../modals/Modals'; + + +class Startshixuntask extends Component{ + constructor(props){ + super(props); + this.state = { + startbtn:false, + isSpin:false, + } + + } + + componentDidMount() { + + } + + taskoperationId=(list)=>{ + this.setState({ + startbtn:true, + }) + let url= list+".json"; + axios.get(url).then((response) => { + + if(response.status===200){ + if(response.data.status===-2){ + + this.setState({ + startbtn:false, + shixunsreplace:true, + hidestartshixunsreplacevalue: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{ + + if(response.data.status!=401&&response.data.status!=403){ + window.location.href = "/tasks/"+response.data.game_identifier; + } + + } + } + }).catch((error) => { + this.setState({ + startbtn:false + }) + }); + + } + + hidestartshixunsreplace=(url)=>{ + this.setState({ + isSpin:true + }) + axios.get(url).then((response) => { + if(response.status===200){ + + this.setState({ + shixunsreplace:false, + isSpin:false, + }) + message.success('重置成功,正在进入实训!'); + let path="/shixuns/"+response.data.shixun_identifier+"/challenges"; + this.props.history.push(path); + + }} + ).catch((error) => { + this.setState({ + startbtn:false, + shixunsreplace:false + }) + }); + + } + + hidestartshixunCombattype=()=>{ + this.setState({ + startshixunCombattype:false + }) + } + + render(){ + let { + Modalstype, + Modalstopval, + Modalsbottomval, + cardsModalcancel, + cardsModalsavetype, + loadtype, + shixunsreplace, + hidestartshixunsreplacevalue, + startshixunCombattype, + shixunsmessage, + startbtn + } = this.state; + + return( + + + + + +
+

实训已经更新了,正在为您重置!

+
+
+ + + this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了! +
+ + +
+

本实训的开启时间:{shixunsmessage}
开启时间之前不能挑战 +

+
+
+ {/*取消*/} + 知道啦 +
+ {/*

*/} + {/*知道了*/} + {/*

*/} +
+ + {this.props.isStudent? + + {this.props.data.task_operation&&this.props.data.task_operation?startbtn===false?this.taskoperationId( this.props.data.task_operation[1])}> + {this.props.data.task_operation[0]} + :"开启中":""} + :"" + } + + + ) + } +} export default Startshixuntask; \ No newline at end of file diff --git a/public/react/src/modules/page/tpiPage.css b/public/react/src/modules/page/tpiPage.css index e803ca51f..34274907e 100644 --- a/public/react/src/modules/page/tpiPage.css +++ b/public/react/src/modules/page/tpiPage.css @@ -1,375 +1,376 @@ - -.page--header { - z-index: 1399 !important; -} - -/* 左右分隔条 */ -.b-label { - background: #111c24; -} -.b-label>.resize-helper { - height: 30px; - position: relative; - margin-top: -20px; - margin-left: -17px; - left: 50%; - top: 50%; - z-index: 50; -} -.b-label>.resize-helper button{ - width: 24px; - height: 24px; - min-height: 24px; - opacity: 0.7; -} -.b-label>.resize-helper button:hover { - opacity: 1; -} - -.b-label>.resize-helper button path { - color: #666666; - fill: currentColor; -} - -/* 所有i都加上动画 */ -#game_right_contents i { - transition: transform .3s ease; -} - - -/* */ -.h-center { - height: 3px; - background: rgb(17, 28, 36); - border-top: 1px solid rgb(25, 82, 123); -} - - -/* */ -/* codemirror初始化的时候高度没100% */ -#codetab_con_1 { - /*display: flex;*/ -} -.CodeMirror{ - /*height: -webkit-fill-available !important;*/ - line-height: 1.2; - - /*height: auto !important; - flex: 1 1 auto;*/ -} - -/* LeftView markdown */ -#game_show_content #tab_con_1 .editormd-preview, #game_show_content #tab_con_2 .editormd-preview - ,#game_show_content #tab_con_3 .editormd-preview - ,#game_show_content #tab_con_5 .editormd-preview { - width: 100% !important; - height: 100% !important; -} - -/* tab 样式覆盖 */ -#blacktab_nav { - background-color: #111C24; - border-bottom: 1px solid #222C34; -} -.blacktab_hover { - -} -.blacktab_hover a:after { - content: ''; - position: absolute; - left: 50%; - margin-left: -10px; - top: auto; - bottom: 0; - right: auto; - height: 2px; - width: 20px; - background-color: #29BD8B; -} - -button.buttonHoverColor:hover a { - color: #FF7500!important; -} - -/*--------------------------------------------------- Header Start */ -.leftNavDrawer { - z-index: 8000 !important; -} -.leftNavDrawer>div:nth-child(2) { - /*left:80px !important;*/ - z-index: 8000 !important; - top: 54px; - overflow: hidden; -} -.leftNavDrawer .MuiDrawer-paper-2 { - width: 500px; -} - -.leftNavDrawer .page--over { - left: 0px; - position: static; -} -.leftNavDrawer .col-width-3 { - position: static; - width: 400px; - border: none; -} - - -#myshixun_top { - display: flex; - height: 54px; -} -.headerLeft { - flex: 0 0 400px; -} - #user_grade a { - color: white; - } - .-header-right { - right: inherit; - margin-left: 24px; - display: inline-block; - top: 10px; - height: 32px; - padding: 3px 15px - } - .userInfo { - display: inline-block; - top: 4px; - position: relative; - margin-left: 10px; - } - .userInfo img { - border-radius: 18px; - vertical-align: bottom; - } - .userInfo .userInfoName { - margin-left: 12px; - color: #fff; - font-size: 16px; - } - #user_grade { - margin-top: -1px; - } -.headerCenter { - flex: 1 1 auto; - text-align: center; - flex-direction: column; -} - .headerCenter h2 { - max-width: none; - width: 100%; - font-size: 16px; - flex: 0 0 24px; - } - .headerCenter .timeRecord { - font-size: 13px; - color: #CCCCCC; - width: 100px; - margin: auto; - } -.headerRight { - flex: 0 0 400px; -} - .headerRight a { - color: #1A3F5F; - font-size: 16px; - } - .headerRight .exitBtn { - color: #1a3f5f !important; - } - .headerRight a:hover { - color: #4CACFF !important; - } - .headerRight i { - font-size: 24px !important; - margin-right: 8px; - margin-top: 12px; - vertical-align: -4px; - } - - -/*--------------------------------------------------- Header End */ -/* picture_display 样式,language_display处理*/ -.photo_display { - padding-top: 54px; - padding-left: 0px; -} -.with33{ width: 33%;} -.with49{ width: 49%;} -.mr1precent{margin-right: 1%;} -.mr03precent{margin-right: 0.3%;} -/*TPI输出TXT文件显示*/ -.output-txt{padding: 10px;box-shadow:1px 6px 24px rgba(17,28,36,0.2);min-height: 500px;width: 100%;box-sizing: border-box;outline: none;} - -/* -------------------------------------- m design 控件样式修改*/ -.rootSnackbar { - top: 60px !important; - z-index: 99999999 !important; -} -.rootSnackbar>div>div { - margin: 0 auto; -} - -/* Dialog */ -#alert-dialog-title>h2 { - text-align: center; -} - #alert-dialog-title { - border-bottom: 1px solid #eee; - margin-bottom: 18px; - } -body>div[role=dialog]>div[role=document]>div:nth-child(3) { - justify-content: center; -} -body>div[role=dialog]>div { - /* tpi dialog按钮改成平铺的大按钮 */ - /* padding-bottom: 10px; */ -} -/* tpi 窗口宽度*/ -body>div[role=dialog] div[role=document] { - min-width: 400px; -} -#alert-dialog-title + div { - text-align: center; -} - -body>div>div[role=tooltip] { - font-size: 12px; -} - -/* -------------------------------------- m design 控件样式修改 END*/ - -/*rc-tree样式*/ -.repoFilesDrawer .rc-tree li span.rc-tree-checkbox, .rc-tree li span.rc-tree-iconEle, .rc-tree li span.rc-tree-switcher { - background-image:url('../../images/component/rc-tree.png'); -} -.rc-tree li span.rc-tree-node-selected .rc-tree-iconEle { - background-image:url('../../images/component/selectFile.png'); - background-position: 0; - margin-bottom: 4px; -} -.repoFilesDrawer .rc-tree li span.rc-tree-icon_loading { - margin-right: 2px; - vertical-align: top; - background: url(data:image/gif;base64,R0lGODlhEAAQAKIGAMLY8YSx5HOm4Mjc88/g9Ofw+v///wAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQFCgAGACwAAAAAEAAQAAADMGi6RbUwGjKIXCAA016PgRBElAVlG/RdLOO0X9nK61W39qvqiwz5Ls/rRqrggsdkAgAh+QQFCgAGACwCAAAABwAFAAADD2hqELAmiFBIYY4MAutdCQAh+QQFCgAGACwGAAAABwAFAAADD1hU1kaDOKMYCGAGEeYFCQAh+QQFCgAGACwKAAIABQAHAAADEFhUZjSkKdZqBQG0IELDQAIAIfkEBQoABgAsCgAGAAUABwAAAxBoVlRKgyjmlAIBqCDCzUoCACH5BAUKAAYALAYACgAHAAUAAAMPaGpFtYYMAgJgLogA610JACH5BAUKAAYALAIACgAHAAUAAAMPCAHWFiI4o1ghZZJB5i0JACH5BAUKAAYALAAABgAFAAcAAAMQCAFmIaEp1motpDQySMNFAgA7) no-repeat scroll 0 0 transparent; -} - -/*去除选中的颜色*/ -.repoFilesDrawer .rc-tree-node-selected { - background-color: #4CACFF; - border: 1px solid #4CACFF; - opacity: 1; - height: 26px !important; -} -.repoFilesDrawer .rc-tree-node-selected span.rc-tree-title { - color: #fff; -} - -/* - - Name: Railscasts - Author: Ryan Bates (http://railscasts.com) - - CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) - Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) - -*/ - -.cm-s-railscasts.CodeMirror {background: #2b2b2b;color: #f4f1ed;line-height: 21px;} -.cm-s-railscasts div.CodeMirror-selected {background: #214283 !important;} -.cm-s-railscasts .CodeMirror-gutters {/*background: #2b2b2b; */border-right: 0px;} -.cm-s-railscasts .CodeMirror-linenumber {color: #5a647e;} -.cm-s-railscasts .CodeMirror-cursor {border-left: 1px solid #d4cfc9 !important;} - -.cm-s-railscasts span.cm-comment {color: #bc9458;} -.cm-s-railscasts span.cm-atom {color: #b6b3eb;} -.cm-s-railscasts span.cm-number {color: #b6b3eb;} - -.cm-s-railscasts span.cm-property, .cm-s-railscasts span.cm-attribute {color: #a5c261;} -.cm-s-railscasts span.cm-keyword {color: #da4939;} -.cm-s-railscasts span.cm-string {color: #ffc66d;} - -.cm-s-railscasts span.cm-variable {color: #a5c261;} -.cm-s-railscasts span.cm-variable-2 {color: #6d9cbe;} -.cm-s-railscasts span.cm-def {color: #cc7833;} -/*.cm-s-railscasts span.cm-error {background: #da4939; color: #d4cfc9;}*/ -.cm-s-railscasts span.cm-bracket {color: #f4f1ed;} -.cm-s-railscasts span.cm-tag {color: #da4939;} -.cm-s-railscasts span.cm-link {color: #b6b3eb;} - -.cm-s-railscasts .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} -.cm-s-railscasts .CodeMirror-activeline-background { background: #303040; } - - - - -/* evaluateView*/ - -.CodeMirror-lines{padding: 0px!important;} -.cm-s-blackboard.CodeMirror {background: #0C1021; color: #F8F8F8; } -.cm-s-blackboard div.CodeMirror-selected { background: #253B76; } -.cm-s-blackboard .CodeMirror-line::selection, .cm-s-blackboard .CodeMirror-line > span::selection, .cm-s-blackboard .CodeMirror-line > span > span::selection { background: rgba(37, 59, 118, .99); } -.cm-s-blackboard .CodeMirror-line::-moz-selection, .cm-s-blackboard .CodeMirror-line > span::-moz-selection, .cm-s-blackboard .CodeMirror-line > span > span::-moz-selection { background: rgba(37, 59, 118, .99); } -.cm-s-blackboard .CodeMirror-gutters { background: #585858; border-right: 0; } -.cm-s-blackboard .CodeMirror-guttermarker { color: #FBDE2D; } -.cm-s-blackboard .CodeMirror-guttermarker-subtle { color: #888; } -.cm-s-blackboard .CodeMirror-linenumber { color: #888;/*background: #585858;*/ } -.cm-s-blackboard .CodeMirror-cursor { border-left: 1px solid #A7A7A7; } - -.cm-s-blackboard .cm-keyword { color: #FBDE2D; } -.cm-s-blackboard .cm-atom { color: #D8FA3C; } -.cm-s-blackboard .cm-number { color: #D8FA3C; } -.cm-s-blackboard .cm-def { color: #8DA6CE; } -.cm-s-blackboard .cm-variable { color: #FF6400; } -.cm-s-blackboard .cm-operator { color: #FBDE2D; } -.cm-s-blackboard .cm-comment { color: #AEAEAE; } -.cm-s-blackboard .cm-string { color: #61CE3C; } -.cm-s-blackboard .cm-string-2 { color: #61CE3C; } -.cm-s-blackboard .cm-meta { color: #D8FA3C; } -.cm-s-blackboard .cm-builtin { color: #8DA6CE; } -.cm-s-blackboard .cm-tag { color: #8DA6CE; } -.cm-s-blackboard .cm-attribute { color: #8DA6CE; } -.cm-s-blackboard .cm-header { color: #FF6400; } -.cm-s-blackboard .cm-hr { color: #AEAEAE; } -.cm-s-blackboard .cm-link { color: #8DA6CE; } -.cm-s-blackboard .cm-error { background: #9D1E15; color: #F8F8F8; } - -.cm-s-blackboard .CodeMirror-activeline-background { background: #3C3636; } -.cm-s-blackboard .CodeMirror-matchingbracket { outline:1px solid grey;color:white !important; } - -.cm-s-railscasts span.cm-error { - color: #bc9458; -} - -/* 弹框 */ -.popupAll{width: 100%;height: 100%;position: fixed;z-index: 99998;background-color: rgba(5,16,26,0.6);left: 0;top:0;} -.task-popup{ width: 30%;background: #fff; border:1px solid #e8e8e8; border-radius:10px; -webkit-box-shadow:0 0 10px #ccc; -moz-box-shadow:0 0 10px #ccc; box-shadow:0 0 10px #ccc;} -.task-popup-text-center{ text-align: center; color: #333;} -.task-popup-title{ border-bottom: 1px solid #eee; padding:0px 15px;text-align: center;box-sizing: border-box;line-height: 70px;height: 70px; border-radius: 10px 10px 0px 0px;font-size: 16px; } -.task-popup-content{ padding:15px;} -/*注释这个地方是因为会影响到实训哪块合作者删除的样式*/ -/*.task-popup-submit{ margin:0px auto 15px; width: 120px;}*/ -.task-popup-sure{ margin:0px auto 15px; width: 54px;} -.task-popup-right-sure{margin:0px auto 15px;text-align: center} -.task-popup-OK{ margin:15px auto; text-align: center} -.task-popup-bggrey{ background:#fff; color:#333;} -a.task-btn-orange{background: #4CACFF; color:#fff!important;} -a:hover.task-btn-orange{background: #4CACFF; color:#fff!important;} - - -/* 代码区域样式 */ -#games_repository_contents .readRepoFailed { - color: #fff; - width: 100%; - text-align: center; - margin-top: 120px; -} - #games_repository_contents .readRepoFailed .retry { - color:#4CACFF; - } - - - - + +.page--header { + z-index: 1399 !important; +} + +/* 左右分隔条 */ +.b-label { + background: #111c24; +} +.b-label>.resize-helper { + height: 30px; + position: relative; + margin-top: -20px; + margin-left: -17px; + left: 50%; + top: 50%; + z-index: 50; +} +.b-label>.resize-helper button{ + width: 24px; + height: 24px; + min-height: 24px; + opacity: 0.7; +} +.b-label>.resize-helper button:hover { + opacity: 1; +} + +.b-label>.resize-helper button path { + color: #666666; + fill: currentColor; +} + +/* 所有i都加上动画 */ +#game_right_contents i { + transition: transform .3s ease; +} + + +/* */ +.h-center { + height: 3px; + background: rgb(17, 28, 36); + border-top: 1px solid rgb(25, 82, 123); +} + + +/* */ +/* codemirror初始化的时候高度没100% */ +#codetab_con_1 { + /*display: flex;*/ +} +.CodeMirror{ + /*height: -webkit-fill-available !important;*/ + line-height: 1.2; + + /*height: auto !important; + flex: 1 1 auto;*/ +} + +/* LeftView markdown */ +#game_show_content #tab_con_1 .editormd-preview, #game_show_content #tab_con_2 .editormd-preview + ,#game_show_content #tab_con_3 .editormd-preview + ,#game_show_content #tab_con_5 .editormd-preview { + width: 100% !important; + height: 100% !important; +} + +/* tab 样式覆盖 */ +#blacktab_nav { + background-color: #111C24; + border-bottom: 1px solid #222C34; +} +.blacktab_hover { + +} +.blacktab_hover a:after { + content: ''; + position: absolute; + left: 50%; + margin-left: -10px; + top: auto; + bottom: 0; + right: auto; + height: 2px; + width: 20px; + background-color: #29BD8B; +} + +button.buttonHoverColor:hover a { + color: #FF7500!important; +} + +/*--------------------------------------------------- Header Start */ +.leftNavDrawer { + z-index: 8000 !important; +} +.leftNavDrawer>div:nth-child(2) { + /*left:80px !important;*/ + z-index: 8000 !important; + top: 54px; + overflow: hidden; +} +.leftNavDrawer .MuiDrawer-paper-2 { + width: 500px; +} + +.leftNavDrawer .page--over { + left: 0px; + position: static; +} +.leftNavDrawer .col-width-3 { + position: static; + width: 400px; + border: none; +} + + +#myshixun_top { + display: flex; + height: 54px; +} +.headerLeft { + flex: 0 0 400px; +} + #user_grade a { + color: white; + } + .-header-right { + right: inherit; + margin-left: 24px; + display: inline-block; + top: 10px; + height: 32px; + padding: 3px 15px + } + .userInfo { + display: inline-block; + top: 4px; + position: relative; + margin-left: 10px; + } + .userInfo img { + border-radius: 18px; + vertical-align: bottom; + } + .userInfo .userInfoName { + margin-left: 12px; + color: #fff; + font-size: 16px; + } + #user_grade { + margin-top: -1px; + } +.headerCenter { + flex: 1 1 auto; + text-align: center; + flex-direction: column; +} + .headerCenter h2 { + max-width: none; + width: 100%; + font-size: 16px; + flex: 0 0 24px; + } + .headerCenter .timeRecord { + font-size: 13px; + color: #CCCCCC; + width: 100px; + margin: auto; + } +.headerRight { + flex: 0 0 400px; +} + .headerRight a { + color: #1A3F5F; + font-size: 16px; + } + .headerRight .exitBtn { + color: #1a3f5f !important; + } + .headerRight a:hover { + color: #4CACFF !important; + } + .headerRight i { + font-size: 24px !important; + margin-right: 8px; + margin-top: 12px; + vertical-align: -4px; + } + + +/*--------------------------------------------------- Header End */ +/* picture_display 样式,language_display处理*/ +.photo_display { + padding-top: 54px; + padding-left: 0px; +} +.with33{ width: 33%;} +.with49{ width: 49%;} +.mr1precent{margin-right: 1%;} +.mr03precent{margin-right: 0.3%;} +/*TPI输出TXT文件显示*/ +.output-txt{padding: 10px;box-shadow:1px 6px 24px rgba(17,28,36,0.2);min-height: 500px;width: 100%;box-sizing: border-box;outline: none;} + +/* -------------------------------------- m design 控件样式修改*/ +.rootSnackbar { + top: 60px !important; + z-index: 99999999 !important; +} +.rootSnackbar>div>div { + margin: 0 auto; +} + + +/* Dialog */ +#alert-dialog-title>h2 { + text-align: center; +} + #alert-dialog-title { + border-bottom: 1px solid #eee; + margin-bottom: 18px; + } +body>div[role=dialog]>div[role=document]>div:nth-child(3) { + justify-content: center; +} +body>div[role=dialog]>div { + /* tpi dialog按钮改成平铺的大按钮 */ + /* padding-bottom: 10px; */ +} +/* tpi 窗口宽度*/ +body>div[role=dialog] div[role=document] { + min-width: 400px; +} +#alert-dialog-title + div { + text-align: center; +} + +body>div>div[role=tooltip] { + font-size: 12px; +} + +/* -------------------------------------- m design 控件样式修改 END*/ + +/*rc-tree样式*/ +.repoFilesDrawer .rc-tree li span.rc-tree-checkbox, .rc-tree li span.rc-tree-iconEle, .rc-tree li span.rc-tree-switcher { + background-image:url('../../images/component/rc-tree.png'); +} +.rc-tree li span.rc-tree-node-selected .rc-tree-iconEle { + background-image:url('../../images/component/selectFile.png'); + background-position: 0; + margin-bottom: 4px; +} +.repoFilesDrawer .rc-tree li span.rc-tree-icon_loading { + margin-right: 2px; + vertical-align: top; + background: url(data:image/gif;base64,R0lGODlhEAAQAKIGAMLY8YSx5HOm4Mjc88/g9Ofw+v///wAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQFCgAGACwAAAAAEAAQAAADMGi6RbUwGjKIXCAA016PgRBElAVlG/RdLOO0X9nK61W39qvqiwz5Ls/rRqrggsdkAgAh+QQFCgAGACwCAAAABwAFAAADD2hqELAmiFBIYY4MAutdCQAh+QQFCgAGACwGAAAABwAFAAADD1hU1kaDOKMYCGAGEeYFCQAh+QQFCgAGACwKAAIABQAHAAADEFhUZjSkKdZqBQG0IELDQAIAIfkEBQoABgAsCgAGAAUABwAAAxBoVlRKgyjmlAIBqCDCzUoCACH5BAUKAAYALAYACgAHAAUAAAMPaGpFtYYMAgJgLogA610JACH5BAUKAAYALAIACgAHAAUAAAMPCAHWFiI4o1ghZZJB5i0JACH5BAUKAAYALAAABgAFAAcAAAMQCAFmIaEp1motpDQySMNFAgA7) no-repeat scroll 0 0 transparent; +} + +/*去除选中的颜色*/ +.repoFilesDrawer .rc-tree-node-selected { + background-color: #4CACFF; + border: 1px solid #4CACFF; + opacity: 1; + height: 26px !important; +} +.repoFilesDrawer .rc-tree-node-selected span.rc-tree-title { + color: #fff; +} + +/* + + Name: Railscasts + Author: Ryan Bates (http://railscasts.com) + + CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) + Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) + +*/ + +.cm-s-railscasts.CodeMirror {background: #2b2b2b;color: #f4f1ed;line-height: 21px;} +.cm-s-railscasts div.CodeMirror-selected {background: #214283 !important;} +.cm-s-railscasts .CodeMirror-gutters {/*background: #2b2b2b; */border-right: 0px;} +.cm-s-railscasts .CodeMirror-linenumber {color: #5a647e;} +.cm-s-railscasts .CodeMirror-cursor {border-left: 1px solid #d4cfc9 !important;} + +.cm-s-railscasts span.cm-comment {color: #bc9458;} +.cm-s-railscasts span.cm-atom {color: #b6b3eb;} +.cm-s-railscasts span.cm-number {color: #b6b3eb;} + +.cm-s-railscasts span.cm-property, .cm-s-railscasts span.cm-attribute {color: #a5c261;} +.cm-s-railscasts span.cm-keyword {color: #da4939;} +.cm-s-railscasts span.cm-string {color: #ffc66d;} + +.cm-s-railscasts span.cm-variable {color: #a5c261;} +.cm-s-railscasts span.cm-variable-2 {color: #6d9cbe;} +.cm-s-railscasts span.cm-def {color: #cc7833;} +/*.cm-s-railscasts span.cm-error {background: #da4939; color: #d4cfc9;}*/ +.cm-s-railscasts span.cm-bracket {color: #f4f1ed;} +.cm-s-railscasts span.cm-tag {color: #da4939;} +.cm-s-railscasts span.cm-link {color: #b6b3eb;} + +.cm-s-railscasts .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} +.cm-s-railscasts .CodeMirror-activeline-background { background: #303040; } + + + + +/* evaluateView*/ + +.CodeMirror-lines{padding: 0px!important;} +.cm-s-blackboard.CodeMirror {background: #0C1021; color: #F8F8F8; } +.cm-s-blackboard div.CodeMirror-selected { background: #253B76; } +.cm-s-blackboard .CodeMirror-line::selection, .cm-s-blackboard .CodeMirror-line > span::selection, .cm-s-blackboard .CodeMirror-line > span > span::selection { background: rgba(37, 59, 118, .99); } +.cm-s-blackboard .CodeMirror-line::-moz-selection, .cm-s-blackboard .CodeMirror-line > span::-moz-selection, .cm-s-blackboard .CodeMirror-line > span > span::-moz-selection { background: rgba(37, 59, 118, .99); } +.cm-s-blackboard .CodeMirror-gutters { background: #585858; border-right: 0; } +.cm-s-blackboard .CodeMirror-guttermarker { color: #FBDE2D; } +.cm-s-blackboard .CodeMirror-guttermarker-subtle { color: #888; } +.cm-s-blackboard .CodeMirror-linenumber { color: #888;/*background: #585858;*/ } +.cm-s-blackboard .CodeMirror-cursor { border-left: 1px solid #A7A7A7; } + +.cm-s-blackboard .cm-keyword { color: #FBDE2D; } +.cm-s-blackboard .cm-atom { color: #D8FA3C; } +.cm-s-blackboard .cm-number { color: #D8FA3C; } +.cm-s-blackboard .cm-def { color: #8DA6CE; } +.cm-s-blackboard .cm-variable { color: #FF6400; } +.cm-s-blackboard .cm-operator { color: #FBDE2D; } +.cm-s-blackboard .cm-comment { color: #AEAEAE; } +.cm-s-blackboard .cm-string { color: #61CE3C; } +.cm-s-blackboard .cm-string-2 { color: #61CE3C; } +.cm-s-blackboard .cm-meta { color: #D8FA3C; } +.cm-s-blackboard .cm-builtin { color: #8DA6CE; } +.cm-s-blackboard .cm-tag { color: #8DA6CE; } +.cm-s-blackboard .cm-attribute { color: #8DA6CE; } +.cm-s-blackboard .cm-header { color: #FF6400; } +.cm-s-blackboard .cm-hr { color: #AEAEAE; } +.cm-s-blackboard .cm-link { color: #8DA6CE; } +.cm-s-blackboard .cm-error { background: #9D1E15; color: #F8F8F8; } + +.cm-s-blackboard .CodeMirror-activeline-background { background: #3C3636; } +.cm-s-blackboard .CodeMirror-matchingbracket { outline:1px solid grey;color:white !important; } + +.cm-s-railscasts span.cm-error { + color: #bc9458; +} + +/* 弹框 */ +.popupAll{width: 100%;height: 100%;position: fixed;z-index: 99998;background-color: rgba(5,16,26,0.6);left: 0;top:0;} +.task-popup{ width: 30%;background: #fff; border:1px solid #e8e8e8; border-radius:10px; -webkit-box-shadow:0 0 10px #ccc; -moz-box-shadow:0 0 10px #ccc; box-shadow:0 0 10px #ccc;} +.task-popup-text-center{ text-align: center; color: #333;} +.task-popup-title{ border-bottom: 1px solid #eee; padding:0px 15px;text-align: center;box-sizing: border-box;line-height: 70px;height: 70px; border-radius: 10px 10px 0px 0px;font-size: 16px; } +.task-popup-content{ padding:15px;} +/*注释这个地方是因为会影响到实训哪块合作者删除的样式*/ +/*.task-popup-submit{ margin:0px auto 15px; width: 120px;}*/ +.task-popup-sure{ margin:0px auto 15px; width: 54px;} +.task-popup-right-sure{margin:0px auto 15px;text-align: center} +.task-popup-OK{ margin:15px auto; text-align: center} +.task-popup-bggrey{ background:#fff; color:#333;} +a.task-btn-orange{background: #4CACFF; color:#fff!important;} +a:hover.task-btn-orange{background: #4CACFF; color:#fff!important;} + + +/* 代码区域样式 */ +#games_repository_contents .readRepoFailed { + color: #fff; + width: 100%; + text-align: center; + margin-top: 120px; +} + #games_repository_contents .readRepoFailed .retry { + color:#4CACFF; + } + + + + diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index bdb6b2a09..5498866cd 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -331,21 +331,21 @@ class NewHeader extends Component { } educoderlogin=()=>{ //退出账号 - // this.setState({ - // 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); + this.setState({ + 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); + // }) } onKeywordSearch = () => { From 3ec184008bfd80654c54a07720b8d2442d107412 Mon Sep 17 00:00:00 2001 From: ysl <904079904@qq.com> Date: Sat, 22 Jun 2019 18:56:29 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesPublic/Startshixuntask.js | 4 +- public/react/src/modules/tpm/TPMBanner.js | 1842 +++++++++-------- 2 files changed, 927 insertions(+), 919 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/Startshixuntask.js b/public/react/src/modules/courses/coursesPublic/Startshixuntask.js index 3a7b7408c..b994e9005 100644 --- a/public/react/src/modules/courses/coursesPublic/Startshixuntask.js +++ b/public/react/src/modules/courses/coursesPublic/Startshixuntask.js @@ -124,15 +124,15 @@ class Startshixuntask extends Component{ footer={null} keyboard={false} > +

实训已经更新了,正在为您重置!

- - this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了!
+
{ - var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串 - var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器 - var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器 - var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1; - if(isIE) { - var reIE = new RegExp("MSIE (\\d+\\.\\d+);"); - reIE.test(userAgent); - var fIEVersion = parseFloat(RegExp["$1"]); - if(fIEVersion == 7) { - return 7; - } else if(fIEVersion == 8) { - return 8; - } else if(fIEVersion == 9) { - return 9; - } else if(fIEVersion == 10) { - return 10; - } else { - return 6;//IE版本<=7 - } - } else if(isEdge) { - return 'edge';//edge - } else if(isIE11) { - return 11; //IE11 - }else{ - return -1;//不是ie浏览器 - } - } - componentDidMount() { - let thiisie=this.IEVersion(); - if(thiisie!=-1){ - this.setState({ - isIE:true - }) - }else{ - this.setState({ - isIE:false - }) - } - } - /* - * Fork - * */ - copyForkvisible = () => { - let {shixunsDetails} = this.props; - if (shixunsDetails.can_fork === null) { - this.setState({ - Forkvisible: true - }) - } else { - this.setState({ - Forkvisible: false, - Forkauthentication: true, - can_fork: shixunsDetails.can_fork.can_fork, - certi_url: shixunsDetails.can_fork.certi_url, - }) - } - - } - - hideForkvisible = () => { - this.setState({ - Forkvisible: false, - Forkauthentication:false - }) - } - - addForkvisible = () => { - this.setState({ - Forkvisibletype: true, - }) - let id = this.props.match.params.shixunId; - let url = "/shixuns/" + id + "/copy.json"; - axios.post(url).then((response) => { - if(response.data.status===401){ - - }else{ - this.setState({ - Forkvisible: false, - Forkauthentication: false, - // Forkvisibletype:false - }) - window.location.href = "/shixuns/" + response.data.shixun + "/challenges"; - } - - }).catch((error) => { - console.log(error) - }); - - } - /* - * 发送至按钮 - * */ - Senttothe=()=>{ - let id = this.props.match.params.shixunId; - let url="/shixuns/" + id +"/search_user_courses.json"; - this.setState({ - Senttothetype:true - }) - - axios.get(url, { - params: { - page:1, - limit:10 - }}).then((response) => { - this.setState({ - courses_count:response.data.courses_count, - course_list:response.data.course_list - }) - }).catch((error) => { - console.log(error) - }); - } - - SenttotheSearch=(value)=>{ - let id = this.props.match.params.shixunId; - let url="/shixuns/" + id +"/search_user_courses.json?search="+value; - axios.get(url, { - params: { - page:1, - limit:10 - }}).then((response) => { - this.setState({ - courses_count:response.data.courses_count, - course_list:response.data.course_list, - pages:1, - Searchvalue:value - }) - }).catch((error) => { - console.log(error) - }); - } - - onChangeSenttothevcalue=(e)=>{ - this.setState({ - Senttothevcalue:e.target.value - }) - } - onChangesendeSenttothe=(pageNumber)=>{ - let{Searchvalue}=this.state; - let id = this.props.match.params.shixunId; - let url="/shixuns/" + id +"/search_user_courses.json?search="+Searchvalue; - axios.get(url, { - params: { - page:pageNumber, - limit:10 - }}).then((response) => { - this.setState({ - courses_count:response.data.courses_count, - course_list:response.data.course_list, - pagenum: pageNumber, - pages: pageNumber - }) - }).catch((error) => { - console.log(error) - }); - } - sendeSenttothevcalue=()=>{ - let {Senttothevcalue}=this.state; - let id = this.props.match.params.shixunId; - let url="/shixuns/" + id +"/send_to_course.json"; - axios.post(url,{ - course_id:Senttothevcalue - }).then((response) => { - this.props.showSnackbar(response.data.message); - this.setState({ - Senttothetype:false, - Searchvalue:"", - pages:1 - }) - window.location.href = response.data.url; - - }).catch((error) => { - console.log(error) - }); - - } - - hideSenttothevcalue=()=>{ - this.setState({ - Senttothetype:false, - Searchvalue:"", - pages:1 - }) - - - } - - /* - * 撤销发布按钮 - * */ - cancel_publish=()=>{ - - let id = this.props.match.params.shixunId; - let url="/shixuns/" + id +"/cancel_publish.json"; - axios.get(url).then((response) => { - this.props.showSnackbar(response.data.message); - window.location.reload() - }).catch((error) => { - console.log(error) - }); - } - - - /* - * 申请发布按钮 - * */ - applyrelease=()=>{ - let id = this.props.match.params.shixunId; - let url="/shixuns/" + id +"/publish.json"; - axios.get(url).then((response) => { - let evaluation_set_position - if(response.data.evaluation_set_position===null){ - evaluation_set_position=[] - }else{ - evaluation_set_position=response.data.evaluation_set_position - } - this.setState({ - Issuevisible:true, - tag_position:response.data.tag_position, - evaluation_set_position:evaluation_set_position, - publishboxstatus:response.data.status, - }) - }).catch((error) => { - console.log(error) - }); - }; - - hiddenIssuevisible=(val)=>{ - this.setState({ - Issuevisible:false - }) - if(val===0||val===1){ - window.location.reload() - } - - } - - //重置按钮 - // resetshixunCombat=(id)=>{ - // let zrl="/myshixuns/"+id+"/reset_my_game.json"; - // axios.get(zrl).then((response) => { - // window.location.href = "/shixuns/" + response.data.shixun_identifier + "/challenges"; - // message.success('重置成功'); - // }).catch((error) => { - // console.log(error) - // }); - // } - - hidestartshixunsreplace=(url)=>{ - 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 - }) - message.success('重置成功,正在进入实训!'); - this.startshixunCombat(); - }} - ).catch((error) => { - this.setState({ - startbtn:false, - shixunsreplace:false - }) - }); - - } - //开始实战按钮 - startshixunCombat=()=>{ - let {shixunsDetails} = this.props - if( shixunsDetails.status>1){ - this.setState({ - startbtn:true, - hidestartshixunsreplacevalue:"" - }) - }else{ - this.setState({ - hidestartshixunsreplacevalue:"" - }) - } - - - let id = this.props.match.params.shixunId; - let url="/shixuns/"+id+"/shixun_exec.json"; - 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" - }) - }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; - // this.props.history.push(path); - - - // this.context.router.history.push(path); - if(response.data.status!=401){ - window.location.href = "/tasks/"+response.data.game_identifier; - } - - } - } - }).catch((error) => { - this.setState({ - startbtn:false - }) - }); - } - - tocertification=()=>{ - let{certi_url}=this.state; - this.setState({ - Forkauthentication:false - }) - window.location.href=certi_url; - } - - SenttotheValue=(e)=>{ - this.setState({ - Searchvalue:e.target.value - }) - } - - hidestartshixunCombattype=()=>{ - this.setState({ - startshixunCombattype:false - }) - } - - - - render() { - let { - Forkvisible, - Senttothetype, - Senttothevcalue, - evaluation_set_position, - Forkauthentication, - can_fork, - certi_url, - tag_position, - courses_count, - course_list, - Issuevisible, - publishboxstatus, - showradios, - startbtn, - Searchvalue, - startshixunCombattype, - shixunsmessage, - pages, - shixunsreplace, - hidestartshixunsreplacevalue, - Forkvisibletype, - isIE} = this.state; - let {shixunsDetails, shixunId, star_info, star_infos} = this.props; - let challengeBtnTipText = ''; - let challengeBtnText = '模拟实战'; - // let star_info=[] - // if (shixunsDetails.status === 0) { - // - // } else if (shixunsDetails.status === 1) { - // - // } else if (shixunsDetails.status === 2) { - // challengeBtnTipText = '开始学习并完成实战任务' - // - // } - if(shixunsDetails!=undefined){ - if (shixunsDetails.status === 0 ) { - challengeBtnText = '继续实战' - } else if (shixunsDetails.status === 1) { - challengeBtnText = '查看实战' - } else if (shixunsDetails.status === 3) { - challengeBtnText = '继续实战' - }else{ - challengeBtnText = "开始实战" - } - } - - - // let list=shixunsDetails.task_operation; - // if(list!=undefined){ - // if (shixunsDetails.status === 0 ) { - // for(var i=0; i{ - $("#ratePanel").show(); - this.setState({ - showradios:true - }) - },()=>{ - $("#ratePanel").hide(); - this.setState({ - showradios:false - }) - }) - - const radioStyle = { - display: 'block', - height: '30px', - lineHeight: '30px', - }; - - - return ( - - shixunsDetails===undefined?"": -
-
- -
-

- {shixunsDetails.name} - { - shixunsDetails.fork_from === undefined || shixunsDetails.fork_from === null ? "" : - - - - } - -

-
-
    -
  • - 学习人数 - {shixunsDetails.stu_num} -
  • - {/*
  • */} - {/*经验值*/} - {/*{shixunsDetails.experience}*/} - {/*
  • */} -
  • - 难度系数 - {shixunsDetails.diffcult} - -
  • -
- -
- -
- -
-
-
- -
-
-
- {star_infos[0]}分 - 总评分 -
- {showradios === true ? - - : ""} -
-
-
-
-
-
- {showradios === true ? - - : ""} -
- - {star_infos[1]}% -
-
-
- {showradios === true ? - - : ""} -
- - {star_infos[2]}% -
-
-
- {showradios === true ? - - : ""} -
- - {star_infos[3]}% -
-
-
- {showradios === true ? - - : ""} -
- - {star_infos[4]}% -
-
-
- {showradios === true ? - - : ""} -
- - {star_infos[5]}% -
-
-
-
-
- -
- - { - startbtn === false ? - - - {shixunsDetails.task_operation === undefined ? "" : shixunsDetails.status > 1 ? shixunsDetails.task_operation[0] : "模拟实战"} - - - : "" - } - - -
-

本实训的开启时间:{shixunsmessage}
开启时间之前不能挑战 -

-
-
- {/*取消*/} - 知道啦 -
- {/*

*/} - {/*知道了*/} - {/*

*/} -
- - -
-

实训已经更新了,正在为您重置!

-
- -
- - - - - - { - startbtn === true ? - 开启中 : "" - } - - {/*{*/} - {/*shixunsDetails.status=== 3 && shixunsDetails.task_operation[0]==="开始实战"?*/} - {/*{shixunsDetails.task_operation===undefined?"":shixunsDetails.task_operation[0]}:""*/} - {/*}*/} - - {shixunsDetails.status === 0 && this.props.identity < 4 ? - 申请发布 : "" - } - - - { - publishboxstatus === 0 ?
-

- 发布申请已提交,请等待管理员的审核
-

-
: publishboxstatus === 1 ? -
-

- 发布申请已提交,请等待管理员的审核
- • 我们将在1-2个工作日内完成审核 -

-
: publishboxstatus === 2 ?
-

- 第 - { - evaluation_set_position.map((item, key) => { - return ( - {item}, - ) - }) - } - 关评测设置尚未完成,无法申请发布 -

-
: publishboxstatus === 3 ? -
-

- 每一个关卡至少需要一个技能标签
- 第 - { - tag_position.map((item, key) => { - return ( - {item}, - ) - }) - } - 关尚未设置技能标签,请补充 -

-
: -
-

- 尚未创建任务的实训,不能申请发布 -

-
- } - - -
- - {shixunsDetails.status === 1 && this.props.identity < 4 ? - 撤销发布 : "" - } - - { - - - 发送至 - - - } - - -
-
- -
- 选择的实训将会发送到指定课堂 -
- -
- this.SenttotheSearch(value)} - style={{width: '100%'}} - /> -
- -
12?"cdefault mb20":"cdefault mb50"}> -
-
    - - { - course_list === undefined ? "" : course_list.map((item, key) => { - return ( - {item.name} - ) - }) - } - -
-
-
- -
- 12 ? "block" : "none"}} - showQuickJumper defaultCurrent={1} current={pages} pageSize={12} - total={courses_count} onChange={this.onChangesendeSenttothe}/> - - 确定 - - 取消 -
- -
-
-
- - {shixunsDetails.status === 3 && - 已关闭 - } - -
- - - Fork - - - - - {Forkvisibletype===true? - - : -
-

复制将在后台执行
平台将为你创建一个新的同名实训和内容,请问是否继续?

-
-
- 取消 - 确定 -
-
- } - - -
- - -

{can_fork}
请问是否前往进行认证?

-
-
- - -
-
- {!!shixunsDetails.fork_num && - - {shixunsDetails.fork_num} - - } - -
- -
- -
- -
-
正在等待管理员的审核。在审核通过前,可以随时撤销发布
-
- - ); - } -} - -export default TPMBanner; - +import React, { Component } from 'react'; + +import { Redirect } from 'react-router'; + +import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; + +import PropTypes from 'prop-types'; + +import {Modal,Input,Radio,Pagination,message,Spin,Icon,Tooltip} from 'antd'; + +import 'antd/lib/pagination/style/index.css'; + +import axios from 'axios'; + +// import { Rating,Progress } from '@icedesign/base'; + +import Rating from '@icedesign/base/lib/rating'; + +import Progress from '@icedesign/base/lib/progress'; + +// 引入业务组件样式 +import '@icedesign/base/lib/rating/style.js'; + +import '@icedesign/base/lib/progress/style.js'; + +import './shixuns/css/TPMBanner.css'; + +let $ = window.$; + +const Search = Input.Search; + +const RadioGroup = Radio.Group; + +class TPMBanner extends Component { + constructor(props) { + super(props) + this.state={ + Forkvisible: false, + Senttothetype:false, + Senttothevcalue:1, + courses_count:1, + course_list:[], + pagenum:1, + publishbox:"", + publishboxstatus:0, + pages:1, + Issuevisible:false, + evaluation_set_position:[], + tag_position:[], + Forkauthentication:false, + can_fork:undefined, + certi_url:undefined, + showradios:false, + startbtn:false, + Searchvalue:"", + startshixunCombattype:false, + shixunsmessage:"", + shixunsreplace:false, + hidestartshixunsreplacevalue:"", + isIE:false, + Forkvisibletype: false, + isSpin:false, + } + } + + // star_info:[0, 0, 0, 0, 0, 0], + // star_infos:[0, 0, 0, 0, 0, 0], + // shixunsDetails:{}, + // shixunId: undefined, + // componentWillReceiveProps(newProps, newContext){ + // this.setState({ + // shixunsDetails: newProps.shixunsDetails + // }); + // } + + IEVersion=()=>{ + var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串 + var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器 + var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器 + var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1; + if(isIE) { + var reIE = new RegExp("MSIE (\\d+\\.\\d+);"); + reIE.test(userAgent); + var fIEVersion = parseFloat(RegExp["$1"]); + if(fIEVersion == 7) { + return 7; + } else if(fIEVersion == 8) { + return 8; + } else if(fIEVersion == 9) { + return 9; + } else if(fIEVersion == 10) { + return 10; + } else { + return 6;//IE版本<=7 + } + } else if(isEdge) { + return 'edge';//edge + } else if(isIE11) { + return 11; //IE11 + }else{ + return -1;//不是ie浏览器 + } + } + componentDidMount() { + let thiisie=this.IEVersion(); + if(thiisie!=-1){ + this.setState({ + isIE:true + }) + }else{ + this.setState({ + isIE:false + }) + } + } + /* + * Fork + * */ + copyForkvisible = () => { + let {shixunsDetails} = this.props; + if (shixunsDetails.can_fork === null) { + this.setState({ + Forkvisible: true + }) + } else { + this.setState({ + Forkvisible: false, + Forkauthentication: true, + can_fork: shixunsDetails.can_fork.can_fork, + certi_url: shixunsDetails.can_fork.certi_url, + }) + } + + } + + hideForkvisible = () => { + this.setState({ + Forkvisible: false, + Forkauthentication:false + }) + } + + addForkvisible = () => { + this.setState({ + Forkvisibletype: true, + }) + let id = this.props.match.params.shixunId; + let url = "/shixuns/" + id + "/copy.json"; + axios.post(url).then((response) => { + if(response.data.status===401){ + + }else{ + this.setState({ + Forkvisible: false, + Forkauthentication: false, + // Forkvisibletype:false + }) + window.location.href = "/shixuns/" + response.data.shixun + "/challenges"; + } + + }).catch((error) => { + console.log(error) + }); + + } + /* + * 发送至按钮 + * */ + Senttothe=()=>{ + let id = this.props.match.params.shixunId; + let url="/shixuns/" + id +"/search_user_courses.json"; + this.setState({ + Senttothetype:true + }) + + axios.get(url, { + params: { + page:1, + limit:10 + }}).then((response) => { + this.setState({ + courses_count:response.data.courses_count, + course_list:response.data.course_list + }) + }).catch((error) => { + console.log(error) + }); + } + + SenttotheSearch=(value)=>{ + let id = this.props.match.params.shixunId; + let url="/shixuns/" + id +"/search_user_courses.json?search="+value; + axios.get(url, { + params: { + page:1, + limit:10 + }}).then((response) => { + this.setState({ + courses_count:response.data.courses_count, + course_list:response.data.course_list, + pages:1, + Searchvalue:value + }) + }).catch((error) => { + console.log(error) + }); + } + + onChangeSenttothevcalue=(e)=>{ + this.setState({ + Senttothevcalue:e.target.value + }) + } + onChangesendeSenttothe=(pageNumber)=>{ + let{Searchvalue}=this.state; + let id = this.props.match.params.shixunId; + let url="/shixuns/" + id +"/search_user_courses.json?search="+Searchvalue; + axios.get(url, { + params: { + page:pageNumber, + limit:10 + }}).then((response) => { + this.setState({ + courses_count:response.data.courses_count, + course_list:response.data.course_list, + pagenum: pageNumber, + pages: pageNumber + }) + }).catch((error) => { + console.log(error) + }); + } + sendeSenttothevcalue=()=>{ + let {Senttothevcalue}=this.state; + let id = this.props.match.params.shixunId; + let url="/shixuns/" + id +"/send_to_course.json"; + axios.post(url,{ + course_id:Senttothevcalue + }).then((response) => { + this.props.showSnackbar(response.data.message); + this.setState({ + Senttothetype:false, + Searchvalue:"", + pages:1 + }) + window.location.href = response.data.url; + + }).catch((error) => { + console.log(error) + }); + + } + + hideSenttothevcalue=()=>{ + this.setState({ + Senttothetype:false, + Searchvalue:"", + pages:1 + }) + + + } + + /* + * 撤销发布按钮 + * */ + cancel_publish=()=>{ + + let id = this.props.match.params.shixunId; + let url="/shixuns/" + id +"/cancel_publish.json"; + axios.get(url).then((response) => { + this.props.showSnackbar(response.data.message); + window.location.reload() + }).catch((error) => { + console.log(error) + }); + } + + + /* + * 申请发布按钮 + * */ + applyrelease=()=>{ + let id = this.props.match.params.shixunId; + let url="/shixuns/" + id +"/publish.json"; + axios.get(url).then((response) => { + let evaluation_set_position + if(response.data.evaluation_set_position===null){ + evaluation_set_position=[] + }else{ + evaluation_set_position=response.data.evaluation_set_position + } + this.setState({ + Issuevisible:true, + tag_position:response.data.tag_position, + evaluation_set_position:evaluation_set_position, + publishboxstatus:response.data.status, + }) + }).catch((error) => { + console.log(error) + }); + }; + + hiddenIssuevisible=(val)=>{ + this.setState({ + Issuevisible:false + }) + if(val===0||val===1){ + window.location.reload() + } + + } + + //重置按钮 + // resetshixunCombat=(id)=>{ + // let zrl="/myshixuns/"+id+"/reset_my_game.json"; + // axios.get(zrl).then((response) => { + // window.location.href = "/shixuns/" + response.data.shixun_identifier + "/challenges"; + // message.success('重置成功'); + // }).catch((error) => { + // console.log(error) + // }); + // } + + 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 + }) + }); + + } + //开始实战按钮 + startshixunCombat=()=>{ + let {shixunsDetails} = this.props + if( shixunsDetails.status>1){ + this.setState({ + startbtn:true, + hidestartshixunsreplacevalue:"" + }) + }else{ + this.setState({ + hidestartshixunsreplacevalue:"" + }) + } + + + let id = this.props.match.params.shixunId; + let url="/shixuns/"+id+"/shixun_exec.json"; + 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" + }) + }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; + // this.props.history.push(path); + + + // this.context.router.history.push(path); + if(response.data.status!=401){ + window.location.href = "/tasks/"+response.data.game_identifier; + } + + } + } + }).catch((error) => { + this.setState({ + startbtn:false + }) + }); + } + + tocertification=()=>{ + let{certi_url}=this.state; + this.setState({ + Forkauthentication:false + }) + window.location.href=certi_url; + } + + SenttotheValue=(e)=>{ + this.setState({ + Searchvalue:e.target.value + }) + } + + hidestartshixunCombattype=()=>{ + this.setState({ + startshixunCombattype:false + }) + } + + + + render() { + let { + Forkvisible, + Senttothetype, + Senttothevcalue, + evaluation_set_position, + Forkauthentication, + can_fork, + certi_url, + tag_position, + courses_count, + course_list, + Issuevisible, + publishboxstatus, + showradios, + startbtn, + Searchvalue, + startshixunCombattype, + shixunsmessage, + pages, + shixunsreplace, + hidestartshixunsreplacevalue, + Forkvisibletype, + isIE} = this.state; + let {shixunsDetails, shixunId, star_info, star_infos} = this.props; + let challengeBtnTipText = ''; + let challengeBtnText = '模拟实战'; + // let star_info=[] + // if (shixunsDetails.status === 0) { + // + // } else if (shixunsDetails.status === 1) { + // + // } else if (shixunsDetails.status === 2) { + // challengeBtnTipText = '开始学习并完成实战任务' + // + // } + if(shixunsDetails!=undefined){ + if (shixunsDetails.status === 0 ) { + challengeBtnText = '继续实战' + } else if (shixunsDetails.status === 1) { + challengeBtnText = '查看实战' + } else if (shixunsDetails.status === 3) { + challengeBtnText = '继续实战' + }else{ + challengeBtnText = "开始实战" + } + } + + + // let list=shixunsDetails.task_operation; + // if(list!=undefined){ + // if (shixunsDetails.status === 0 ) { + // for(var i=0; i{ + $("#ratePanel").show(); + this.setState({ + showradios:true + }) + },()=>{ + $("#ratePanel").hide(); + this.setState({ + showradios:false + }) + }) + + const radioStyle = { + display: 'block', + height: '30px', + lineHeight: '30px', + }; + + + return ( + + shixunsDetails===undefined?"": +
+
+ +
+

+ {shixunsDetails.name} + { + shixunsDetails.fork_from === undefined || shixunsDetails.fork_from === null ? "" : + + + + } + +

+
+
    +
  • + 学习人数 + {shixunsDetails.stu_num} +
  • + {/*
  • */} + {/*经验值*/} + {/*{shixunsDetails.experience}*/} + {/*
  • */} +
  • + 难度系数 + {shixunsDetails.diffcult} + +
  • +
+ +
+ +
+ +
+
+
+ +
+
+
+ {star_infos[0]}分 + 总评分 +
+ {showradios === true ? + + : ""} +
+
+
+
+
+
+ {showradios === true ? + + : ""} +
+ + {star_infos[1]}% +
+
+
+ {showradios === true ? + + : ""} +
+ + {star_infos[2]}% +
+
+
+ {showradios === true ? + + : ""} +
+ + {star_infos[3]}% +
+
+
+ {showradios === true ? + + : ""} +
+ + {star_infos[4]}% +
+
+
+ {showradios === true ? + + : ""} +
+ + {star_infos[5]}% +
+
+
+
+
+ +
+ + { + startbtn === false ? + + + {shixunsDetails.task_operation === undefined ? "" : shixunsDetails.status > 1 ? shixunsDetails.task_operation[0] : "模拟实战"} + + + : "" + } + + +
+

本实训的开启时间:{shixunsmessage}
开启时间之前不能挑战 +

+
+
+ {/*取消*/} + 知道啦 +
+ {/*

*/} + {/*知道了*/} + {/*

*/} +
+ + + + +
+

实训已经更新了,正在为您重置!

+
+ +
+
+ + + + + + { + startbtn === true ? + 开启中 : "" + } + + {/*{*/} + {/*shixunsDetails.status=== 3 && shixunsDetails.task_operation[0]==="开始实战"?*/} + {/*{shixunsDetails.task_operation===undefined?"":shixunsDetails.task_operation[0]}:""*/} + {/*}*/} + + {shixunsDetails.status === 0 && this.props.identity < 4 ? + 申请发布 : "" + } + + + { + publishboxstatus === 0 ?
+

+ 发布申请已提交,请等待管理员的审核
+

+
: publishboxstatus === 1 ? +
+

+ 发布申请已提交,请等待管理员的审核
+ • 我们将在1-2个工作日内完成审核 +

+
: publishboxstatus === 2 ?
+

+ 第 + { + evaluation_set_position.map((item, key) => { + return ( + {item}, + ) + }) + } + 关评测设置尚未完成,无法申请发布 +

+
: publishboxstatus === 3 ? +
+

+ 每一个关卡至少需要一个技能标签
+ 第 + { + tag_position.map((item, key) => { + return ( + {item}, + ) + }) + } + 关尚未设置技能标签,请补充 +

+
: +
+

+ 尚未创建任务的实训,不能申请发布 +

+
+ } + + +
+ + {shixunsDetails.status === 1 && this.props.identity < 4 ? + 撤销发布 : "" + } + + { + + + 发送至 + + + } + + +
+
+ +
+ 选择的实训将会发送到指定课堂 +
+ +
+ this.SenttotheSearch(value)} + style={{width: '100%'}} + /> +
+ +
12?"cdefault mb20":"cdefault mb50"}> +
+
    + + { + course_list === undefined ? "" : course_list.map((item, key) => { + return ( + {item.name} + ) + }) + } + +
+
+
+ +
+ 12 ? "block" : "none"}} + showQuickJumper defaultCurrent={1} current={pages} pageSize={12} + total={courses_count} onChange={this.onChangesendeSenttothe}/> + + 确定 + + 取消 +
+ +
+
+
+ + {shixunsDetails.status === 3 && + 已关闭 + } + +
+ + + Fork + + + + + {Forkvisibletype===true? + + : +
+

复制将在后台执行
平台将为你创建一个新的同名实训和内容,请问是否继续?

+
+
+ 取消 + 确定 +
+
+ } + + +
+ + +

{can_fork}
请问是否前往进行认证?

+
+
+ + +
+
+ {!!shixunsDetails.fork_num && + + {shixunsDetails.fork_num} + + } + +
+ +
+ +
+ +
+
正在等待管理员的审核。在审核通过前,可以随时撤销发布
+
+ + ); + } +} + +export default TPMBanner; + From 83efdf9abe1e2d61fc4c1f4725c4e6ace82692bc Mon Sep 17 00:00:00 2001 From: ysl <904079904@qq.com> Date: Sat, 22 Jun 2019 18:57:16 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/coursesPublic/Startshixuntask.js | 3 ++- public/react/src/modules/tpm/TPMBanner.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/Startshixuntask.js b/public/react/src/modules/courses/coursesPublic/Startshixuntask.js index b994e9005..3f256fbcc 100644 --- a/public/react/src/modules/courses/coursesPublic/Startshixuntask.js +++ b/public/react/src/modules/courses/coursesPublic/Startshixuntask.js @@ -78,7 +78,8 @@ class Startshixuntask extends Component{ ).catch((error) => { this.setState({ startbtn:false, - shixunsreplace:false + shixunsreplace:false, + isSpin:false, }) }); diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index 1106b7a3f..78feed436 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -340,7 +340,8 @@ class TPMBanner extends Component { ).catch((error) => { this.setState({ startbtn:false, - shixunsreplace:false + shixunsreplace:false, + isSpin:false }) }); From a2f621701441be69a22d57ff7b0411ddac763cf4 Mon Sep 17 00:00:00 2001 From: ysl <904079904@qq.com> Date: Sat, 22 Jun 2019 19:03:31 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/TPMBanner.js | 30 +++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index 78feed436..14ddcc579 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -328,8 +328,8 @@ class TPMBanner extends Component { }) axios.get(url).then((response) => { if(response.status===200){ - let path="/shixuns/"+response.data.shixun_identifier+"/challenges"; - this.props.history.push(path); + // let path="/shixuns/"+response.data.shixun_identifier+"/challenges"; + // this.props.history.push(path); this.setState({ shixunsreplace:false, isSpin:false, @@ -346,6 +346,32 @@ class TPMBanner extends Component { }); } + + + shixunexec=(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 + }) + }); + + } //开始实战按钮 startshixunCombat=()=>{ let {shixunsDetails} = this.props