From 1b236352e9842e0e578080b83a41b9ff46d51aab Mon Sep 17 00:00:00 2001 From: harry Date: Sun, 8 Mar 2020 20:49:29 +0800 Subject: [PATCH] =?UTF-8?q?=20fix=20=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=B8=8E=E7=BC=96=E8=BE=91=E4=BB=A3=E7=A0=81=E4=B8=8D=E4=B8=80?= =?UTF-8?q?=E8=87=B4=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/controlSetting/index.js | 54 +++++++++---------- .../modules/developer/studentStudy/index.js | 15 +----- .../developer/studentStudy/rightpane/index.js | 3 -- public/react/src/redux/actions/ojForUser.js | 4 +- 4 files changed, 28 insertions(+), 48 deletions(-) diff --git a/public/react/src/modules/developer/components/controlSetting/index.js b/public/react/src/modules/developer/components/controlSetting/index.js index 5960187d9..41a28ba25 100644 --- a/public/react/src/modules/developer/components/controlSetting/index.js +++ b/public/react/src/modules/developer/components/controlSetting/index.js @@ -8,7 +8,7 @@ */ import './index.scss'; import React, { useState, useRef, useEffect } from 'react'; -import { Tabs, Button, Icon, notification } from 'antd'; +import { Tabs, Button, Icon, notification } from 'antd'; import { connect } from 'react-redux'; import InitTabCtx from '../initTabCtx'; import ExecResult from '../execResult'; @@ -17,9 +17,8 @@ import actions from '../../../../redux/actions'; const { TabPane } = Tabs; const ControlSetting = (props) => { - const { - hack, - userCode, + const { + editor_code, inputValue, loading, submitLoading, @@ -59,7 +58,7 @@ const ControlSetting = (props) => { // 调试代码 const handleTestCode = (e) => { - if (!userCode) { + if (!editor_code) { notification.warning({ message: '提示', description: '代码块内容不能为空' @@ -74,11 +73,11 @@ const ControlSetting = (props) => { setDefaultActiveKey('2'); }); } - + // 提交 const handleSubmit = (e) => { e.preventDefault(); - if (!userCode) { + if (!editor_code) { notification.warning({ message: '提示', description: '代码块内容不能为空' @@ -103,56 +102,53 @@ const ControlSetting = (props) => { return (
{/* */} - +
- formRef.current = form} onDebuggerCode={handleDebuggerCode} /> -
-

- -

@@ -161,12 +157,12 @@ const ControlSetting = (props) => { } const mapStateToProps = (state) => { - const {commonReducer, ojForUserReducer} = state; - const {loading, excuteState, submitLoading, showOrHideControl } = commonReducer; - const { commitTestRecordDetail, hack, userCode } = ojForUserReducer; + const { commonReducer, ojForUserReducer } = state; + const { loading, excuteState, submitLoading, showOrHideControl } = commonReducer; + const { commitTestRecordDetail, hack, editor_code } = ojForUserReducer; return { hack, - userCode, + editor_code, loading, submitLoading, excuteState, diff --git a/public/react/src/modules/developer/studentStudy/index.js b/public/react/src/modules/developer/studentStudy/index.js index ee6ab47cf..2e6729522 100644 --- a/public/react/src/modules/developer/studentStudy/index.js +++ b/public/react/src/modules/developer/studentStudy/index.js @@ -108,18 +108,12 @@ function StudentStudy(props) { return (
- {/*
- 用户头像 - - {(mygetHelmetapi &&mygetHelmetapi.name) || ''} - -
*/} +
{hack.name}
- {/* to={`/problems/${_hack_id}/edit`} */} handleClickEditor(hack.identifier)} @@ -127,16 +121,9 @@ function StudentStudy(props) { > 编辑 - {/* to="/problems" */} 退出 - {/* - */}
diff --git a/public/react/src/modules/developer/studentStudy/rightpane/index.js b/public/react/src/modules/developer/studentStudy/rightpane/index.js index c5a71e290..628524063 100644 --- a/public/react/src/modules/developer/studentStudy/rightpane/index.js +++ b/public/react/src/modules/developer/studentStudy/rightpane/index.js @@ -122,9 +122,6 @@ const RightPane = (props) => { onClick={handleClickNote} > - {/*
-