Explorar o código

增加延时 尽量计算完top

wenmenghao321 %!s(int64=2) %!d(string=hai) anos
pai
achega
29b4468f94

+ 5 - 1
src/web/staticres/common-module/report-analysis/js/report_analysis.js

@@ -392,6 +392,7 @@ var vm = new Vue({
         }
         item.top = offsetTop
       })
+    
     },
     addEventListeners: function () {
       this.scrollToTop()
@@ -405,7 +406,7 @@ var vm = new Vue({
       setTimeout(function () {
         // 2s后绑定(尽可能保证top能够被计算完)
         $scrollDOM.on('scroll', this.checkAnchorItemActive)
-      }.bind(this), 2000)
+      }.bind(this), 2500)
 
       $('.scroll-to-top').on('click', function () {
         $scrollDOM.animate({ scrollTop: 0 })
@@ -418,10 +419,13 @@ var vm = new Vue({
       var i = 0
       if (scrollTop >= anchorTopList[1] && scrollTop < anchorTopList[2]) {
         i = 1
+        
       } else if (scrollTop > anchorTopList[2]) {
         i = 2
+      
       } else if (scrollTop < anchorTopList[1]) {
         i = 0
+
       }
       this.activeDimension = this.dimensionList[i].id
     },