Merge remote-tracking branch 'origin/dev_aliyun' into dev_aliyun

video_transcode
杨树明 5 years ago
commit 854c7efed9

@ -1,7 +1,7 @@
/*
* @Description: 添加测试用例
* @Author: tangjiang
* @Github:
* @Github:
* @Date: 2019-11-21 09:19:38
* @LastEditors : tangjiang
* @LastEditTime : 2019-12-27 10:37:41
@ -19,14 +19,14 @@ const AddTestDemo = (props) => {
const {
// key,
// onSubmitTest,
onDeleteTest,
onDeleteTest,
testCase,
testCaseValidate,
isOpen
} = props;
// const [isEditor, setIsEditor] = useState(false); // 是否是编辑
// 删除操作
const handleDeletePanel = (e) => {
// console.log('点击的删除按钮')
@ -63,7 +63,7 @@ const AddTestDemo = (props) => {
const value = e.target.value;
testCaseOutputChange(value, index);
}
// 右侧删除图标
const genExtra = () => (
<Icon
@ -127,7 +127,7 @@ const AddTestDemo = (props) => {
* 文本输入框可编辑的情况
* 1. 新增时
* 2. isAdd false isEditor 为true
* @param {*} testCase
* @param {*} testCase
*/
// const isDisabled = (testCase) => {
// return !testCase.isAdd && !isEditor;
@ -138,21 +138,19 @@ const AddTestDemo = (props) => {
// defaultActiveKey: [isOpen ? '1' : '']
// };
// console.log(activePane);
// 切换手风琴
const handleChangeCollapse = () => {
const {index, updateOpenTestCaseIndex} = props;
updateOpenTestCaseIndex(index);
}
return (
<Collapse className={'collapse_area'} activeKey={isOpen?'1':''} onChange={() => handleChangeCollapse()}>
<Panel header={`测试用例${props.index + 1}`} extra={genExtra()} key="1">
<Form>
<FormItem
label={<span className={'label_text'}>输入</span>}
validateStatus={testCaseValidate.input.validateStatus}
help={testCaseValidate.input.errMsg}
colon={ false }
>
<TextArea
@ -164,8 +162,6 @@ const AddTestDemo = (props) => {
</FormItem>
<FormItem
label={<span className={'label_text'}>输出</span>}
validateStatus={testCaseValidate.output.validateStatus}
help={testCaseValidate.output.errMsg}
colon={ false }
>
<TextArea

@ -1,14 +1,14 @@
/*
* @Description: 开发者社区编辑模块
* @Author: tangjiang
* @Github:
* @Github:
* @Date: 2019-11-20 16:35:46
* @LastEditors : tangjiang
* @LastEditTime : 2020-02-11 16:29:32
*/
import types from './actionTypes';
import CONST from '../../constants';
import {
import {
fetchPostOjForm,
fetchGetOjById,
publishTask,
@ -18,7 +18,7 @@ import {
} from '../../services/ojService';
import { Base64 } from 'js-base64';
import { notification } from 'antd';
import { toStore } from 'educoder';
import { toStore } from 'educoder';
// import { startProgramQuestion } from ''
const { jcLabel } = CONST;
// 表单字段映射
@ -124,7 +124,7 @@ export const validateOjForm = (props, type, cb) => {
hasSuccess = false;
dispatch(
{
type: maps[key].type,
type: maps[key].type,
payload: payloadInfo(key, value, errMsg, validateResult[key])
}
)
@ -168,14 +168,14 @@ export const validateOjForm = (props, type, cb) => {
tcValidResult.push(tempObj);
});
if (testCases.length === 0) {
hasSuccess = false;
notification['error']({
message: '提示',
description: '测试用例必须输入!'
});
}
// if (testCases.length === 0) {
// hasSuccess = false;
// notification['error']({
// message: '提示',
// description: '测试用例必须输入!'
// });
// }
// if (!code) {
// hasSuccess = false;
// notification['error']({
@ -300,7 +300,7 @@ export const validateOjForm = (props, type, cb) => {
cb && cb();
} else {
const {identifier} = res.data;
// message.success(paramsObj['submitType'] === 'update' ? '更新成功' : '保存成功');
notification.success({
message: '提示',
@ -311,7 +311,7 @@ export const validateOjForm = (props, type, cb) => {
type: types.SAVE_OJ_FORM_ID,
payload: identifier
});
// console.log(identifier , props.identifier);
if (identifier || props.identifier) {
dispatch(getOJFormById(identifier || props.identifier));
@ -443,7 +443,7 @@ export const saveOjFormCode = (value) => {
payload: value
};
}
// 验证任务名称
// 验证任务名称
export const validateOJName = (value) => {
const validate = emptyValidate('name', value)['name'];
const errMsg = validate.errMsg;
@ -735,9 +735,9 @@ export const saveKnowledge = (values) => {
}
/**
* 新增时跳转到OJ时带的默认参数:
* @param {}} params
* {
* 新增时跳转到OJ时带的默认参数:
* @param {}} params
* {
* difficult: '', // 难易度
* sub_discipline_id: '' // 课程方向
* tag_discipline_id [] 知识点
@ -767,7 +767,7 @@ export const tagDisciplines = (params) => {
}
});
}
}
}
// 保存地址栏参数
export const saveSearchParams = (params) => {

Loading…
Cancel
Save