diff --git a/public/react/src/common/quillForEditor/index.js b/public/react/src/common/quillForEditor/index.js index 330ecfed9..48c4224f3 100644 --- a/public/react/src/common/quillForEditor/index.js +++ b/public/react/src/common/quillForEditor/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-12-18 08:49:30 * @LastEditors : tangjiang - * @LastEditTime : 2019-12-26 19:36:00 + * @LastEditTime : 2019-12-27 10:36:11 */ import './index.scss'; import 'quill/dist/quill.core.css'; // 核心样式 @@ -121,7 +121,7 @@ function QuillForEditor ({ const previous = quill.getContents() if (value && value.hasOwnProperty('ops')) { - console.log(value.ops); + // console.log(value.ops); const ops = value.ops || []; ops.forEach((item, i) => { if (item.insert['image']) { @@ -131,7 +131,7 @@ function QuillForEditor ({ } const current = value - console.log('+++++', current); + // console.log('+++++', current); if (!deepEqual(previous, current)) { setSelection(quill.getSelection()) if (typeof value === 'string') { diff --git a/public/react/src/modules/developer/DeveloperHome.js b/public/react/src/modules/developer/DeveloperHome.js index 73a5c37a1..b45342150 100644 --- a/public/react/src/modules/developer/DeveloperHome.js +++ b/public/react/src/modules/developer/DeveloperHome.js @@ -254,7 +254,7 @@ class DeveloperHome extends React.PureComponent { content: `确定要删除${record.name}吗?`, onOk () { // 调用删除接口 - console.log(record.identifier); + // console.log(record.identifier); deleteItem(record.identifier); } }); diff --git a/public/react/src/modules/developer/components/monacoSetting/index.js b/public/react/src/modules/developer/components/monacoSetting/index.js index 669439577..c66341be0 100644 --- a/public/react/src/modules/developer/components/monacoSetting/index.js +++ b/public/react/src/modules/developer/components/monacoSetting/index.js @@ -3,8 +3,8 @@ * @Author: tangjiang * @Github: * @Date: 2019-11-25 17:50:33 - * @LastEditors: tangjiang - * @LastEditTime: 2019-12-19 19:32:08 + * @LastEditors : tangjiang + * @LastEditTime : 2019-12-27 10:36:54 */ import React, { useState } from 'react'; import { fromStore, toStore } from 'educoder'; @@ -68,7 +68,7 @@ const SettingDrawer = (props) => { ); } else if (Array.isArray(value)) { const defaultValue = ctx.type === 'font' ? fontSize : theme; - console.log('++', defaultValue); + // console.log('++', defaultValue); if (type === 'select') { const child = ctx.value.map((opt, i) => { return ( diff --git a/public/react/src/modules/developer/components/myMonacoEditor/index.js b/public/react/src/modules/developer/components/myMonacoEditor/index.js index ed7186102..7c98d7c09 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 09:22:08 + * @LastEditTime : 2019-12-27 10:32:25 */ import './index.scss'; import React, { useState, useRef, useEffect } from 'react'; @@ -28,7 +28,8 @@ const maps = { function MyMonacoEditor (props, ref) { - const { + const { + code, notice, language, identifier, @@ -41,7 +42,7 @@ function MyMonacoEditor (props, ref) { } = props; const [showDrawer, setShowDrawer] = useState(false); // 控制配置滑框 - const [editCode, setEditCode] = useState(''); + // const [editCode, setEditCode] = useState(''); // const [curLang, setCurLang] = useState('C'); const [fontSize, setFontSize] = useState(() => { // 字体 return +fromStore('oj_fontSize') || 14; @@ -52,9 +53,9 @@ function MyMonacoEditor (props, ref) { const [ height, setHeight ] = useState('calc(100% - 56px)'); const editorRef = useRef(null); - useEffect(() => { - setEditCode(props.code || ''); - }, [props]); + // useEffect(() => { + // setEditCode(props.code || ''); + // }, [props]); useEffect(() => { setHeight(showOrHideControl ? 'calc(100% - 378px)' : 'calc(100% - 56px)'); @@ -80,11 +81,11 @@ function MyMonacoEditor (props, ref) { // 文本框内容变化时,记录文本框内容 const handleEditorChange = (origin, monaco) => { editorRef.current = monaco; // 获取当前monaco实例 - setEditCode(origin); // 保存编辑器初始值 + // setEditCode(origin); // 保存编辑器初始值 editorRef.current.onDidChangeModelContent(e => { // 监听编辑器内容的变化 // TODO 需要优化 节流 const val = editorRef.current.getValue(); - setEditCode(val); + // setEditCode(val); onCodeChange(val); // 值一变化保存当前代码值 // saveUserInputCode(val); @@ -179,7 +180,7 @@ function MyMonacoEditor (props, ref) { height={height} width="100%" language={language && language.toLowerCase()} - value={editCode} + value={code || ''} options={editorOptions} theme={theme} // dark || light editorDidMount={handleEditorChange} @@ -210,12 +211,12 @@ const mapStateToProps = (state) => { } }; -const mapDispatchToProps = (dispatch) => ({ - // saveUserInputCode: (code) => dispatch(actions.saveUserInputCode(code)), -}); +// const mapDispatchToProps = (dispatch) => ({ +// // saveUserInputCode: (code) => dispatch(actions.saveUserInputCode(code)), +// }); // MyMonacoEditor = React.forwardRef(MyMonacoEditor); export default connect( mapStateToProps, - mapDispatchToProps + // mapDispatchToProps )(CNotificationHOC() (MyMonacoEditor)); diff --git a/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/AddTestDemo.js b/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/AddTestDemo.js index 9ae0a43e1..a16f30c18 100644 --- a/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/AddTestDemo.js +++ b/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/AddTestDemo.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-21 09:19:38 * @LastEditors : tangjiang - * @LastEditTime : 2019-12-26 15:33:01 + * @LastEditTime : 2019-12-27 10:37:41 */ import './index.scss'; import React from 'react'; @@ -134,10 +134,10 @@ const AddTestDemo = (props) => { // }; // const {input = {}, output = {}} = (testCasesValidate[index] = {}); - const activePane = { - defaultActiveKey: [isOpen ? '1' : ''] - }; - console.log(activePane); + // const activePane = { + // defaultActiveKey: [isOpen ? '1' : ''] + // }; + // console.log(activePane); // 切换手风琴 const handleChangeCollapse = () => { @@ -184,7 +184,7 @@ const AddTestDemo = (props) => { const mapStateToProps = (state) => { const {identifier, loading} = state.ojFormReducer; - console.log(state.ojFormReducer); + // console.log(state.ojFormReducer); return { identifier, loading, diff --git a/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.js b/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.js index 2e345c489..4da8b7741 100644 --- a/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.js +++ b/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-20 10:35:40 * @LastEditors : tangjiang - * @LastEditTime : 2019-12-26 16:00:57 + * @LastEditTime : 2019-12-27 10:37:58 */ import './index.scss'; // import 'katex/dist/katex.css'; @@ -175,11 +175,11 @@ class EditTab extends React.Component { }; // 提交测试用例 const handleSubmitTest = (obj) => { - console.log('提交的测试用例: ', obj); + // console.log('提交的测试用例: ', obj); }; // 删除测试用例 const handleDeleteTest = (obj) => { - console.log('删除的测试用例: ', obj); + // console.log('删除的测试用例: ', obj); deleteTestCase(obj); }; const renderTestCase = () => { @@ -223,9 +223,9 @@ class EditTab extends React.Component { // 描述信息变化时 const handleContentChange = (content, quill) => { - console.log('描述信息为: ', content); + // console.log('描述信息为: ', content); // if (quill.getText()) - console.log('========>>>>>', quill.getText().length); + // console.log('========>>>>>', quill.getText().length); if (quill.getText().length === 1) { this.handleChangeDescription(''); } else { diff --git a/public/react/src/modules/developer/newOrEditTask/rightpane/index.js b/public/react/src/modules/developer/newOrEditTask/rightpane/index.js index 49d9f9b2a..16533c624 100644 --- a/public/react/src/modules/developer/newOrEditTask/rightpane/index.js +++ b/public/react/src/modules/developer/newOrEditTask/rightpane/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-12-01 10:18:35 * @LastEditors : tangjiang - * @LastEditTime : 2019-12-26 13:51:40 + * @LastEditTime : 2019-12-27 10:17:07 */ import './index.scss'; import React from 'react'; @@ -17,7 +17,8 @@ function RightPane (props, ref) { const { // identifier, - // code, + code, + language, // onSubmitForm, saveOjFormCode } = props; @@ -44,8 +45,8 @@ function RightPane (props, ref) { return (