natasha пре 3 дана
родитељ
комит
91d0570e2e
2 измењених фајлова са 14 додато и 18 уклоњено
  1. 2 6
      src/components/AuditRemark.vue
  2. 12 12
      src/components/CommonPreview.vue

+ 2 - 6
src/components/AuditRemark.vue

@@ -12,6 +12,7 @@
           component_id,
           audit_flow_node_name,
           file_list,
+          position_y,
         } in remarkList"
         :key="remarkId"
       >
@@ -34,12 +35,7 @@
             <el-link type="primary" class="delete-black delete-btn" @click="deleteRemarks(remarkId)"
               ><SvgIcon icon-class="delete-black" size="12"
             /></el-link>
-            <el-link
-              type="primary"
-              class="el-icon-place linkLocation"
-              v-if="component_id !== 'WHOLE'"
-              @click="handleLocation(component_id)"
-            />
+            <el-link type="primary" class="el-icon-place linkLocation" @click="handleLocation(position_y)" />
           </div>
         </div>
         <div class="remark-bottom" v-if="audit_flow_node_name">

+ 12 - 12
src/components/CommonPreview.vue

@@ -1042,18 +1042,18 @@ export default {
         .catch(() => {});
     },
     // 定位批注
-    async handleLocationRemarks(componentId) {
-      if (componentId) {
-        let node = await this.$refs.courserware.findChildComponentByKey(componentId);
-        if (node) {
-          await this.$nextTick();
-          this.$refs.previewMain.scrollTo({
-            top: node.$el.offsetTop - 50,
-            left: node.$el.offsetLeft - 50,
-            behavior: 'smooth',
-          });
-        }
-      }
+    async handleLocationRemarks(offsetTop) {
+      // if (componentId) {
+      //   let node = await this.$refs.courserware.findChildComponentByKey(componentId);
+      //   if (node) {
+      await this.$nextTick();
+      this.$refs.previewMain.scrollTo({
+        top: offsetTop - 50,
+        // left: node.$el.offsetLeft - 50,
+        behavior: 'smooth',
+      });
+      //   }
+      // }
     },
     // 计算previewMain滑动距离
     computeScroll() {