瀏覽代碼

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

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();
             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) {
     function launchIntoFullscreen(element) {
@@ -1506,6 +1515,8 @@
             myChart4_1.setOption(option4);
             myChart4_1.setOption(option4);
             myChart4_2.setOption(option4);
             myChart4_2.setOption(option4);
 
 
+            $('#tableId').css({'margin-top': 0});
+
             // 地图设置
             // 地图设置
             // const polyLineList = [];
             // const polyLineList = [];
             // const centerPoint = { lng: mapJson.lng, lat: mapJson.lat };
             // const centerPoint = { lng: mapJson.lng, lat: mapJson.lat };