|
@@ -111,11 +111,11 @@
|
|
|
<SvgIcon icon-class="catalogue" size="54" />
|
|
<SvgIcon icon-class="catalogue" size="54" />
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <main :class="['preview-main', { 'no-audit': !isShowAudit }]" :style="computedCommonPreviewStyle()">
|
|
|
|
|
|
|
+ <main :class="['preview-main', { 'no-audit': !isShowAudit }]" :style="computedCommonPreviewStyle">
|
|
|
<div class="preview-left" :style="{ backgroundColor: background.background?.is_global ? '' : '#fff' }"></div>
|
|
<div class="preview-left" :style="{ backgroundColor: background.background?.is_global ? '' : '#fff' }"></div>
|
|
|
<CoursewarePreview
|
|
<CoursewarePreview
|
|
|
v-if="courseware_info.book_name"
|
|
v-if="courseware_info.book_name"
|
|
|
- ref="courserware"
|
|
|
|
|
|
|
+ ref="courseware"
|
|
|
:is-show-group="isShowGroup"
|
|
:is-show-group="isShowGroup"
|
|
|
:group-show-all="groupShowAll"
|
|
:group-show-all="groupShowAll"
|
|
|
:group-row-list="content_group_row_list"
|
|
:group-row-list="content_group_row_list"
|
|
@@ -516,6 +516,7 @@ import {
|
|
|
import { toggleFullScreen } from '@/utils/common';
|
|
import { toggleFullScreen } from '@/utils/common';
|
|
|
import * as OpenCC from 'opencc-js';
|
|
import * as OpenCC from 'opencc-js';
|
|
|
import { isTrue } from '@/utils/validate';
|
|
import { isTrue } from '@/utils/validate';
|
|
|
|
|
+import { buildCoursewareStyle } from '@/views/book/courseware/preview/common/utils/coursewareStyle';
|
|
|
import { CreateCoursewarePreviewURL } from '@/api/app';
|
|
import { CreateCoursewarePreviewURL } from '@/api/app';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -742,6 +743,9 @@ export default {
|
|
|
if (this.dialogType === 2) return '反馈';
|
|
if (this.dialogType === 2) return '反馈';
|
|
|
return '笔记';
|
|
return '笔记';
|
|
|
},
|
|
},
|
|
|
|
|
+ computedCommonPreviewStyle() {
|
|
|
|
|
+ return buildCoursewareStyle(this.background, 'commonPreview');
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
|
isJudgeCorrect(newVal) {
|
|
isJudgeCorrect(newVal) {
|
|
@@ -1020,7 +1024,7 @@ export default {
|
|
|
this.submit_loading = false;
|
|
this.submit_loading = false;
|
|
|
this.visibleRemark = false;
|
|
this.visibleRemark = false;
|
|
|
this.getCoursewareAuditRemarkList(id || this.id);
|
|
this.getCoursewareAuditRemarkList(id || this.id);
|
|
|
- this.$refs.courserware.resetRemark();
|
|
|
|
|
|
|
+ this.$refs.courseware.resetRemark();
|
|
|
})
|
|
})
|
|
|
.catch(() => {
|
|
.catch(() => {
|
|
|
this.submit_loading = false;
|
|
this.submit_loading = false;
|
|
@@ -1029,7 +1033,7 @@ export default {
|
|
|
// 关闭审核批注弹窗
|
|
// 关闭审核批注弹窗
|
|
|
closeVisibleRemark() {
|
|
closeVisibleRemark() {
|
|
|
this.visibleRemark = false;
|
|
this.visibleRemark = false;
|
|
|
- this.$refs.courserware.resetRemark();
|
|
|
|
|
|
|
+ this.$refs.courseware.resetRemark();
|
|
|
},
|
|
},
|
|
|
// 删除批注
|
|
// 删除批注
|
|
|
deleteRemarks(id) {
|
|
deleteRemarks(id) {
|
|
@@ -1049,7 +1053,7 @@ export default {
|
|
|
// 定位批注
|
|
// 定位批注
|
|
|
async handleLocationRemarks(offsetTop) {
|
|
async handleLocationRemarks(offsetTop) {
|
|
|
// if (componentId) {
|
|
// if (componentId) {
|
|
|
- // let node = await this.$refs.courserware.findChildComponentByKey(componentId);
|
|
|
|
|
|
|
+ // let node = await this.$refs.courseware.findChildComponentByKey(componentId);
|
|
|
// if (node) {
|
|
// if (node) {
|
|
|
await this.$nextTick();
|
|
await this.$nextTick();
|
|
|
this.$refs.previewMain.scrollTo({
|
|
this.$refs.previewMain.scrollTo({
|
|
@@ -1062,7 +1066,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
// 计算previewMain滑动距离
|
|
// 计算previewMain滑动距离
|
|
|
computeScroll() {
|
|
computeScroll() {
|
|
|
- this.$refs.courserware.handleResult(
|
|
|
|
|
|
|
+ this.$refs.courseware.handleResult(
|
|
|
this.$refs.previewMain.scrollTop,
|
|
this.$refs.previewMain.scrollTop,
|
|
|
this.$refs.previewMain.scrollLeft,
|
|
this.$refs.previewMain.scrollLeft,
|
|
|
this.select_node,
|
|
this.select_node,
|
|
@@ -1105,7 +1109,7 @@ export default {
|
|
|
let [nodeId, componentId] = data.split('#');
|
|
let [nodeId, componentId] = data.split('#');
|
|
|
if (nodeId) this.selectNode(nodeId);
|
|
if (nodeId) this.selectNode(nodeId);
|
|
|
if (componentId) {
|
|
if (componentId) {
|
|
|
- let node = await this.$refs.courserware.findChildComponentByKey(componentId);
|
|
|
|
|
|
|
+ let node = await this.$refs.courseware.findChildComponentByKey(componentId);
|
|
|
if (node) {
|
|
if (node) {
|
|
|
await this.$nextTick();
|
|
await this.$nextTick();
|
|
|
this.$refs.previewMain.scrollTo({
|
|
this.$refs.previewMain.scrollTo({
|
|
@@ -1243,7 +1247,7 @@ export default {
|
|
|
async handleFileClick(courseware_id, component_id) {
|
|
async handleFileClick(courseware_id, component_id) {
|
|
|
if (courseware_id) this.selectNode(courseware_id);
|
|
if (courseware_id) this.selectNode(courseware_id);
|
|
|
if (component_id) {
|
|
if (component_id) {
|
|
|
- let node = await this.$refs.courserware.findChildComponentByKey(component_id);
|
|
|
|
|
|
|
+ let node = await this.$refs.courseware.findChildComponentByKey(component_id);
|
|
|
if (node) {
|
|
if (node) {
|
|
|
await this.$nextTick();
|
|
await this.$nextTick();
|
|
|
this.$refs.previewMain.scrollTo({
|
|
this.$refs.previewMain.scrollTo({
|
|
@@ -1310,7 +1314,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
simulateAnswer(disabled = true) {
|
|
simulateAnswer(disabled = true) {
|
|
|
- this.$refs.courserware.simulateAnswer(this.isJudgeCorrect, this.isShowAnswer, disabled);
|
|
|
|
|
|
|
+ this.$refs.courseware.simulateAnswer(this.isJudgeCorrect, this.isShowAnswer, disabled);
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -1325,7 +1329,7 @@ export default {
|
|
|
this.selectNode(nodeId);
|
|
this.selectNode(nodeId);
|
|
|
this.isShowGroup = false;
|
|
this.isShowGroup = false;
|
|
|
this.groupShowAll = true;
|
|
this.groupShowAll = true;
|
|
|
- this.$refs.courserware.clearRowCheckList();
|
|
|
|
|
|
|
+ this.$refs.courseware.clearRowCheckList();
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
|
* 计算章节名称样式
|
|
* 计算章节名称样式
|
|
@@ -1403,9 +1407,9 @@ export default {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (this.$refs.courserware && this.$refs.courserware.handleLocation) {
|
|
|
|
|
|
|
+ if (this.$refs.courseware && this.$refs.courseware.handleLocation) {
|
|
|
item.type = type;
|
|
item.type = type;
|
|
|
- this.$refs.courserware.handleLocation(item);
|
|
|
|
|
|
|
+ this.$refs.courseware.handleLocation(item);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -1754,10 +1758,10 @@ export default {
|
|
|
* @returns {object} 选中分组行的课件信息
|
|
* @returns {object} 选中分组行的课件信息
|
|
|
*/
|
|
*/
|
|
|
computedSelectedGroupCoursewareInfo() {
|
|
computedSelectedGroupCoursewareInfo() {
|
|
|
- return this.$refs.courserware.computedSelectedGroupCoursewareInfo();
|
|
|
|
|
|
|
+ return this.$refs.courseware.computedSelectedGroupCoursewareInfo();
|
|
|
},
|
|
},
|
|
|
saveCoursewareStyleTemplate(data) {
|
|
saveCoursewareStyleTemplate(data) {
|
|
|
- return this.$refs.courserware.saveCoursewareStyleTemplate(data);
|
|
|
|
|
|
|
+ return this.$refs.courseware.saveCoursewareStyleTemplate(data);
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
async submitChapterAllCoursewareToAuditFlow(chapter_id) {
|
|
async submitChapterAllCoursewareToAuditFlow(chapter_id) {
|
|
@@ -1792,9 +1796,6 @@ export default {
|
|
|
this.$set(component, 'background', background);
|
|
this.$set(component, 'background', background);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- computedCommonPreviewStyle() {
|
|
|
|
|
- return this.$refs.courserware?.computedCourserwareStyle('commonPreview');
|
|
|
|
|
- },
|
|
|
|
|
/**
|
|
/**
|
|
|
* 获取 main-container 视口内第一个可见的组件 id
|
|
* 获取 main-container 视口内第一个可见的组件 id
|
|
|
* @returns {string} 第一个可见组件 id;不存在时返回空字符串
|
|
* @returns {string} 第一个可见组件 id;不存在时返回空字符串
|