|
|
@ -52,11 +52,18 @@ class ActionView extends Component {
|
|
|
|
componentDidMount() {
|
|
|
|
componentDidMount() {
|
|
|
|
// request
|
|
|
|
// request
|
|
|
|
window._tpiWidthResize = () => {
|
|
|
|
window._tpiWidthResize = () => {
|
|
|
|
if (window.$('#actionView').width() < 580) {
|
|
|
|
const _w = window.$('#actionView').width();
|
|
|
|
window.$('.time_limit').hide()
|
|
|
|
// if (_w < 446) {
|
|
|
|
} else {
|
|
|
|
// window.$('#time-consuming').hide()
|
|
|
|
window.$('.time_limit').show()
|
|
|
|
// // window.$('#time-consuming').hide()
|
|
|
|
}
|
|
|
|
// } else if (_w < 746) {
|
|
|
|
|
|
|
|
// // 文字放出来之前是 580
|
|
|
|
|
|
|
|
// window.$('#time-consuming').show()
|
|
|
|
|
|
|
|
// window.$('.time_limit').hide()
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// window.$('#time-consuming').show()
|
|
|
|
|
|
|
|
// window.$('.time_limit').show()
|
|
|
|
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -70,24 +77,50 @@ class ActionView extends Component {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className="-flex -layout-h" id="game_operate_action">
|
|
|
|
<div className="-flex -layout-h" id="game_operate_action">
|
|
|
|
<style>{`
|
|
|
|
<style>{`
|
|
|
|
|
|
|
|
#game_operate_action {
|
|
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
}
|
|
|
|
.time_limit {
|
|
|
|
.time_limit {
|
|
|
|
margin-right: 16px;
|
|
|
|
margin-right: 0px;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.spliter {
|
|
|
|
|
|
|
|
border-right: 1px solid;
|
|
|
|
|
|
|
|
padding-right: 8px;
|
|
|
|
|
|
|
|
margin-right: 8px;
|
|
|
|
|
|
|
|
height: 14px;
|
|
|
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
top: 3px;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#time-consuming {
|
|
|
|
|
|
|
|
flex: auto;
|
|
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#game_operate_action .act_btn {
|
|
|
|
|
|
|
|
flex: 0 0 90px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`}</style>
|
|
|
|
`}</style>
|
|
|
|
<span className="mt10 -flex c_grey ml15" id="time-consuming">
|
|
|
|
<span className="mt10 -flex c_grey ml15" id="time-consuming">
|
|
|
|
{!!time_limit &&
|
|
|
|
{!!time_limit &&
|
|
|
|
<span className="time_limit">{`本关最大执行时间:${real_time_limit}秒`}</span>}
|
|
|
|
<span className="time_limit">{`本关最大执行时间:${real_time_limit}秒`}
|
|
|
|
|
|
|
|
{!gameBuilding && record && <span className="spliter"></span>}
|
|
|
|
|
|
|
|
</span>}
|
|
|
|
{!gameBuilding && record ?
|
|
|
|
{!gameBuilding && record ?
|
|
|
|
<Tooltip title={ "本次评测耗时(编译、运行总时间)" }>
|
|
|
|
// <Tooltip title={ "本次评测耗时(编译、运行总时间)" }></Tooltip>
|
|
|
|
<span>{ record } 秒</span>
|
|
|
|
<span>本次评测耗时(编译、运行总时间):{ record } 秒</span>
|
|
|
|
</Tooltip>
|
|
|
|
|
|
|
|
: ""}
|
|
|
|
: ""}
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
{/*将第一个按钮改为visibility方式隐藏,不然加载时测评按钮会出现没有垂直居中的情况*/}
|
|
|
|
{/*将第一个按钮改为visibility方式隐藏,不然加载时测评按钮会出现没有垂直居中的情况*/}
|
|
|
|
<Tooltip title={ "倒计时为0时,服务将被关闭" }>
|
|
|
|
<Tooltip title={ "倒计时为0时,服务将被关闭" }>
|
|
|
|
<Button size="small" className={classes.button + ' actionViewfirstButton'} onClick={()=>this.showWebDisplay(challenge)}
|
|
|
|
<Button size="small" className={classes.button + ' actionViewfirstButton'} onClick={()=>this.showWebDisplay(challenge)}
|
|
|
|
style={{ visibility: challenge.showWebDisplayButton ? '': 'hidden'}}
|
|
|
|
style={{ visibility: challenge.showWebDisplayButton ? '': 'hidden',
|
|
|
|
|
|
|
|
minWidth: challenge.showWebDisplayButton ? '': '1px',
|
|
|
|
|
|
|
|
width: challenge.showWebDisplayButton ? '': '1px',
|
|
|
|
|
|
|
|
flex: `0 0 ${challenge.showWebDisplayButton ? '110px': '1px'}`
|
|
|
|
|
|
|
|
}}
|
|
|
|
id="showWebDisplayButton"
|
|
|
|
id="showWebDisplayButton"
|
|
|
|
// style={{ display: challenge.showWebDisplayButton ? 'flex': 'none'}}
|
|
|
|
// style={{ display: challenge.showWebDisplayButton ? 'flex': 'none'}}
|
|
|
|
>
|
|
|
|
>
|
|
|
@ -98,7 +131,7 @@ class ActionView extends Component {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
!gameBuilding &&
|
|
|
|
!gameBuilding &&
|
|
|
|
(game && !!game.prev_game) ?
|
|
|
|
(game && !!game.prev_game) ?
|
|
|
|
<Link to={`/tasks/${game.prev_game}`} className={classes.buttonText}>
|
|
|
|
<Link to={`/tasks/${game.prev_game}`} className={classes.buttonText + ' act_btn'}>
|
|
|
|
<Button size="small" className={classes.button}>
|
|
|
|
<Button size="small" className={classes.button}>
|
|
|
|
上一关
|
|
|
|
上一关
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
@ -108,7 +141,7 @@ class ActionView extends Component {
|
|
|
|
{/*未发布的都能跳转*/}
|
|
|
|
{/*未发布的都能跳转*/}
|
|
|
|
{ !gameBuilding &&
|
|
|
|
{ !gameBuilding &&
|
|
|
|
((game && (game.status === 2 || shixun.status < 2) || shixun && shixun.task_pass ) && !!game.next_game) ?
|
|
|
|
((game && (game.status === 2 || shixun.status < 2) || shixun && shixun.task_pass ) && !!game.next_game) ?
|
|
|
|
<Link to={`/tasks/${game.next_game}`} className={classes.buttonText}>
|
|
|
|
<Link to={`/tasks/${game.next_game}`} className={classes.buttonText + ' act_btn'}>
|
|
|
|
<Button size="small" className={classes.button}>
|
|
|
|
<Button size="small" className={classes.button}>
|
|
|
|
下一关
|
|
|
|
下一关
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
@ -117,11 +150,11 @@ class ActionView extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div id="code_test">
|
|
|
|
<div id="code_test" className="act_btn">
|
|
|
|
{
|
|
|
|
{
|
|
|
|
st === 1 && game.status === 2 ?
|
|
|
|
st === 1 && game.status === 2 ?
|
|
|
|
<Tooltip title={ "已通关的选择题任务无法再次测评" }>
|
|
|
|
<Tooltip title={ "已通关的选择题任务无法再次测评" }>
|
|
|
|
<a href="javascript:void(0)" className="shixun-task-btn mr15 gray"
|
|
|
|
<a href="javascript:void(0)" className="shixun-task-btn mr15 gray "
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<i className="fa fa-play-circle font-16"></i>
|
|
|
|
<i className="fa fa-play-circle font-16"></i>
|
|
|
|
测评
|
|
|
|
测评
|
|
|
@ -130,7 +163,7 @@ class ActionView extends Component {
|
|
|
|
:
|
|
|
|
:
|
|
|
|
gameBuilding ?
|
|
|
|
gameBuilding ?
|
|
|
|
|
|
|
|
|
|
|
|
<a href="javascript:void(0)" className="shixun-task-btn mr15 gray"
|
|
|
|
<a href="javascript:void(0)" className="shixun-task-btn mr15 gray "
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<i className="fa fa-play-circle font-16"></i>
|
|
|
|
<i className="fa fa-play-circle font-16"></i>
|
|
|
|
测评
|
|
|
|
测评
|
|
|
|