|
|
|
@ -142,7 +142,7 @@ export const validateOjForm = (props, type, cb) => {
|
|
|
|
|
let validateResult = emptyValidate(key, value);
|
|
|
|
|
const errMsg = validateResult[key].errMsg;
|
|
|
|
|
if (errMsg) {
|
|
|
|
|
// hasSuccess = false;
|
|
|
|
|
hasSuccess = false;
|
|
|
|
|
} else {
|
|
|
|
|
// 唯一性校验
|
|
|
|
|
const bool = testCases.some((item, j) => {
|
|
|
|
@ -167,38 +167,7 @@ export const validateOjForm = (props, type, cb) => {
|
|
|
|
|
});
|
|
|
|
|
tcValidResult.push(tempObj);
|
|
|
|
|
});
|
|
|
|
|
try {
|
|
|
|
|
if(ojForm.sub_discipline_id.length===0){
|
|
|
|
|
hasSuccess = false;
|
|
|
|
|
notification['error']({
|
|
|
|
|
message: '提示',
|
|
|
|
|
description: '课程必须选择!'
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}else if(ojForm.timeLimit===null){
|
|
|
|
|
hasSuccess = false;
|
|
|
|
|
notification['error']({
|
|
|
|
|
message: '提示',
|
|
|
|
|
description: '时间限制必须输入!'
|
|
|
|
|
});
|
|
|
|
|
} else if(ojForm.name.length===0){
|
|
|
|
|
hasSuccess = false;
|
|
|
|
|
notification['error']({
|
|
|
|
|
message: '提示',
|
|
|
|
|
description: '任务名称必须输入!'
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}else if(ojForm.description.length===0){
|
|
|
|
|
hasSuccess = false;
|
|
|
|
|
notification['error']({
|
|
|
|
|
message: '提示',
|
|
|
|
|
description: '描述必须输入!'
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (testCases.length === 0) {
|
|
|
|
|
// hasSuccess = false;
|
|
|
|
@ -233,6 +202,43 @@ export const validateOjForm = (props, type, cb) => {
|
|
|
|
|
payload: false
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
if(ojForm.sub_discipline_id.length===0){
|
|
|
|
|
hasSuccess = false;
|
|
|
|
|
notification['error']({
|
|
|
|
|
message: '提示',
|
|
|
|
|
description: '课程必须选择!'
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}else if(ojForm.timeLimit===null){
|
|
|
|
|
hasSuccess = false;
|
|
|
|
|
notification['error']({
|
|
|
|
|
message: '提示',
|
|
|
|
|
description: '时间限制必须输入!'
|
|
|
|
|
});
|
|
|
|
|
} else if(ojForm.name.length===0){
|
|
|
|
|
hasSuccess = false;
|
|
|
|
|
notification['error']({
|
|
|
|
|
message: '提示',
|
|
|
|
|
description: '任务名称必须输入!'
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}else if(ojForm.description.length===0){
|
|
|
|
|
hasSuccess = false;
|
|
|
|
|
notification['error']({
|
|
|
|
|
message: '提示',
|
|
|
|
|
description: '描述必须输入!'
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 表单验证结束 */
|
|
|
|
|
/** 表单验证通过后,调用保存 or 更新 or 发布 */
|
|
|
|
|
if (hasSuccess) {
|
|
|
|
|