Преглед изворни кода

修复宽度切换滚动卡顿问题

laiguoran пре 3 година
родитељ
комит
7b4c23502e
1 измењених фајлова са 12 додато и 1 уклоњено
  1. 12 1
      app/view/datacollect/index.ejs

+ 12 - 1
app/view/datacollect/index.ejs

@@ -1103,7 +1103,16 @@
             exitFullscreen();
         })
     })
-    $(window).resize(echartsReset);
+    let resizeTimer = null;
+    $(window).bind('resize', function () {
+        if (resizeTimer) clearTimeout(resizeTimer);
+        resizeTimer = setTimeout(function () {
+            echartsReset();
+            $(".tableid_").find('th').each(function(i) {
+                $(this).css('width', $('#tableId').find('th:eq(' + i + ')').innerWidth());
+            });
+        }, 500);
+    })
 
     // 数据全屏
     function launchIntoFullscreen(element) {
@@ -1506,6 +1515,8 @@
             myChart4_1.setOption(option4);
             myChart4_2.setOption(option4);
 
+            $('#tableId').css({'margin-top': 0});
+
             // 地图设置
             // const polyLineList = [];
             // const centerPoint = { lng: mapJson.lng, lat: mapJson.lat };