|
|
@@ -113,13 +113,6 @@
|
|
|
|
|
|
<main :class="['preview-main', { 'no-audit': !isShowAudit }]">
|
|
|
<div class="preview-left"></div>
|
|
|
- <!-- <div
|
|
|
- id="selectable-area-preview"
|
|
|
- @mousedown="startSelection"
|
|
|
- @mousemove="updateSelection"
|
|
|
- @mouseup="endSelection"
|
|
|
- @mouseleave="endSelection"
|
|
|
- > -->
|
|
|
<CoursewarePreview
|
|
|
v-if="courseware_info.book_name"
|
|
|
ref="courserware"
|
|
|
@@ -143,18 +136,6 @@
|
|
|
@editFeedback="handEditFeedback"
|
|
|
@selectedComponent="$emit('selectedComponent', $event)"
|
|
|
/>
|
|
|
- <!-- <div
|
|
|
- v-if="isSelecting"
|
|
|
- :style="{
|
|
|
- position: 'absolute',
|
|
|
- top: `${menuPosition.startY}px`,
|
|
|
- left: `${menuPosition.startX}px`,
|
|
|
- width: `${menuPosition.endX - menuPosition.startX}px`,
|
|
|
- height: `${menuPosition.endY - menuPosition.startY}px`,
|
|
|
- border: '2px solid #165DFF',
|
|
|
- }"
|
|
|
- ></div>
|
|
|
- </div> -->
|
|
|
|
|
|
<div class="preview-right"></div>
|
|
|
</main>
|
|
|
@@ -435,11 +416,12 @@
|
|
|
width="680px"
|
|
|
:close-on-click-modal="false"
|
|
|
class="remark-dialog"
|
|
|
- @close="visibleRemark = false"
|
|
|
+ @close="closeVisibleRemark"
|
|
|
+ v-if="visibleRemark"
|
|
|
>
|
|
|
<Remark :remark="remark" :project-id="projectId" :courseware-id="select_node ? select_node : id" />
|
|
|
<div slot="footer">
|
|
|
- <el-button @click="visibleRemark = false">取消</el-button>
|
|
|
+ <el-button @click="closeVisibleRemark">取消</el-button>
|
|
|
<el-button type="primary" :loading="submit_loading" @click="addCoursewareAuditRemark(select_node)">
|
|
|
确定
|
|
|
</el-button>
|
|
|
@@ -660,7 +642,6 @@ export default {
|
|
|
endX: null,
|
|
|
endY: null,
|
|
|
},
|
|
|
- isSelecting: false,
|
|
|
|
|
|
curToolbarIcon: this.isShowAudit ? 'audit' : '',
|
|
|
sidebarIconList,
|
|
|
@@ -969,7 +950,7 @@ export default {
|
|
|
}, {});
|
|
|
});
|
|
|
},
|
|
|
- addRemark(selectNode, x, y, componentId, content_select) {
|
|
|
+ addRemark(selectNode, x, y, br_x, br_y, componentId, content_select) {
|
|
|
this.remark = {
|
|
|
remark_content: '',
|
|
|
file_id_list: [],
|
|
|
@@ -979,6 +960,8 @@ export default {
|
|
|
this.menuPosition = {
|
|
|
x,
|
|
|
y,
|
|
|
+ br_x,
|
|
|
+ br_y,
|
|
|
componentId,
|
|
|
content_select,
|
|
|
};
|
|
|
@@ -986,6 +969,8 @@ export default {
|
|
|
this.menuPosition = {
|
|
|
x: -1,
|
|
|
y: -1,
|
|
|
+ br_x: -1,
|
|
|
+ br_y: -1,
|
|
|
componentId: 'WHOLE',
|
|
|
content_select,
|
|
|
};
|
|
|
@@ -1003,6 +988,8 @@ export default {
|
|
|
component_id: this.menuPosition.componentId,
|
|
|
position_x: this.menuPosition.x,
|
|
|
position_y: this.menuPosition.y,
|
|
|
+ position_br_x: this.menuPosition.br_x,
|
|
|
+ position_br_y: this.menuPosition.br_y,
|
|
|
content_select: this.menuPosition.content_select,
|
|
|
file_id_list: this.remark.file_id_list,
|
|
|
})
|
|
|
@@ -1010,11 +997,17 @@ export default {
|
|
|
this.submit_loading = false;
|
|
|
this.visibleRemark = false;
|
|
|
this.getCoursewareAuditRemarkList(id || this.id);
|
|
|
+ this.$refs.courserware.resetRemark();
|
|
|
})
|
|
|
.catch(() => {
|
|
|
this.submit_loading = false;
|
|
|
});
|
|
|
},
|
|
|
+ // 关闭审核批注弹窗
|
|
|
+ closeVisibleRemark() {
|
|
|
+ this.visibleRemark = false;
|
|
|
+ this.$refs.courserware.resetRemark();
|
|
|
+ },
|
|
|
// 删除批注
|
|
|
deleteRemarks(id) {
|
|
|
this.$confirm('确定要删除此条批注吗?', '提示', {
|
|
|
@@ -1738,64 +1731,7 @@ export default {
|
|
|
computedSelectedGroupCoursewareInfo() {
|
|
|
return this.$refs.courserware.computedSelectedGroupCoursewareInfo();
|
|
|
},
|
|
|
- startSelection(event) {
|
|
|
- if (
|
|
|
- this.isTrue(this.courseware_info.is_my_audit_task) &&
|
|
|
- this.isTrue(this.courseware_info.is_can_add_audit_remark)
|
|
|
- ) {
|
|
|
- this.isSelecting = true;
|
|
|
|
|
|
- let clientRect = document.getElementById(`selectable-area-preview`).getBoundingClientRect();
|
|
|
- this.menuPosition.startX = event.clientX - clientRect.left;
|
|
|
- this.menuPosition.startY = event.clientY - clientRect.top;
|
|
|
- }
|
|
|
- },
|
|
|
- updateSelection(event) {
|
|
|
- if (!this.isSelecting) return;
|
|
|
- let clientRect = document.getElementById(`selectable-area-preview`).getBoundingClientRect();
|
|
|
-
|
|
|
- this.menuPosition.endX = event.clientX - clientRect.left;
|
|
|
- this.menuPosition.endY = event.clientY - clientRect.top;
|
|
|
- },
|
|
|
- endSelection() {
|
|
|
- if (!this.isSelecting || this.menuPosition.startX === this.menuPosition.endX || !this.menuPosition.endX) return;
|
|
|
- this.isSelecting = false;
|
|
|
- const width = Math.abs(this.menuPosition.endX - this.menuPosition.startX);
|
|
|
- const height = Math.abs(this.menuPosition.endY - this.menuPosition.startY);
|
|
|
- const x =
|
|
|
- this.menuPosition.endX > this.menuPosition.startX
|
|
|
- ? `${this.menuPosition.startX}px`
|
|
|
- : `${this.menuPosition.endX}px`;
|
|
|
- const y =
|
|
|
- this.menuPosition.endY > this.menuPosition.startY
|
|
|
- ? `${this.menuPosition.startY}px`
|
|
|
- : `${this.menuPosition.endY}px`;
|
|
|
- let obj = {
|
|
|
- id: Math.random().toString(36).substring(2, 10),
|
|
|
- width: `${width}px`,
|
|
|
- height: `${height}px`,
|
|
|
- x,
|
|
|
- y,
|
|
|
- text: '',
|
|
|
- };
|
|
|
- this.menuPosition.startX = null;
|
|
|
- this.menuPosition.endX = null;
|
|
|
- this.menuPosition.startY = null;
|
|
|
- this.menuPosition.endY = null;
|
|
|
- if (width && height && this.isText) {
|
|
|
- this.data.text_list.push(obj);
|
|
|
- this.activeType = 'text';
|
|
|
- this.activeIndex = this.data.text_list.length - 1;
|
|
|
-
|
|
|
- this.hotspotsActiveIndex = this.data.text_list.length - 1;
|
|
|
- } else if (width && height && !this.isText) {
|
|
|
- this.data.input_list.push(obj);
|
|
|
- this.activeType = 'input';
|
|
|
- this.activeIndex = this.data.input_list.length - 1;
|
|
|
-
|
|
|
- this.inputActiveIndex = this.data.input_list.length - 1;
|
|
|
- }
|
|
|
- },
|
|
|
async submitChapterAllCoursewareToAuditFlow(chapter_id) {
|
|
|
try {
|
|
|
await this.$confirm('确定要提交审核吗?', '提示', {
|