|
|
|
@ -3,8 +3,8 @@
|
|
|
|
|
* @Author: tangjiang
|
|
|
|
|
* @Github:
|
|
|
|
|
* @Date: 2019-12-04 08:36:21
|
|
|
|
|
* @LastEditors: tangjiang
|
|
|
|
|
* @LastEditTime: 2019-12-20 20:05:57
|
|
|
|
|
* @LastEditors : tangjiang
|
|
|
|
|
* @LastEditTime : 2019-12-26 14:04:16
|
|
|
|
|
*/
|
|
|
|
|
import './index.scss';
|
|
|
|
|
import React, { useState, useEffect } from 'react';
|
|
|
|
@ -15,6 +15,7 @@ import { Link } from 'react-router-dom';
|
|
|
|
|
import MonacoEditor from '@monaco-editor/react';
|
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
|
// import { getImageUrl } from 'educoder';
|
|
|
|
|
import { withRouter } from 'react-router'
|
|
|
|
|
import actions from '../../../redux/actions';
|
|
|
|
|
import CONST from '../../../constants';
|
|
|
|
|
import UserInfo from '../components/userInfo';
|
|
|
|
@ -53,6 +54,12 @@ function RecordDetail (props) {
|
|
|
|
|
}
|
|
|
|
|
}, [recordDetail]);
|
|
|
|
|
|
|
|
|
|
const handleReturn = (identifier) => {
|
|
|
|
|
if (identifier) {
|
|
|
|
|
saveEditorCodeForDetail('');
|
|
|
|
|
props.history.push(`/myproblems/${identifier}`);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return (
|
|
|
|
|
<div className="record_detail_area">
|
|
|
|
|
<div className="record_detail_header">
|
|
|
|
@ -67,8 +74,9 @@ function RecordDetail (props) {
|
|
|
|
|
<span>{detail.name || 'test'}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div className={'study_quit'}>
|
|
|
|
|
<Button style={{ visibility: identifier ? 'visible' : 'hidden'}}>
|
|
|
|
|
<Link to={`/myproblems/${identifier}`}>返回该题</Link>
|
|
|
|
|
<Button style={{ visibility: identifier ? 'visible' : 'hidden'}} onClick={() => handleReturn(identifier)}>
|
|
|
|
|
返回该题
|
|
|
|
|
{/* <Link to={`/myproblems/${identifier}`}>返回该题</Link> */}
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -89,7 +97,7 @@ function RecordDetail (props) {
|
|
|
|
|
语言: <span className="status_label_sub">{detail.language}</span>
|
|
|
|
|
</span>
|
|
|
|
|
<span className="status_label" style={{ visibility: detail.status === 0 ? 'visible' : 'hidden'}}>
|
|
|
|
|
执行用时: <span className="status_label_sub">{`${detail.execute_time && (+detail.execute_time * 1000)}ms`}</span>
|
|
|
|
|
执行用时: <span className="status_label_sub">{`${detail.execute_time && Number(detail.execute_time * 1000).toFixed(2)}ms`}</span>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="result_error_area">
|
|
|
|
@ -134,7 +142,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|
|
|
|
saveEditorCodeForDetail: (code) => dispatch(actions.saveEditorCodeForDetail(code))
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export default connect(
|
|
|
|
|
export default withRouter(connect(
|
|
|
|
|
mapStateToProps,
|
|
|
|
|
mapDispatchToProps
|
|
|
|
|
)(RecordDetail);
|
|
|
|
|
)(RecordDetail));
|