Jelajahi Sumber

资源定位,切换左侧当前课件id

dsy 2 minggu lalu
induk
melakukan
cd8cf9e427
1 mengubah file dengan 11 tambahan dan 0 penghapusan
  1. 11 0
      src/components/CommonPreview.vue

+ 11 - 0
src/components/CommonPreview.vue

@@ -1082,10 +1082,17 @@ export default {
         behavior: 'smooth',
       });
     },
+    /**
+     * 定位到对应位置
+     * @param {Object} item - 位置对象
+     * @param {number} type - 定位类型(1: 笔记定位, 2: 收藏定位, 3: 资源定位)
+     */
     handleLocation(item, type) {
       if (type === 3) {
+        console.log(item.courseware_id, item.component_id);
         let did = `${item.courseware_id}#${item.component_id}`;
         this.handleNodeClick(did);
+        this.curSelectId = item.courseware_id;
         return;
       }
 
@@ -1094,6 +1101,10 @@ export default {
         this.$refs.courserware.handleLocation(item);
       }
     },
+    /**
+     * 获取笔记列表
+     * @param {Object} params - 参数对象
+     */
     async getNote(params) {
       if (params && params.type) this.drawerType = Number(params.type);
       this.allNoteList = [];