|
@@ -15,14 +15,22 @@
|
|
</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)"
|
|
|
|
+ @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 +78,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,
|
|
@@ -140,6 +149,12 @@ export default {
|
|
visible: false,
|
|
visible: false,
|
|
remark_content: '',
|
|
remark_content: '',
|
|
submit_loading: false,
|
|
submit_loading: false,
|
|
|
|
+ isTrue,
|
|
|
|
+ menuPosition: {
|
|
|
|
+ x: -1,
|
|
|
|
+ y: -1,
|
|
|
|
+ componentId: 'WHOLE',
|
|
|
|
+ },
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -223,9 +238,22 @@ export default {
|
|
this.remark_list = remark_list;
|
|
this.remark_list = remark_list;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- 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 +264,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 +292,14 @@ export default {
|
|
})
|
|
})
|
|
.catch(() => {});
|
|
.catch(() => {});
|
|
},
|
|
},
|
|
|
|
+ // 计算previewMain滑动距离
|
|
|
|
+ computeScroll() {
|
|
|
|
+ this.$refs.courserware.handleResult(
|
|
|
|
+ this.$refs.previewMain.scrollTop,
|
|
|
|
+ this.$refs.previewMain.scrollLeft,
|
|
|
|
+ this.select_node,
|
|
|
|
+ );
|
|
|
|
+ },
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|