|
|
|
@ -4,7 +4,7 @@
|
|
|
|
|
* @Github:
|
|
|
|
|
* @Date: 2019-11-27 09:49:33
|
|
|
|
|
* @LastEditors: tangjiang
|
|
|
|
|
* @LastEditTime: 2019-12-03 15:14:34
|
|
|
|
|
* @LastEditTime: 2019-12-03 20:47:59
|
|
|
|
|
*/
|
|
|
|
|
import './index.scss';
|
|
|
|
|
import React, { useState, useEffect } from 'react';
|
|
|
|
@ -14,6 +14,7 @@ import actions from '../../../../../redux/actions';
|
|
|
|
|
import CONST from '../../../../../constants';
|
|
|
|
|
import moment from 'moment';
|
|
|
|
|
import ClipboardJS from 'clipboard';
|
|
|
|
|
import ErrorResult from '../../../components/errorResult';
|
|
|
|
|
|
|
|
|
|
const numberal = require('numeral');
|
|
|
|
|
|
|
|
|
@ -66,6 +67,7 @@ const CommitRecord = (props) => {
|
|
|
|
|
identifier,
|
|
|
|
|
commitRecord,
|
|
|
|
|
// excuteState,
|
|
|
|
|
language,
|
|
|
|
|
commitRecordDetail,
|
|
|
|
|
getUserCommitRecord
|
|
|
|
|
} = props;
|
|
|
|
@ -110,7 +112,9 @@ const CommitRecord = (props) => {
|
|
|
|
|
显示详情 <Icon type="right" className={'icon_style'}/>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="errcode" className={showErrorCode}>{error_msg}</div>
|
|
|
|
|
<div id="errcode" className={showErrorCode}>
|
|
|
|
|
<ErrorResult detail={commitRecordDetail} language={language}/>
|
|
|
|
|
</div>
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
@ -123,7 +127,10 @@ const CommitRecord = (props) => {
|
|
|
|
|
}, []);
|
|
|
|
|
// 提交记录变化时,同步到表单数据
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
const len = commitRecord.length;
|
|
|
|
|
const pageConfig = Object.assign({}, paginationConfig, {total: len});
|
|
|
|
|
setTableData(commitRecord);
|
|
|
|
|
setPagination(pageConfig);
|
|
|
|
|
}, [commitRecord]);
|
|
|
|
|
// 提交详情变化时,显示当前提交信息
|
|
|
|
|
useEffect(() => {
|
|
|
|
@ -140,15 +147,21 @@ const CommitRecord = (props) => {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, [commitRecordDetail.status]);
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
const handleTableChange = (pagination) => {
|
|
|
|
|
setPagination(Object.assign({}, pagination));
|
|
|
|
|
}
|
|
|
|
|
// console.log(commitRecord);
|
|
|
|
|
return (
|
|
|
|
|
<div className={'commit_record_area'}>
|
|
|
|
|
{renderRecordDetail()}
|
|
|
|
|
{renderCtx()}
|
|
|
|
|
<Table
|
|
|
|
|
columns={columns}
|
|
|
|
|
rowKey={function (record) { return `key_${record.id}`}}
|
|
|
|
|
dataSource={tableData}
|
|
|
|
|
pagination={pagination}
|
|
|
|
|
onChange={handleTableChange}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
@ -162,7 +175,8 @@ const mapStateToProps = (state) => {
|
|
|
|
|
const {
|
|
|
|
|
user_program_identifier,
|
|
|
|
|
commitRecordDetail,
|
|
|
|
|
commitRecord
|
|
|
|
|
commitRecord,
|
|
|
|
|
hack
|
|
|
|
|
} = ojForUserReducer;
|
|
|
|
|
const { excuteState } = commonReducer;
|
|
|
|
|
return {
|
|
|
|
@ -170,6 +184,7 @@ const mapStateToProps = (state) => {
|
|
|
|
|
commitRecordDetail,
|
|
|
|
|
commitRecord, // 提交记录
|
|
|
|
|
excuteState, // 代码执行状态
|
|
|
|
|
language: hack.language
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const mapDispatchToProps = (dispatch) => ({
|
|
|
|
|