Merge pull request '作业管理:作业名称为空保存判断' (#111) from baigl into main

Reviewed-on: #111
This commit is contained in:
baigl 2024-12-11 14:55:07 +08:00
commit 44b341f7ac
2 changed files with 15 additions and 2 deletions

View File

@ -703,6 +703,7 @@ const handleClassWorkSave = async () => {
entpcourseworklist: '', // list entpcourseworklist: '', // list
}; };
if(cform.uniquekey.trim() == '') return ElMessage({ type: 'warning', message: '作业名称不能为空!'});
// [] newWorkSpaceEdit true // [] newWorkSpaceEdit true
if(classWorkForm.id != '' ) {// id if(classWorkForm.id != '' ) {// id
@ -741,6 +742,7 @@ const handleClassWorkSave = async () => {
} }
} }
else if(classWorkForm.worktype === "常规作业"){ else if(classWorkForm.worktype === "常规作业"){
if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请上传常规作业附件!'});
fileLoading.value = true fileLoading.value = true
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList); cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);
cform.entpcourseworklist = JSON.stringify([{'id':-2, 'score': '10'}]); cform.entpcourseworklist = JSON.stringify([{'id':-2, 'score': '10'}]);
@ -832,7 +834,12 @@ const editWork = async (cform) =>{
} }
}else if (classWorkForm.worktype == '课堂展示' || classWorkForm.worktype == '常规作业') { }else if (classWorkForm.worktype == '课堂展示' || classWorkForm.worktype == '常规作业') {
// //
//
if(classWorkForm.worktype == '课堂展示'){
//
}else{
if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请上传常规作业附件!'});
}
}else { }else {
if (classWorkForm.chooseWorkLists.length == 0) { if (classWorkForm.chooseWorkLists.length == 0) {
// //

View File

@ -489,6 +489,7 @@ const handleClassWorkFormQuizRemove = (index) =>{
entpcourseworklist: '', // list entpcourseworklist: '', // list
}; };
if(cform.uniquekey.trim() == '') return ElMessage({ type: 'warning', message: '作业名称不能为空!'});
// [] newWorkSpaceEdit true // [] newWorkSpaceEdit true
if(isShow.value === false){ if(isShow.value === false){
@ -530,6 +531,7 @@ const handleClassWorkFormQuizRemove = (index) =>{
} }
} }
else if(classWorkForm.worktype === "常规作业"){ else if(classWorkForm.worktype === "常规作业"){
if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请上传常规作业附件!'});
fileLoading.value = true fileLoading.value = true
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList); cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);
cform.entpcourseworklist = JSON.stringify([{'id':-2, 'score': '10'}]); cform.entpcourseworklist = JSON.stringify([{'id':-2, 'score': '10'}]);
@ -634,7 +636,11 @@ const editWork = async (cform) =>{
} }
}else if (classWorkForm.worktype == '课堂展示' || classWorkForm.worktype == '常规作业') { }else if (classWorkForm.worktype == '课堂展示' || classWorkForm.worktype == '常规作业') {
// //
if(classWorkForm.worktype == '课堂展示'){
//
}else{
if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请上传常规作业附件!'});
}
}else { }else {
if (classWorkForm.chooseWorkLists.length == 0) { if (classWorkForm.chooseWorkLists.length == 0) {
// //