|
@@ -15,14 +15,24 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="audit-content">
|
|
<div class="audit-content">
|
|
- <div class="main-container">
|
|
|
|
|
|
+ <div class="main-container" ref="previewMain">
|
|
<main :class="['preview-main', { 'no-audit': !isShowAudit }]">
|
|
<main :class="['preview-main', { 'no-audit': !isShowAudit }]">
|
|
<span class="title">
|
|
<span class="title">
|
|
<SvgIcon icon-class="menu-2" size="24" />
|
|
<SvgIcon icon-class="menu-2" size="24" />
|
|
<span>{{ courseware_info.name_path }}</span>
|
|
<span>{{ courseware_info.name_path }}</span>
|
|
</span>
|
|
</span>
|
|
-
|
|
|
|
- <CoursewarePreview :data="data" :component-list="component_list" :background="background" />
|
|
|
|
|
|
+ <CoursewarePreview
|
|
|
|
+ :data="data"
|
|
|
|
+ :component-list="component_list"
|
|
|
|
+ :background="background"
|
|
|
|
+ :can-remark="isTrue(courseware_info.is_my_audit_task) && isTrue(courseware_info.is_can_add_audit_remark)"
|
|
|
|
+ :show-remark="isShowAudit"
|
|
|
|
+ :component-remark-obj="remark_list_obj"
|
|
|
|
+ @computeScroll="computeScroll"
|
|
|
|
+ @addRemark="addRemark"
|
|
|
|
+ ref="courserware"
|
|
|
|
+ v-if="courseware_info.book_name"
|
|
|
|
+ />
|
|
</main>
|
|
</main>
|
|
</div>
|
|
</div>
|
|
<div v-if="isShowAudit" class="remark-list">
|
|
<div v-if="isShowAudit" class="remark-list">
|
|
@@ -70,6 +80,7 @@
|
|
import CoursewarePreview from '@/views/book/courseware/preview/CoursewarePreview.vue';
|
|
import CoursewarePreview from '@/views/book/courseware/preview/CoursewarePreview.vue';
|
|
import MenuPopover from '@/views/personal_workbench/common/MenuPopover.vue';
|
|
import MenuPopover from '@/views/personal_workbench/common/MenuPopover.vue';
|
|
import RichText from '@/components/RichText.vue';
|
|
import RichText from '@/components/RichText.vue';
|
|
|
|
+import { isTrue } from '@/utils/common';
|
|
|
|
|
|
import {
|
|
import {
|
|
GetBookCoursewareInfo,
|
|
GetBookCoursewareInfo,
|
|
@@ -137,9 +148,16 @@ export default {
|
|
data: { row_list: [] },
|
|
data: { row_list: [] },
|
|
component_list: [],
|
|
component_list: [],
|
|
remark_list: [],
|
|
remark_list: [],
|
|
|
|
+ remark_list_obj: {}, // 存放转为以组件为对象的数组
|
|
visible: false,
|
|
visible: false,
|
|
remark_content: '',
|
|
remark_content: '',
|
|
submit_loading: false,
|
|
submit_loading: false,
|
|
|
|
+ isTrue,
|
|
|
|
+ menuPosition: {
|
|
|
|
+ x: -1,
|
|
|
|
+ y: -1,
|
|
|
|
+ componentId: 'WHOLE',
|
|
|
|
+ },
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -217,15 +235,38 @@ export default {
|
|
// 审校批注列表
|
|
// 审校批注列表
|
|
getCoursewareAuditRemarkList(id) {
|
|
getCoursewareAuditRemarkList(id) {
|
|
this.remark_list = [];
|
|
this.remark_list = [];
|
|
|
|
+ this.remark_list_obj = {};
|
|
GetCoursewareAuditRemarkList({
|
|
GetCoursewareAuditRemarkList({
|
|
courseware_id: id,
|
|
courseware_id: id,
|
|
}).then(({ remark_list }) => {
|
|
}).then(({ remark_list }) => {
|
|
this.remark_list = remark_list;
|
|
this.remark_list = remark_list;
|
|
|
|
+ remark_list.forEach((item) => {
|
|
|
|
+ // 组件的审批
|
|
|
|
+ if (item.component_id !== 'WHOLE') {
|
|
|
|
+ if (!this.remark_list_obj[item.component_id]) {
|
|
|
|
+ this.remark_list_obj[item.component_id] = [];
|
|
|
|
+ }
|
|
|
|
+ this.remark_list_obj[item.component_id].push(item);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- addRemark() {
|
|
|
|
|
|
+ addRemark(selectNode, x, y, componentId) {
|
|
this.remark_content = '';
|
|
this.remark_content = '';
|
|
this.visible = true;
|
|
this.visible = true;
|
|
|
|
+ if (selectNode) {
|
|
|
|
+ this.menuPosition = {
|
|
|
|
+ x: x,
|
|
|
|
+ y: y,
|
|
|
|
+ componentId: componentId,
|
|
|
|
+ };
|
|
|
|
+ } else {
|
|
|
|
+ this.menuPosition = {
|
|
|
|
+ x: -1,
|
|
|
|
+ y: -1,
|
|
|
|
+ componentId: 'WHOLE',
|
|
|
|
+ };
|
|
|
|
+ }
|
|
},
|
|
},
|
|
dialogClose() {
|
|
dialogClose() {
|
|
this.visible = false;
|
|
this.visible = false;
|
|
@@ -236,6 +277,9 @@ export default {
|
|
AddCoursewareAuditRemark({
|
|
AddCoursewareAuditRemark({
|
|
courseware_id: id || this.id,
|
|
courseware_id: id || this.id,
|
|
content: this.remark_content,
|
|
content: this.remark_content,
|
|
|
|
+ component_id: this.menuPosition.componentId,
|
|
|
|
+ position_x: this.menuPosition.x,
|
|
|
|
+ position_y: this.menuPosition.y,
|
|
})
|
|
})
|
|
.then(() => {
|
|
.then(() => {
|
|
this.submit_loading = false;
|
|
this.submit_loading = false;
|
|
@@ -261,6 +305,14 @@ export default {
|
|
})
|
|
})
|
|
.catch(() => {});
|
|
.catch(() => {});
|
|
},
|
|
},
|
|
|
|
+ // 计算previewMain滑动距离
|
|
|
|
+ computeScroll() {
|
|
|
|
+ this.$refs.courserware.handleResult(
|
|
|
|
+ this.$refs.previewMain.scrollTop,
|
|
|
|
+ this.$refs.previewMain.scrollLeft,
|
|
|
|
+ this.select_node,
|
|
|
|
+ );
|
|
|
|
+ },
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|