Pārlūkot izejas kodu

中国煤炭市场网,搜索指标没有定位到对应分类

hbchen 9 mēneši atpakaļ
vecāks
revīzija
cdbf5b94c8
1 mainītis faili ar 13 papildinājumiem un 0 dzēšanām
  1. 13 0
      src/views/dataEntry_manage/coal/index.vue

+ 13 - 0
src/views/dataEntry_manage/coal/index.vue

@@ -315,6 +315,7 @@ export default {
         this.haveMore = false;
         this.select_Unit = res.Data[0].Unit;
         this.select_classify = res.Data[0].ClassifyId;
+        this.orientationNode(res.Data[0].GroupId)
         this.select_UpdateTime = res.Data[0].ModifyTime;
         // 合并数据
         // this.tableOption = [{
@@ -351,6 +352,18 @@ export default {
         console.log(err);
       }
     },
+    // 左侧目录定位
+    orientationNode(Id){
+      this.select_node = Id;
+      this.$refs.coalTree.setCurrentKey(this.select_node);
+      this.$nextTick(() => {
+        let parent = document.getElementsByClassName('filter-tree')[0]
+        let node = parent.querySelector('.is-current')
+        parent.scrollTo({
+          top: node.offsetTop-200
+        })
+      })
+    },
     loadNext() {
       this.page_no++;
       this.getDataList();