harry 5 years ago
parent 705e9b9523
commit 6d5f1986b7

@ -6,7 +6,7 @@
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2019-12-27 11:05:17 * @LastEditTime : 2019-12-27 11:05:17
*/ */
import './index.less'; import './index.scss';
import React, { useState } from 'react'; import React, { useState } from 'react';
import CommentIcon from './CommentIcon'; import CommentIcon from './CommentIcon';
import { getImageUrl, CNotificationHOC } from 'educoder' import { getImageUrl, CNotificationHOC } from 'educoder'
@ -53,7 +53,6 @@ function CommentItem({
title: '提示', title: '提示',
content: ('确定要删除该条回复吗?'), content: ('确定要删除该条回复吗?'),
onOk() { onOk() {
console.log('点击了删除', id);
submitDeleteComment && submitDeleteComment(id); submitDeleteComment && submitDeleteComment(id);
} }
}); });
@ -83,7 +82,6 @@ function CommentItem({
}; };
const handleShowUploadImage = (url) => { const handleShowUploadImage = (url) => {
// console.log('==============>>>>>>>>>>>>',url);
setUrl(url); setUrl(url);
} }
// 评论内容 // 评论内容

@ -7,14 +7,11 @@
* @LastEditTime : 2019-12-24 18:03:21 * @LastEditTime : 2019-12-24 18:03:21
*/ */
import React from 'react'; import React from 'react';
// import CommentForm from './CommentForm';
import CommentList from './CommentList'; import CommentList from './CommentList';
function Comment(props) { function Comment(props) {
const { const {
commentLists, commentLists,
// addComment,
// cancelComment,
isAdmin, isAdmin,
addChildComment, addChildComment,
likeComment, likeComment,
@ -22,15 +19,7 @@ function Comment (props) {
submitDeleteComment submitDeleteComment
} = props; } = props;
// const handleCancelComment = () => {
// cancelComment && cancelComment();
// };
return ( return (
<React.Fragment>
{/* <CommentForm
onCancel={handleCancelComment}
onSubmit={addComment}
/> */}
<CommentList <CommentList
isAdmin={isAdmin} isAdmin={isAdmin}
likeComment={likeComment} likeComment={likeComment}
@ -39,7 +28,7 @@ function Comment (props) {
submitChildComment={addChildComment} submitChildComment={addChildComment}
submitDeleteComment={submitDeleteComment} submitDeleteComment={submitDeleteComment}
/> />
</React.Fragment>
); );
} }

@ -133,11 +133,10 @@ export const saveUserCodeForInterval = (identifier, code) => {
* @param {*} inputValue 输入值: 自定义 | 系统返回的 * @param {*} inputValue 输入值: 自定义 | 系统返回的
* @param {*} type 测评类型 debug | submit * @param {*} type 测评类型 debug | submit
*/ */
//原来的方法未能区分从编辑入口进来的情况,这时代码也是更新了的。 //原来的方法未能区分从编辑入口进来的情况,这时代码也是更新了的。以及ctrl+z undo未能触发chnage事件 monaco-editor的bug。 这里去除isUpdateCode
export const updateCode = (identifier, inputValue, type) => { export const updateCode = (identifier, inputValue, type) => {
return (dispatch, getState) => { return (dispatch, getState) => {
const { editor_code, isUpdateCode } = getState().ojForUserReducer; const { editor_code } = getState().ojForUserReducer;
if (isUpdateCode) {
fetchUpdateCode(identifier, { fetchUpdateCode(identifier, {
code: Base64.encode(editor_code) code: Base64.encode(editor_code)
}).then(res => { }).then(res => {
@ -156,10 +155,7 @@ export const updateCode = (identifier, inputValue, type) => {
dispatch(debuggerCode(identifier, inputValue, type)); dispatch(debuggerCode(identifier, inputValue, type));
} }
}); });
} else {
// 没有更新时,直接调用调试接口
dispatch(debuggerCode(identifier, inputValue, type));
}
} }
} }
@ -370,14 +366,6 @@ export const saveUserInputCode = (code) => {
} }
} }
// 监听是否更新代码块内容
// export const isUpdateCodeCtx = (flag) => {
// return {
// type: types.IS_UPDATE_CODE,
// payload: flag
// };
// }
// 改变学员测评 tab 值 // 改变学员测评 tab 值
export const changeUserCodeTab = (key) => { export const changeUserCodeTab = (key) => {
return { return {
@ -392,7 +380,7 @@ export const changeUserCodeTab = (key) => {
*/ */
export const submitUserCode = (identifier, inputValue, type) => { export const submitUserCode = (identifier, inputValue, type) => {
return (dispatch, getState) => { return (dispatch, getState) => {
const { editor_code, isUpdateCode, hack } = getState().ojForUserReducer; const { editor_code, hack } = getState().ojForUserReducer;
function userCodeSubmit() { function userCodeSubmit() {
fetchUserCodeSubmit(identifier).then(res => { fetchUserCodeSubmit(identifier).then(res => {
if (res.status === 200) { if (res.status === 200) {
@ -413,7 +401,6 @@ export const submitUserCode = (identifier, inputValue, type) => {
}); });
}); });
} }
if (isUpdateCode) {
fetchUpdateCode(identifier, { fetchUpdateCode(identifier, {
code: Base64.encode(editor_code) code: Base64.encode(editor_code)
}).then(res => { }).then(res => {
@ -436,9 +423,7 @@ export const submitUserCode = (identifier, inputValue, type) => {
payload: false payload: false
}) })
}); });
} else {
userCodeSubmit();
}
} }
} }

Loading…
Cancel
Save