|
@@ -593,7 +593,10 @@ export default {
|
|
(e) =>
|
|
(e) =>
|
|
e[moduleId * 1 || chapterId * 1 ? "sectionId" : "id"] == sectionId
|
|
e[moduleId * 1 || chapterId * 1 ? "sectionId" : "id"] == sectionId
|
|
);
|
|
);
|
|
- this.$emit("getResource", sectionItem);
|
|
|
|
|
|
+ if (sectionType == 1) {
|
|
|
|
+ this.$emit("getResource", sectionItem);
|
|
|
|
+ }
|
|
|
|
+ this.refreshList();
|
|
},
|
|
},
|
|
activeFunc(courseId, index) {
|
|
activeFunc(courseId, index) {
|
|
let { courseId: nowCourseId, courseList } = this.treeList[index];
|
|
let { courseId: nowCourseId, courseList } = this.treeList[index];
|
|
@@ -672,7 +675,7 @@ export default {
|
|
return Promise.resolve(res.data);
|
|
return Promise.resolve(res.data);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- openChapter(chapter) {
|
|
|
|
|
|
+ openChapter(chapter, isFresh = false) {
|
|
let {
|
|
let {
|
|
chapterId,
|
|
chapterId,
|
|
menuId,
|
|
menuId,
|
|
@@ -684,7 +687,7 @@ export default {
|
|
showList,
|
|
showList,
|
|
} = chapter;
|
|
} = chapter;
|
|
chapter.showList = !showList;
|
|
chapter.showList = !showList;
|
|
- if (list.length) {
|
|
|
|
|
|
+ if (list.length && !isFresh) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
this.$request
|
|
this.$request
|
|
@@ -983,9 +986,18 @@ export default {
|
|
return _data.some((section) => section.sectionId == sectionId);
|
|
return _data.some((section) => section.sectionId == sectionId);
|
|
},
|
|
},
|
|
// 刷新数据
|
|
// 刷新数据
|
|
- refreshList(){
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
+ refreshList() {
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ console.log(this.treeList[0].list, 999);
|
|
|
|
+ let { parent, courseId, menuId } = this.sectionItem;
|
|
|
|
+ if (menuId) {
|
|
|
|
+ let index = this.treeList.findIndex((e) => e.courseId == courseId);
|
|
|
|
+ this.getMenuList(this.treeList[index]);
|
|
|
|
+ } else {
|
|
|
|
+ this.openChapter(parent);
|
|
|
|
+ }
|
|
|
|
+ }, 999);
|
|
|
|
+ },
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
gradeId() {
|
|
gradeId() {
|