|
|
@@ -35,8 +35,8 @@
|
|
|
</div>
|
|
|
<div class="audit-content" :class="[type && type !== 'personal' ? 'audit-content_org' : '']">
|
|
|
<div ref="previewMain" class="main-container" :style="{ paddingLeft: '0', paddingRight: '0' }">
|
|
|
- <main :class="['preview-main', { 'no-audit': !isShowAudit }]">
|
|
|
- <div class="preview-left"></div>
|
|
|
+ <main :class="['preview-main', { 'no-audit': !isShowAudit }]" :style="computedCommonPreviewStyle">
|
|
|
+ <div class="preview-left" :style="{ backgroundColor: background.background?.is_global ? '' : '#fff' }"></div>
|
|
|
<CoursewarePreview
|
|
|
v-if="courseware_info.book_name || courseware_info.name"
|
|
|
ref="courseware"
|
|
|
@@ -52,7 +52,7 @@
|
|
|
:component-remark-obj="{}"
|
|
|
:project="project"
|
|
|
/>
|
|
|
- <div class="preview-right"></div>
|
|
|
+ <div class="preview-right" :style="{ backgroundColor: background.background?.is_global ? '' : '#fff' }"></div>
|
|
|
</main>
|
|
|
</div>
|
|
|
<div v-if="!sidebarShow" class="back-top" @click="backTop">
|
|
|
@@ -64,11 +64,12 @@
|
|
|
|
|
|
<script>
|
|
|
import CoursewarePreview from '@/views/book/courseware/preview/CoursewarePreview.vue';
|
|
|
-import { isTrue } from '@/utils/validate';
|
|
|
|
|
|
+import { isTrue } from '@/utils/validate';
|
|
|
import { GetBookCoursewareInfo } from '@/api/project';
|
|
|
import { GetTemplateChapterStructExpandList, GetTemplateInfo } from '@/api/template';
|
|
|
-import { ContentGetCoursewareContent_View } from '@/api/book';
|
|
|
+import { ContentGetCoursewareContent_View, GetCoursewareBackground } from '@/api/book';
|
|
|
+import { buildCoursewareStyle } from '@/views/book/courseware/preview/common/utils/coursewareStyle';
|
|
|
|
|
|
export default {
|
|
|
name: 'CommonPreview',
|
|
|
@@ -150,7 +151,11 @@ export default {
|
|
|
is_can_edit: 'false', // 是否可以编辑
|
|
|
};
|
|
|
},
|
|
|
- computed: {},
|
|
|
+ computed: {
|
|
|
+ computedCommonPreviewStyle() {
|
|
|
+ return buildCoursewareStyle(this.background, 'commonPreview');
|
|
|
+ },
|
|
|
+ },
|
|
|
watch: {},
|
|
|
created() {
|
|
|
if (this.id) {
|
|
|
@@ -228,21 +233,24 @@ export default {
|
|
|
},
|
|
|
);
|
|
|
},
|
|
|
+ getCoursewareBackground(id) {
|
|
|
+ GetCoursewareBackground({ id }).then(({ background }) => {
|
|
|
+ if (background) {
|
|
|
+ this.background = JSON.parse(background);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
/**
|
|
|
* 得到课件内容(展示内容)
|
|
|
* @param {string} id - 课件ID
|
|
|
*/
|
|
|
getCoursewareComponentContent_View(id) {
|
|
|
+ this.getCoursewareBackground(id);
|
|
|
ContentGetCoursewareContent_View({ id }).then(
|
|
|
({ content, component_list, content_group_row_list, title_list }) => {
|
|
|
if (content) {
|
|
|
const _content = JSON.parse(content);
|
|
|
this.data = _content;
|
|
|
- this.background = {
|
|
|
- background_image_url: _content.background_image_url,
|
|
|
- background_position: _content.background_position,
|
|
|
- background: _content.background,
|
|
|
- };
|
|
|
} else {
|
|
|
this.data = { row_list: [] };
|
|
|
}
|