Sfoglia il codice sorgente

Merge branch 'master' of http://60.205.254.193:3000/GCLS/eep_page

dsy 3 settimane fa
parent
commit
aacc935817

+ 14 - 6
src/components/CommonPreview.vue

@@ -972,12 +972,10 @@ export default {
           });
 
           if (content_group_row_list) this.content_group_row_list = JSON.parse(content_group_row_list) || [];
-
-          // 保留未缩放的原始组件数据,字号缩放时都从原始数据重新派生,避免多次缩放叠加
-          this.raw_component_list = this.component_list;
-          this.applyFontScale();
+          this.getCoursewareAuditRemarkList(id, requestConfig);
         })
         .catch((error) => {
+          this.getCoursewareAuditRemarkList(id, requestConfig);
           if (this.isCanceledRequest(error)) return null;
           throw error;
         });
@@ -1052,7 +1050,6 @@ export default {
       const requestConfig = { signal: requestController.signal };
       this.getCoursewareComponentContent_View(nodeId, requestConfig);
       this.getBookCoursewareInfo(nodeId, requestConfig);
-      this.getCoursewareAuditRemarkList(nodeId, requestConfig);
       this.select_node = nodeId;
     },
     // 审核批注列表
@@ -1082,6 +1079,15 @@ export default {
                 items.icon_type = 'file';
               }
             });
+            if (item.is_component_position === 'true' && item.component_id) {
+              let point = this.$refs.courseware.getComponentPosition(item.component_id);
+              if (point) {
+                item.position_x += point.x;
+                item.position_y += point.y;
+                item.position_br_x += point.x;
+                item.position_br_y += point.y;
+              }
+            }
           });
           this.remark_list = remark_list;
           if (!remark_list) return;
@@ -1099,7 +1105,7 @@ export default {
           throw error;
         });
     },
-    addRemark(selectNode, x, y, br_x, br_y, componentId, content_select) {
+    addRemark(selectNode, x, y, br_x, br_y, componentId, content_select, flag) {
       this.remark = {
         remark_content: '',
         file_id_list: [],
@@ -1113,6 +1119,7 @@ export default {
           br_y,
           componentId,
           content_select,
+          flag,
         };
       } else {
         this.menuPosition = {
@@ -1141,6 +1148,7 @@ export default {
         position_br_y: this.menuPosition.br_y,
         content_select: this.menuPosition.content_select,
         file_id_list: this.remark.file_id_list,
+        is_component_position: this.menuPosition.flag ? 'true' : 'false',
       })
         .then(() => {
           this.submit_loading = false;

+ 10 - 4
src/views/book/courseware/preview/CoursewarePreview.vue

@@ -708,6 +708,7 @@ export default {
     handleMenuItemClick(event, type) {
       this.showMenu = false; // 隐藏菜单
       let text = '';
+      let positionAtPoint = null;
       if (type && type === 'tool') {
         let info = this.selectHandleInfo;
         this.menuPosition = {
@@ -723,18 +724,23 @@ export default {
           (this.menuPosition.startX + this.menuPosition.endX) / 2,
           (this.menuPosition.startY + this.menuPosition.endY) / 2,
         );
+        positionAtPoint = this.getComponentPositionAtPoint(
+          (this.menuPosition.startX + this.menuPosition.endX) / 2,
+          (this.menuPosition.startY + this.menuPosition.endY) / 2,
+        );
       }
       this.$emit('computeScroll');
       setTimeout(() => {
         this.$emit(
           'addRemark',
           this.menuPosition.select_node,
-          this.menuPosition.startX,
-          this.menuPosition.startY,
-          this.menuPosition.endX,
-          this.menuPosition.endY,
+          positionAtPoint ? this.menuPosition.startX - positionAtPoint.x : this.menuPosition.startX,
+          positionAtPoint ? this.menuPosition.startY - positionAtPoint.y : this.menuPosition.startY,
+          positionAtPoint ? this.menuPosition.endX - positionAtPoint.x : this.menuPosition.endX,
+          positionAtPoint ? this.menuPosition.endY - positionAtPoint.y : this.menuPosition.endY,
           this.componentId,
           text,
+          positionAtPoint ? true : false,
         );
       }, 10);
     },