添加考试后提交检查问题解决

This commit is contained in:
daihh
2022-12-28 21:48:29 +08:00
parent 2fff00135c
commit 63b097677d
3 changed files with 15 additions and 13 deletions

View File

@@ -526,7 +526,7 @@
}) })
}, },
saveExam(examInfo){ saveExam(examInfo){
console.log('保存考试配置'); //console.log('保存考试配置');
//这里只是61考试 //这里只是61考试
this.content.courseId=this.course.id; this.content.courseId=this.course.id;
this.content.sortIndex=this.addOrder; this.content.sortIndex=this.addOrder;

View File

@@ -1212,20 +1212,22 @@ export default {
// 判断是否有未保存的内容 // 判断是否有未保存的内容
unsavedContent() { unsavedContent() {
const courseware = this.$refs.courseware; const courseware = this.$refs.courseware;
console.log(courseware,'courseware'); //console.log(courseware,'courseware');
let pass = true; let pass = true;
if(this.curContent.id == '') {// 新增 if(this.curContent.id == '') {// 新增
if(this.curContent.contentType == 60) { // 判断作业是否保存 if(this.curContent.contentType == 60) { // 判断作业是否保存
if(courseware.homework.content || courseware.homework.name || courseware.homework.deadTime){ if(courseware.homework.content || courseware.homework.name || courseware.homework.deadTime){
pass = false; pass = false;
} }
} else if(this.curContent.contentType == 61) { //考试 } else if(this.curContent.contentType == 61) { //考试
if(courseware.exam.paperContent != '') {
pass = false; // if(courseware.exam.paperContent != '') {
} // pass = false;
if(courseware.examPaper.items.length >0) { // }
pass = false; // if(courseware.examPaper.items.length >0) {
} // pass = false;
// }
}else if(this.curContent.contentType == 41) { //图文 }else if(this.curContent.contentType == 41) { //图文
if(courseware.htmlContent.length > 7){ if(courseware.htmlContent.length > 7){
pass = false; pass = false;
@@ -1241,9 +1243,10 @@ export default {
pass = false; pass = false;
} }
} else if(this.curContent.contentType == 61) { //考试 } else if(this.curContent.contentType == 61) { //考试
if(courseware.exam.paperContent !== courseware.examChange.paperContent || JSON.stringify(courseware.examPaper) != JSON.stringify(courseware.examPaperChange)) { // console.log(courseware.exam,'courseware.exam');
pass = false; // if(courseware.exam.paperContent !== courseware.examChange.paperContent || JSON.stringify(courseware.examPaper) != JSON.stringify(courseware.examPaperChange)) {
} // pass = false;
// }
} else if(this.curContent.contentType == 41) { //图文 } else if(this.curContent.contentType == 41) { //图文
if(this.curContent.content !== courseware.htmlContent) { if(this.curContent.content !== courseware.htmlContent) {
pass = false; pass = false;
@@ -1297,7 +1300,6 @@ export default {
return; return;
} }
if(this.weike.dlgShow && !this.unsavedWeiContent()){ if(this.weike.dlgShow && !this.unsavedWeiContent()){
return; return;
} }

View File

@@ -778,7 +778,7 @@ export default {
this.$refs.comEditPaper.show(row.paperId); this.$refs.comEditPaper.show(row.paperId);
}, },
open(row,flag) { open(row,flag) {
this.$confirm('确定要下架考试?', '提示', { this.$confirm('确定要下架考试?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'