diff --git a/public/react/src/modules/developer/components/initTabCtx/index.js b/public/react/src/modules/developer/components/initTabCtx/index.js
index 3a70f8091..6582003c8 100644
--- a/public/react/src/modules/developer/components/initTabCtx/index.js
+++ b/public/react/src/modules/developer/components/initTabCtx/index.js
@@ -77,7 +77,7 @@ function InitTabCtx (props, ref) {
const _handleTestCodeFormSubmit = (cb) => {
const {form} = props;
- form.validateFields((err, values) => {
+ form.validateFieldsAndScroll((err, values) => {
if (!err) { // 表单验证通过时,调用测试接口
cb && cb(); // 调用回调函数,切换 tab
onDebuggerCode && onDebuggerCode(values);
diff --git a/public/react/src/modules/developer/components/initTabCtx/index1.js b/public/react/src/modules/developer/components/initTabCtx/index1.js
index e80bbd767..27ec7eaf4 100644
--- a/public/react/src/modules/developer/components/initTabCtx/index1.js
+++ b/public/react/src/modules/developer/components/initTabCtx/index1.js
@@ -1,7 +1,7 @@
/*
- * @Description: 显示tab中的内容
- * @Author: tangjiang
- * @Date: 2019-11-18 10:43:03
+ * @Description: 显示tab中的内容
+ * @Author: tangjiang
+ * @Date: 2019-11-18 10:43:03
* @Last Modified by: tangjiang
* @Last Modified time: 2019-11-18 11:35:12
*/
@@ -31,7 +31,7 @@ const renderUserCase = (ctx, position, props) => {
})()
}
- {/*
{
@@ -76,7 +76,7 @@ class InitTabCtx extends PureComponent {
handleTestCodeFormSubmit = (cb) => {
const {form, debuggerCode} = this.props;
console.log(debuggerCode);
- form.validateFields((err, values) => {
+ form.validateFieldsAndScroll((err, values) => {
if (!err) { // 表单验证通过时,调用测试接口
cb && cb(); // 调用回调函数,切换 tab
console.log('表单值:', values);
diff --git a/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index2.js b/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index2.js
index ab9b0f34e..851262949 100644
--- a/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index2.js
+++ b/public/react/src/modules/developer/newOrEditTask/leftpane/editorTab/index2.js
@@ -1,7 +1,7 @@
/*
- * @Description:
+ * @Description:
* @Author: tangjiang
- * @Github:
+ * @Github:
* @Date: 2019-12-01 09:17:07
* @LastEditors: tangjiang
* @LastEditTime: 2019-12-02 16:33:35
@@ -46,10 +46,10 @@ const maps = {
function EditTab (props, ref) {
- const {
+ const {
form,
ojForm,
- position,
+ position,
testCases,
addTestCase,
deleteTestCase,
@@ -90,10 +90,10 @@ function EditTab (props, ref) {
// 向外暴露的方法
useImperativeHandle(ref, () => ({
validateForm () {
- props.form.validateFields((err, values) => {
+ props.form.validateFieldsAndScroll((err, values) => {
if (!err) {
getFormData(() => {
- return values;
+ return values;
});
} else {
return;
@@ -133,8 +133,8 @@ function EditTab (props, ref) {
return (
-
-
+
{myLabel(jcLabel['language'])}}
diff --git a/public/react/src/modules/developer/newOrEditTask/rightpane/initTabCtx/index.js b/public/react/src/modules/developer/newOrEditTask/rightpane/initTabCtx/index.js
index defb5e3c7..a45463432 100644
--- a/public/react/src/modules/developer/newOrEditTask/rightpane/initTabCtx/index.js
+++ b/public/react/src/modules/developer/newOrEditTask/rightpane/initTabCtx/index.js
@@ -1,7 +1,7 @@
/*
- * @Description: 显示tab中的内容
- * @Author: tangjiang
- * @Date: 2019-11-18 10:43:03
+ * @Description: 显示tab中的内容
+ * @Author: tangjiang
+ * @Date: 2019-11-18 10:43:03
* @Last Modified by: tangjiang
* @Last Modified time: 2019-11-18 11:35:12
*/
@@ -31,7 +31,7 @@ const renderUserCase = (ctx, position, props) => {
})()
}
- {/*
{
@@ -76,7 +76,7 @@ class InitTabCtx extends PureComponent {
handleTestCodeFormSubmit = (cb) => {
const {form, debuggerCode} = this.props;
// console.log(debuggerCode);
- form.validateFields((err, values) => {
+ form.validateFieldsAndScroll((err, values) => {
if (!err) { // 表单验证通过时,调用测试接口
cb && cb(); // 调用回调函数,切换 tab
// console.log('表单值:', values);
diff --git a/public/react/src/modules/developer/studentStudy/rightpane/index.js b/public/react/src/modules/developer/studentStudy/rightpane/index.js
index bebaea1e8..38387ce7b 100644
--- a/public/react/src/modules/developer/studentStudy/rightpane/index.js
+++ b/public/react/src/modules/developer/studentStudy/rightpane/index.js
@@ -1,7 +1,7 @@
/*
- * @Description:
+ * @Description:
* @Author: tangjiang
- * @Github:
+ * @Github:
* @Date: 2019-11-27 14:59:51
* @LastEditors : tangjiang
* @LastEditTime : 2020-01-02 14:23:43
@@ -18,10 +18,10 @@ import { Input, Form, Button } from 'antd';
const { TextArea } = Input;
const FormItem = Form.Item;
const RightPane = (props) => {
-
+
const {
- identifier,
- submitInput,
+ identifier,
+ submitInput,
submitUserCode,
input,
hack,
@@ -53,7 +53,7 @@ const RightPane = (props) => {
// }
// }, [hack, editor_code]);
-
+
const handleSubmitForm = () => {
// 提交时, 先调用提交接口,提交成功后,循环调用测评接口
// saveOpacityType('submit');
@@ -101,9 +101,9 @@ const RightPane = (props) => {
props.form.resetFields();
setNoteClazz('editor_nodte_area');
}
-
+
const handleSubmitNote = () => {
- props.form.validateFields((err, values) => {
+ props.form.validateFieldsAndScroll((err, values) => {
if (!err) {
changeLoadingState(true);
addNotes(identifier, values, function () {
@@ -121,7 +121,7 @@ const RightPane = (props) => {
{
onRestoreInitialCode={handleRestoreInitialCode}
/>
-
-
+
{/*
*/}
@@ -153,7 +153,7 @@ const RightPane = (props) => {
rows="5"
/>)
}
-
+
@@ -161,8 +161,8 @@ const RightPane = (props) => {
-
- {
const mapStateToProps = (state) => {
const {
- user_program_identifier,
- hack,
- userTestInput,
- editor_code,
+ user_program_identifier,
+ hack,
+ userTestInput,
+ editor_code,
notice,
hadCodeUpdate
} = state.ojForUserReducer;
@@ -192,7 +192,7 @@ const mapStateToProps = (state) => {
hadCodeUpdate,
editor_code,
input: userTestInput,
- submitInput: hack.input,
+ submitInput: hack.input,
identifier: user_program_identifier
};
}