mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-15 13:56:43 +08:00
提交
This commit is contained in:
@@ -156,7 +156,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<div @click="checkCourse"><weikeContent :reset="weikeReset" :contents="contentInfo.list" :course="courseInfo" min-height="644px"></weikeContent></div>
|
||||
<div @click="checkCourse"><weikeContent ref="weikeContent" :reset="weikeReset" :contents="contentInfo.list" :course="courseInfo" min-height="644px"></weikeContent></div>
|
||||
</el-col>
|
||||
<!-- <el-form-item label="完成规则" v-if="!weike.onlyRequired"><el-input maxlength="50" v-model="courseInfo.passFormula" placeholder="可基于组织树或受众选择"></el-input></el-form-item> -->
|
||||
<!-- <el-form-item label="开放权限" v-if="!weike.onlyRequired"><el-input maxlength="50" v-model="courseInfo.openObject" placeholder="可基于组织树或受众选择"></el-input></el-form-item> -->
|
||||
@@ -350,7 +350,7 @@
|
||||
</div>
|
||||
</el-aside>
|
||||
<el-main style="padding: 0px;">
|
||||
<catalog-courseware :reset="onlineReset" :content="curContent" :course="courseInfo" @save="saveCurContent" @remove="delCurContent"></catalog-courseware>
|
||||
<catalog-courseware ref="courseware" :reset="onlineReset" :content="curContent" :course="courseInfo" @save="saveCurContent" @remove="delCurContent"></catalog-courseware>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-tab-pane>
|
||||
@@ -1036,7 +1036,94 @@ export default {
|
||||
this.btnLoading = false;
|
||||
});
|
||||
},
|
||||
// 判断是否有未保存的内容
|
||||
unsavedContent() {
|
||||
const courseware = this.$refs.courseware;
|
||||
let pass = true;
|
||||
if(this.curContent.id == '') {// 新增
|
||||
if(this.curContent.contentType == 60) { // 判断作业是否保存
|
||||
if(courseware.homework.content || courseware.homework.name || courseware.homework.deadTime){
|
||||
pass = false;
|
||||
}
|
||||
} else if(this.curContent.contentType == 61) { //考试
|
||||
if(courseware.examPaper.items.length>1) {
|
||||
pass = false;
|
||||
}
|
||||
if(courseware.examPaper.items[0].content != '点击编辑试题内容') {
|
||||
pass = false;
|
||||
}
|
||||
}else if(this.curContent.contentType == 41) { //图文
|
||||
if(courseware.htmlContent.length > 7){
|
||||
pass = false;
|
||||
}
|
||||
}else if(this.curContent.contentType == 52) { //外部链接
|
||||
if(courseware.linkInfo.url != '') {
|
||||
pass = false;
|
||||
}
|
||||
}
|
||||
} else {// 编辑
|
||||
if(this.curContent.contentType == 60) { // 判断作业是否保存
|
||||
if(JSON.stringify(courseware.homeworkChange) !== JSON.stringify(courseware.homework)) {
|
||||
pass = false;
|
||||
}
|
||||
} else if(this.curContent.contentType == 61) { //考试
|
||||
if(JSON.stringify(courseware.examPaper) !== JSON.stringify(courseware.examPaperChange ||
|
||||
JSON.stringify(courseware.exam)) !== JSON.stringify(courseware.examChange)) {
|
||||
pass = false;
|
||||
}
|
||||
} else if(this.curContent.contentType == 41) { //图文
|
||||
if(this.curContent.content !== courseware.htmlContent) {
|
||||
pass = false;
|
||||
}
|
||||
} else if(this.curContent.contentType == 52) { //外部链接
|
||||
if(this.curContent.content !== JSON.stringify(courseware.linkInfo)) {
|
||||
pass = false;
|
||||
}
|
||||
} else if(this.curContent.contentType == 10 || this.curContent.contentType == 20) {// 视频
|
||||
if(this.curContent.content !== JSON.stringify(courseware.curriculumData)) {
|
||||
pass = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return pass;
|
||||
},
|
||||
unsavedWeiContent() {
|
||||
// console.log(this.contentInfo.list,'contentInfo.list');
|
||||
// console.log(this.courseInfo,'courseInfo');
|
||||
// console.log(this.$refs.weikeContent,'weikeContent');
|
||||
const courseware = this.$refs.weikeContent;
|
||||
// console.log(this.catalogTree,'this.catalogTree');
|
||||
let pass = true;
|
||||
// if(this.curContent.contentType == 60) { // 判断作业是否保存
|
||||
if(JSON.stringify(courseware.homeworkChange.info) !== JSON.stringify(courseware.homework.info)) {
|
||||
pass = false;
|
||||
}
|
||||
// } else if(this.curContent.contentType == 61) { //考试
|
||||
// if(JSON.stringify(courseware.exam.info) !== JSON.stringify(courseware.examChange.info)) {
|
||||
// console.log("2222");
|
||||
// pass = false;
|
||||
// }
|
||||
// } else {
|
||||
// if(courseware.cware.content.content !== courseware.cwareChange.content.content) {
|
||||
// console.log('333');
|
||||
// pass = false;
|
||||
// }
|
||||
// if(courseware.cware.linkInfo.content !== courseware.cwareChange.content.content) {
|
||||
// console.log('333');
|
||||
// pass = false;
|
||||
// }
|
||||
// }
|
||||
return pass;
|
||||
},
|
||||
submitCourse() {
|
||||
if(this.biaoke.dlgShow && !this.unsavedContent()){
|
||||
this.$message.error('您有未保存的内容,请先保存');
|
||||
return;
|
||||
}
|
||||
if(this.weike.dlgShow && !this.unsavedWeiContent()){
|
||||
this.$message.error('您有未保存的内容,请先保存');
|
||||
return;
|
||||
}
|
||||
//console.log(this.resOwnerListMap[0],'this.resOwnerListMap[0]');
|
||||
//return;
|
||||
let ownerCode=this.resOwnerListMap[0].code;
|
||||
|
||||
Reference in New Issue
Block a user