mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-15 05:46:43 +08:00
课程排序
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user