dev_admin
hjm 6 years ago
parent 18f9a5d215
commit 7a1d8064ca

@ -209,6 +209,7 @@ $(function(){
// window resize
$(window).on('resize', function() {
window._tpiWidthResize && window._tpiWidthResize()
$('#games_repository_contents .CodeMirror.cm-s-railscasts').css("height", $("#games_repository_contents").height() - repositoryTabHeight);
})
@ -1221,6 +1222,7 @@ $(function(){ // 这里重新加一次事件监听,不在原有事件的基
);
doc.live("mousemove", function(e) {
if (dragging === true && lab == dragDom) {
window._tpiWidthResize && window._tpiWidthResize()
// React 组件中需要resize搜索该引用可以找到初始化的位置
window._currentChildcommentMDEditor && window._currentChildcommentMDEditor.resize()
}

@ -51,6 +51,13 @@ class ActionView extends Component {
componentDidMount() {
// request
window._tpiWidthResize = () => {
if (window.$('#actionView').width() < 580) {
window.$('.time_limit').hide()
} else {
window.$('.time_limit').show()
}
}
}
showWebDisplay(challenge) {
@ -59,10 +66,17 @@ class ActionView extends Component {
/*<span className="mt10 -flex c_grey ml15" id="time-consuming">耗时0 天 3 小时 11 分钟 57 秒 </span>*/
render() {
const { onRunCodeTest, onShowPrevStage, onShowNextStage, gameBuilding
, game, classes, st, shixun, record, challenge } = this.props;
, game, classes, st, shixun, record, challenge, time_limit } = this.props;
return (
<div className="-flex -layout-h" id="game_operate_action">
<style>{`
.time_limit {
margin-right: 16px;
}
`}</style>
<span className="mt10 -flex c_grey ml15" id="time-consuming">
{!!time_limit &&
<span className="time_limit">{`本关最大执行时间:${time_limit}`}</span>}
{!gameBuilding && record ?
<Tooltip title={ "本次评测耗时(编译、运行总时间)" }>
<span>{ record } </span>
@ -73,7 +87,9 @@ class ActionView extends Component {
{/*将第一个按钮改为visibility方式隐藏不然加载时测评按钮会出现没有垂直居中的情况*/}
<Tooltip title={ "倒计时为0时服务将被关闭" }>
<Button size="small" className={classes.button + ' actionViewfirstButton'} onClick={()=>this.showWebDisplay(challenge)}
style={{ visibility: challenge.showWebDisplayButton ? '': 'hidden'}} id="showWebDisplayButton">
style={{ visibility: challenge.showWebDisplayButton ? '': 'hidden'}} id="showWebDisplayButton"
style={{ display: challenge.showWebDisplayButton ? 'flex': 'none'}}
>
查看效果
</Button>
</Tooltip>

@ -14,7 +14,7 @@
min-width: 280px;
}
#time-consuming span{
#time-consuming .time_limit {
display: none;
}
.actionViewfirstButton {

Loading…
Cancel
Save