|
@@ -49,7 +49,8 @@
|
|
|
import CoursewarePreview from '@/views/book/courseware/preview/CoursewarePreview.vue';
|
|
import CoursewarePreview from '@/views/book/courseware/preview/CoursewarePreview.vue';
|
|
|
import { isTrue } from '@/utils/validate';
|
|
import { isTrue } from '@/utils/validate';
|
|
|
|
|
|
|
|
-import { GetBookCoursewareInfo, GetTemplateChapterStructExpandList } from '@/api/project';
|
|
|
|
|
|
|
+import { GetBookCoursewareInfo } from '@/api/project';
|
|
|
|
|
+import { GetTemplateChapterStructExpandList, GetTemplateInfo } from '@/api/template';
|
|
|
import { ContentGetCoursewareContent_View } from '@/api/book';
|
|
import { ContentGetCoursewareContent_View } from '@/api/book';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -118,19 +119,49 @@ export default {
|
|
|
cover_image_file_url: '', // 封面图片URL
|
|
cover_image_file_url: '', // 封面图片URL
|
|
|
},
|
|
},
|
|
|
title_list: [],
|
|
title_list: [],
|
|
|
|
|
+ node_list: [],
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
computed: {},
|
|
computed: {},
|
|
|
watch: {},
|
|
watch: {},
|
|
|
created() {
|
|
created() {
|
|
|
if (this.id) {
|
|
if (this.id) {
|
|
|
- this.getBookCoursewareInfo(this.id);
|
|
|
|
|
- this.getCoursewareComponentContent_View(this.id);
|
|
|
|
|
|
|
+ this.getTemplateInfo(this.id);
|
|
|
|
|
+ // this.getBookCoursewareInfo(this.id);
|
|
|
|
|
+ // this.getCoursewareComponentContent_View(this.id);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
mounted() {},
|
|
mounted() {},
|
|
|
methods: {
|
|
methods: {
|
|
|
/**
|
|
/**
|
|
|
|
|
+ * 得到模板信息
|
|
|
|
|
+ * @param {string} id - 模板ID
|
|
|
|
|
+ */
|
|
|
|
|
+ getTemplateInfo(id) {
|
|
|
|
|
+ this.node_list = [];
|
|
|
|
|
+ GetTemplateInfo({ id }).then((res) => {
|
|
|
|
|
+ if (res.status === 1) {
|
|
|
|
|
+ if (res.template_info.type === 0) {
|
|
|
|
|
+ this.getBookCoursewareInfo(this.id);
|
|
|
|
|
+ this.getCoursewareComponentContent_View(this.id);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 得到模板章节结构展开列表
|
|
|
|
|
+ * @param {string} template_id - 模板ID
|
|
|
|
|
+ */
|
|
|
|
|
+ getTemplateChapterStructExpandList(template_id) {
|
|
|
|
|
+ this.node_list = [];
|
|
|
|
|
+ GetTemplateChapterStructExpandList({ template_id, is_contain_root_node: 'true' }).then((res) => {
|
|
|
|
|
+ if (res.status === 1) {
|
|
|
|
|
+ this.node_list = res.node_list;
|
|
|
|
|
+ console.log(this.node_list);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ /**
|
|
|
* 得到教材课件信息
|
|
* 得到教材课件信息
|
|
|
* @param {string} id - 课件ID
|
|
* @param {string} id - 课件ID
|
|
|
*/
|
|
*/
|