oj判断滚动

video_transcode
杨树明 5 years ago
parent 2e691ff55d
commit cb00793295

@ -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);

@ -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) => {
})(<TextArea rows={5} />)
}
</FormItem>
{/* <FormItem
{/* <FormItem
className={'input_area flex_r'}
label="输出">
{
@ -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);

@ -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 (
<AddTestDemo
key={`key_${i}`}
onSubmitTest={handleSubmitTest}
onDeleteTest={handleDeleteTest}
onSubmitTest={handleSubmitTest}
onDeleteTest={handleDeleteTest}
testCase={item}
testCaseValidate={testCasesValidate[i]}
index={i}
@ -171,9 +171,9 @@ function EditTab (props, ref) {
return (
<div className={'editor_area'}>
<Form
<Form
hideRequiredMark={true}
className={'editor_form'}
className={'editor_form'}
ref={formRef}>
<FormItem
className={`input_area flex_60`}
@ -188,7 +188,7 @@ function EditTab (props, ref) {
})(<Input placeholder="请输入任务名称"/>)
}
</FormItem>
<FormItem
className={`input_area flex_40`}
label={<span>{myLabel(jcLabel['language'])}</span>}

@ -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) => {
})(<TextArea rows={5} />)
}
</FormItem>
{/* <FormItem
{/* <FormItem
className={'input_area flex_r'}
label="输出">
{
@ -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);

@ -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) => {
<MyMonacoEditor
notice={notice}
identifier={identifier}
language={hack.language}
language={hack.language}
code={editor_code || hack.code}
hadCodeUpdate={hadCodeUpdate}
onCodeChange={handleCodeChange}
@ -129,11 +129,11 @@ const RightPane = (props) => {
onRestoreInitialCode={handleRestoreInitialCode}
/>
<span
<span
className="iconfont icon-biji student_notes"
onClick={handleClickNote}
></span>
{/* <div className="student_notes">
<TextArea rows={5} />
</div> */}
@ -153,7 +153,7 @@ const RightPane = (props) => {
rows="5"
/>)
}
</FormItem>
<FormItem style={{ textAlign: 'right' }}>
<Button loading={loading} style={{ marginRight: '10px' }} onClick={handleCancelNote}>取消</Button>
@ -161,8 +161,8 @@ const RightPane = (props) => {
</FormItem>
</Form>
</div>
<ControlSetting
<ControlSetting
identifier={identifier}
inputValue={input}
onDebuggerCode={handleDebuggerCode}
@ -174,10 +174,10 @@ 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
};
}

Loading…
Cancel
Save