|
|
|
@ -4,7 +4,7 @@
|
|
|
|
|
* @Github:
|
|
|
|
|
* @Date: 2019-11-23 10:53:19
|
|
|
|
|
* @LastEditors: tangjiang
|
|
|
|
|
* @LastEditTime: 2019-12-10 08:52:23
|
|
|
|
|
* @LastEditTime: 2019-12-10 19:16:18
|
|
|
|
|
*/
|
|
|
|
|
import './index.scss';
|
|
|
|
|
import React, { useEffect } from 'react';
|
|
|
|
@ -12,13 +12,15 @@ import { connect } from 'react-redux';
|
|
|
|
|
import SplitPane from 'react-split-pane';
|
|
|
|
|
import LeftPane from './leftpane';
|
|
|
|
|
import RightPane from './rightpane';
|
|
|
|
|
import { Link } from 'react-router-dom';
|
|
|
|
|
// import { Link } from 'react-router-dom';
|
|
|
|
|
// import { getImageUrl } from 'educoder'
|
|
|
|
|
// import RightPane from '../newOrEditTask/rightpane';
|
|
|
|
|
import { Icon } from 'antd';
|
|
|
|
|
import UserInfo from '../components/userInfo';
|
|
|
|
|
import actions from '../../../redux/actions';
|
|
|
|
|
import { fromStore} from 'educoder';
|
|
|
|
|
import { withRouter } from 'react-router';
|
|
|
|
|
|
|
|
|
|
const StudentStudy = (props) => {
|
|
|
|
|
|
|
|
|
|
const {
|
|
|
|
@ -29,7 +31,7 @@ const StudentStudy = (props) => {
|
|
|
|
|
const {
|
|
|
|
|
match: { params },
|
|
|
|
|
getUserProgramDetail,
|
|
|
|
|
saveUserProgramIdentifier,
|
|
|
|
|
saveUserProgramIdentifier
|
|
|
|
|
} = props;
|
|
|
|
|
|
|
|
|
|
let { id } = params;
|
|
|
|
@ -42,6 +44,17 @@ const StudentStudy = (props) => {
|
|
|
|
|
|
|
|
|
|
const _hack_id = hack_identifier || fromStore('hack_identifier');
|
|
|
|
|
|
|
|
|
|
// 处理编辑
|
|
|
|
|
const handleClickEditor = () => {
|
|
|
|
|
props.saveEditorCodeForDetail();
|
|
|
|
|
props.history.push(`/problems/${_hack_id}/edit`);
|
|
|
|
|
}
|
|
|
|
|
// 处理退出
|
|
|
|
|
const handleClickQuit = () => {
|
|
|
|
|
props.saveEditorCodeForDetail();
|
|
|
|
|
props.history.push('/problems');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className={'student_study_warp'}>
|
|
|
|
|
<div className={'student_study_header'}>
|
|
|
|
@ -56,12 +69,14 @@ const StudentStudy = (props) => {
|
|
|
|
|
<span>乘积最大序列</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div className={'study_quit'}>
|
|
|
|
|
<Link to={`/problems/${_hack_id}/edit`} className="quit-btn">
|
|
|
|
|
{/* to={`/problems/${_hack_id}/edit`} */}
|
|
|
|
|
<span onClick={handleClickEditor} className="quit-btn">
|
|
|
|
|
<Icon type="form" className="quit-icon"/> 编辑
|
|
|
|
|
</Link>
|
|
|
|
|
<Link to="/problems" className="quit-btn">
|
|
|
|
|
</span>
|
|
|
|
|
{/* to="/problems" */}
|
|
|
|
|
<span onClick={handleClickQuit} className="quit-btn">
|
|
|
|
|
<Icon type="poweroff" className="quit-icon"/> 退出
|
|
|
|
|
</Link>
|
|
|
|
|
</span>
|
|
|
|
|
{/* <Button type="link" icon="form" className='quit-btn'>
|
|
|
|
|
<Link to="/problems">编辑</Link>
|
|
|
|
|
</Button>
|
|
|
|
@ -99,12 +114,13 @@ const mapDispatchToProps = (dispatch) => ({
|
|
|
|
|
// startProgramQuestion: (id) => dispatch(actions.startProgramQuestion(id))
|
|
|
|
|
// 调用编程题详情
|
|
|
|
|
getUserProgramDetail: (id) => dispatch(actions.getUserProgramDetail(id)),
|
|
|
|
|
saveUserProgramIdentifier: (id) => dispatch(actions.saveUserProgramIdentifier(id))
|
|
|
|
|
saveUserProgramIdentifier: (id) => dispatch(actions.saveUserProgramIdentifier(id)),
|
|
|
|
|
saveEditorCodeForDetail: (code) => dispatch(actions.saveEditorCodeForDetail(code))
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export default connect(
|
|
|
|
|
export default withRouter(connect(
|
|
|
|
|
mapStateToProps,
|
|
|
|
|
mapDispatchToProps
|
|
|
|
|
)(StudentStudy);
|
|
|
|
|
)(StudentStudy));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|