diff --git a/public/react/src/modules/developer/DeveloperHome.js b/public/react/src/modules/developer/DeveloperHome.js
index ae230677a..0a738e6d5 100644
--- a/public/react/src/modules/developer/DeveloperHome.js
+++ b/public/react/src/modules/developer/DeveloperHome.js
@@ -120,7 +120,6 @@ const testMaps = {
2: '数据结构与算法'
}
}
-
class DeveloperHome extends React.PureComponent {
/**
* 表格列
diff --git a/public/react/src/modules/developer/components/controlSetting/index.js b/public/react/src/modules/developer/components/controlSetting/index.js
index 5c970f00e..53b66a359 100644
--- a/public/react/src/modules/developer/components/controlSetting/index.js
+++ b/public/react/src/modules/developer/components/controlSetting/index.js
@@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-27 16:02:36
* @LastEditors : tangjiang
- * @LastEditTime : 2019-12-27 09:32:34
+ * @LastEditTime : 2019-12-27 18:05:50
*/
import './index.scss';
import React, { useState, useRef, useEffect } from 'react';
@@ -19,6 +19,7 @@ const ControlSetting = (props) => {
const {
hack,
+ userCode,
inputValue,
loading,
submitLoading,
@@ -58,7 +59,7 @@ const ControlSetting = (props) => {
// 调试代码
const handleTestCode = (e) => {
- if (!hack.code) {
+ if (!userCode) {
notification.warning({
message: '提示',
description: '代码块内容不能为空'
@@ -77,6 +78,13 @@ const ControlSetting = (props) => {
// 提交
const handleSubmit = (e) => {
e.preventDefault();
+ if (!userCode) {
+ notification.warning({
+ message: '提示',
+ description: '代码块内容不能为空'
+ });
+ return;
+ }
changeSubmitLoadingStatus(true);
onSubmitForm && onSubmitForm();
}
@@ -145,9 +153,10 @@ const ControlSetting = (props) => {
const mapStateToProps = (state) => {
const {commonReducer, ojForUserReducer} = state;
const {loading, excuteState, submitLoading, showOrHideControl } = commonReducer;
- const { commitTestRecordDetail, hack } = ojForUserReducer;
+ const { commitTestRecordDetail, hack, userCode } = ojForUserReducer;
return {
hack,
+ userCode,
loading,
submitLoading,
excuteState,
diff --git a/public/react/src/modules/developer/components/myMonacoEditor/index.js b/public/react/src/modules/developer/components/myMonacoEditor/index.js
index 7c98d7c09..0e2d9d01b 100644
--- a/public/react/src/modules/developer/components/myMonacoEditor/index.js
+++ b/public/react/src/modules/developer/components/myMonacoEditor/index.js
@@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-27 15:02:52
* @LastEditors : tangjiang
- * @LastEditTime : 2019-12-27 10:32:25
+ * @LastEditTime : 2019-12-27 18:01:48
*/
import './index.scss';
import React, { useState, useRef, useEffect } from 'react';
@@ -86,6 +86,7 @@ function MyMonacoEditor (props, ref) {
// TODO 需要优化 节流
const val = editorRef.current.getValue();
// setEditCode(val);
+ // console.log('编辑器代码====>>>>', val);
onCodeChange(val);
// 值一变化保存当前代码值
// saveUserInputCode(val);
diff --git a/public/react/src/modules/developer/studentStudy/index.js b/public/react/src/modules/developer/studentStudy/index.js
index 391a6fbf4..2ef8c4ba9 100644
--- a/public/react/src/modules/developer/studentStudy/index.js
+++ b/public/react/src/modules/developer/studentStudy/index.js
@@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-23 10:53:19
* @LastEditors : tangjiang
- * @LastEditTime : 2019-12-27 10:25:14
+ * @LastEditTime : 2019-12-27 16:22:47
*/
import './index.scss';
import React, { useEffect, useState } from 'react';
@@ -30,6 +30,7 @@ function StudentStudy (props) {
// hack_identifier,
// user_program_identifier,
restoreInitialCode,
+ changeUserCodeTab,
changeShowOrHideControl
} = props;
@@ -39,13 +40,17 @@ function StudentStudy (props) {
saveUserProgramIdentifier
} = props;
- let { id } = params;
+ let { id, tab } = params;
useEffect(() => {
// 保存当前的id
saveUserProgramIdentifier(id);
// startProgramQuestion(id);
getUserProgramDetail(id);
+
+ if (tab) {
+ changeUserCodeTab(tab);
+ }
}, []);
useEffect(() => {
@@ -176,7 +181,8 @@ const mapDispatchToProps = (dispatch) => ({
// 恢复初始代码
restoreInitialCode: (identifier, msg) => dispatch(actions.restoreInitialCode(identifier, msg)),
changeShowOrHideControl: (flag) => dispatch(actions.changeShowOrHideControl(flag)),
- clearOjForUserReducer: () => dispatch(actions.clearOjForUserReducer())
+ clearOjForUserReducer: () => dispatch(actions.clearOjForUserReducer()),
+ changeUserCodeTab: (tab) => dispatch(actions.changeUserCodeTab(tab))
});
export default withRouter(connect(
diff --git a/public/react/src/modules/developer/studentStudy/leftpane/commitRecord/index.js b/public/react/src/modules/developer/studentStudy/leftpane/commitRecord/index.js
index ac1b784c6..e7a8eae9c 100644
--- a/public/react/src/modules/developer/studentStudy/leftpane/commitRecord/index.js
+++ b/public/react/src/modules/developer/studentStudy/leftpane/commitRecord/index.js
@@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-27 09:49:33
* @LastEditors : tangjiang
- * @LastEditTime : 2019-12-27 10:39:00
+ * @LastEditTime : 2019-12-27 17:14:04
*/
import './index.scss';
import React, { useState, useEffect } from 'react';
@@ -116,6 +116,7 @@ const CommitRecord = (props) => {
执行结果:
{reviewResult[status]}
@@ -158,7 +159,7 @@ const CommitRecord = (props) => {
// 复制功能
let count = 0;
useEffect(() => {
- clipboard = new ClipboardJS('.copy_error');
+ clipboard = new ClipboardJS('#copyError');
clipboard && clipboard.on('success', (e) => {
e.clearSelection();
if (count > 0) return;
@@ -166,8 +167,12 @@ const CommitRecord = (props) => {
message.success('复制成功');
setTimeout(() => {
message.destroy();
- }, 300);
+ }, 3000);
});
+
+ return () => {
+ clipboard = null;
+ }
}, []);
const clickCopyErrInfo = () => {
diff --git a/public/react/src/modules/developer/studentStudy/leftpane/index.js b/public/react/src/modules/developer/studentStudy/leftpane/index.js
index 30eedea18..ac8d89321 100644
--- a/public/react/src/modules/developer/studentStudy/leftpane/index.js
+++ b/public/react/src/modules/developer/studentStudy/leftpane/index.js
@@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-23 11:33:41
* @LastEditors : tangjiang
- * @LastEditTime : 2019-12-25 17:10:30
+ * @LastEditTime : 2019-12-27 16:03:04
// */
import './index.scss';
import React, { useState, useEffect, useMemo } from 'react';
@@ -28,7 +28,7 @@ const LeftPane = (props) => {
comments_count, /* 评论数*/
user_praise // 用户是否点赞
} = hack;
- const [defaultActiveKey, setDefaultActiveKey] = useState('comment');
+ const [defaultActiveKey, setDefaultActiveKey] = useState('task');
const navItem = [
{
@@ -51,6 +51,8 @@ const LeftPane = (props) => {
comment: ()
};
+ console.log('======>>>>>>>', props);
+
useEffect(() => {
setDefaultActiveKey(userCodeTab);
}, [userCodeTab])
diff --git a/public/react/src/modules/message/js/MessagSub.js b/public/react/src/modules/message/js/MessagSub.js
index 98036301e..29f31f77c 100644
--- a/public/react/src/modules/message/js/MessagSub.js
+++ b/public/react/src/modules/message/js/MessagSub.js
@@ -475,7 +475,11 @@ class MessagSub extends Component {
// }
}
case "Discuss":
- return window.open(`/shixuns/${item.identifier}/shixun_discuss`);
+ if (item.parent_container_type === 'Hack' && item.extra) {
+ return window.open(`/myproblems/${item.extra}/comment`);
+ } else {
+ return window.open(`/shixuns/${item.identifier}/shixun_discuss`);
+ }
case "Video":
if (item.tiding_type === "Apply") {
return window.open(`/admins/video_applies`);
@@ -506,6 +510,10 @@ class MessagSub extends Component {
//分组作业
return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}`);
}
+ case 'Hack':
+ if (item.extra) {
+ return window.open(`/problems/${item.extra}/edit`);
+ }
default :
return
}
diff --git a/public/react/src/redux/reducers/ojForUserReducer.js b/public/react/src/redux/reducers/ojForUserReducer.js
index f78385049..cbf0a04f3 100644
--- a/public/react/src/redux/reducers/ojForUserReducer.js
+++ b/public/react/src/redux/reducers/ojForUserReducer.js
@@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-27 13:41:48
* @LastEditors : tangjiang
- * @LastEditTime : 2019-12-27 09:18:02
+ * @LastEditTime : 2019-12-27 16:52:30
*/
import types from "../actions/actionTypes";
import { Base64 } from 'js-base64';