Merge branch 'master' of codeup.aliyun.com:6265f483e4166464dc2f9c14/boeu/portal

This commit is contained in:
dongruihua
2022-09-23 18:05:52 +08:00
3 changed files with 31 additions and 5 deletions

View File

@@ -355,6 +355,10 @@
}, },
course:{ course:{
type: Object, type: Object,
},
addOrder:{
type:Number,
default:1
} }
}, },
components:{chooseCourseFile,WxEditor,courseHomework,courseExam,simplePaper,fileUpload,pdfPreview,audioPlayer,videoPlayer}, components:{chooseCourseFile,WxEditor,courseHomework,courseExam,simplePaper,fileUpload,pdfPreview,audioPlayer,videoPlayer},
@@ -567,7 +571,8 @@
saveData() { saveData() {
//执行成功后调用外部方法 //执行成功后调用外部方法
this.content.courseId=this.course.id; this.content.courseId=this.course.id;
this.content.sortIndex=1;//先设置为 // this.content.sortIndex=1;//先设置为
this.content.sortIndex=this.addOrder;
if(this.content.contentType==41){ if(this.content.contentType==41){
//对图文的处理 //对图文的处理
this.content.content=this.htmlContent; this.content.content=this.htmlContent;

View File

@@ -343,7 +343,7 @@
</div> </div>
</el-aside> </el-aside>
<el-main style="padding: 0px;"> <el-main style="padding: 0px;">
<catalog-courseware ref="courseware" :reset="onlineReset" :content="curContent" :course="courseInfo" @save="saveCurContent" @remove="delCurContent"></catalog-courseware> <catalog-courseware ref="courseware" :reset="onlineReset" :content="curContent" :addOrder="addOrder" :course="courseInfo" @save="saveCurContent" @remove="delCurContent"></catalog-courseware>
</el-main> </el-main>
</el-container> </el-container>
</el-tab-pane> </el-tab-pane>
@@ -401,6 +401,7 @@ export default {
components: { weikeContent, catalogCourseware, imageUpload, WxEditor, catalogSort,agreement,filecloud,choice,chooseOrg}, components: { weikeContent, catalogCourseware, imageUpload, WxEditor, catalogSort,agreement,filecloud,choice,chooseOrg},
data() { data() {
return { return {
addOrder:1,
checked:false, checked:false,
courseInfoFormCheckedShow:false, courseInfoFormCheckedShow:false,
orgChooseShow:false, orgChooseShow:false,
@@ -954,8 +955,24 @@ export default {
//设置状态 //设置状态
}, },
addNewContent(sec) { addNewContent(sec) {
console.log(sec,'sec');
this.resetCurCourseContent(); this.resetCurCourseContent();
this.curContent.csectionId = sec.id; this.curContent.csectionId = sec.id;
this.orderValue(sec.id);
},
// 计算新增节的顺序
orderValue(id) {
let cha = this.catalogTree.find(item=>{return item.section.id == id});
let order = [];
if(cha.contents.length > 0) {
cha.contents.forEach(con=>{
order.push(con.sortIndex);
})
let addOrder = order.sort(function(a,b) {return b-a;})
this.addOrder = addOrder[0] + 1;
} else {
this.addOrder = 1;
}
}, },
// 控制 过滤 // 控制 过滤
deviceFilter(num) { deviceFilter(num) {

View File

@@ -447,8 +447,10 @@ export default {
this.course[i] = ""; this.course[i] = "";
if (i === "sysType1") { if (i === "sysType1") {
this.types.sysTypes = ""; this.types.sysTypes = "";
// this.types.oneSubList = []; this.types.subOne = "";
// this.types.towSubList = []; this.types.subTow = "";
this.types.oneSubList = [];
this.types.towSubList = [];
} }
if (i === "sysType2") { if (i === "sysType2") {
this.types.subOne = ""; this.types.subOne = "";
@@ -492,6 +494,8 @@ export default {
list = this.optionsList.find(item => { list = this.optionsList.find(item => {
return item.id === num; return item.id === num;
}); });
} else {
// this.types.towSubList = [];
} }
if (list && list.children) { if (list && list.children) {
this.types.oneSubList = list.children; this.types.oneSubList = list.children;
@@ -510,7 +514,7 @@ export default {
} }
}); });
} else { } else {
this.types.oneSubList = []; this.types.towSubList = [];
} }
this.searchData(); this.searchData();
}, },