From a9a74219b5aeba62e716e21ea0c700b5224a0245 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sun, 8 Mar 2020 00:55:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/redux/actions/ojForm.js | 40 +++++++++++++++++++----- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/public/react/src/redux/actions/ojForm.js b/public/react/src/redux/actions/ojForm.js index 61472e002..05c28b07d 100644 --- a/public/react/src/redux/actions/ojForm.js +++ b/public/react/src/redux/actions/ojForm.js @@ -167,14 +167,40 @@ 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(ojForm.timeLimit===null){ - hasSuccess = false; - notification['error']({ - message: '提示', - description: '时间限制必须输入!' - }); - } // if (testCases.length === 0) { // hasSuccess = false; // notification['error']({