dev_aliyun2
杨树林 5 years ago committed by harry
parent f17fff6114
commit e7a8139aaf

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

Loading…
Cancel
Save