浏览代码

修复BI看板添加图表表格弹窗中edge和360浏览器无法加载下一页问题

yujinwen 2 月之前
父节点
当前提交
4995b8ac1f
共有 2 个文件被更改,包括 23 次插入12 次删除
  1. 11 6
      src/views/BI_manage/components/SelectChart.vue
  2. 12 6
      src/views/BI_manage/components/SelectTable.vue

+ 11 - 6
src/views/BI_manage/components/SelectChart.vue

@@ -40,8 +40,7 @@
         <div
         <div
           class="chart-public-list"
           class="chart-public-list"
           style="margin-bottom: 20px;padding-right: 20px;"
           style="margin-bottom: 20px;padding-right: 20px;"
-          :infinite-scroll-disabled="!haveMove"
-          v-infinite-scroll="loadMove"
+          @scroll="loadMove"
           ref="scrollCont"
           ref="scrollCont"
         >
         >
           <el-col
           <el-col
@@ -170,10 +169,16 @@ export default {
       }
       }
     },
     },
 
 
-    loadMove() {
-      this.page_no++;
-      this.getPublicChartList();
-    },
+    loadMove:_.throttle(function(e){
+      let scrollTop = this.$refs.scrollCont.scrollTop;
+      let clientHeight = this.$refs.scrollCont.clientHeight;
+      let scrollHeight = this.$refs.scrollCont.scrollHeight;
+
+      if (scrollTop + clientHeight >= scrollHeight - 10&&this.haveMove) {
+        this.page_no++;
+        this.getPublicChartList();
+      }
+    },300),
 
 
     searchHandle() {
     searchHandle() {
       this.page_no = 1;
       this.page_no = 1;

+ 12 - 6
src/views/BI_manage/components/SelectTable.vue

@@ -43,8 +43,7 @@
           <div
           <div
             class="chart-public-list"
             class="chart-public-list"
             style="margin-bottom: 20px; padding-right: 20px"
             style="margin-bottom: 20px; padding-right: 20px"
-            :infinite-scroll-disabled="!haveMove"
-            v-infinite-scroll="loadMove"
+            @scroll="loadMove"
             ref="scrollCont"
             ref="scrollCont"
           >
           >
             <el-col
             <el-col
@@ -174,10 +173,17 @@ export default {
       }
       }
     },
     },
 
 
-    loadMove() {
-      this.page_no++;
-      this.getPublicTableList();
-    },
+    loadMove:_.throttle(function(e){
+      console.log('触底');
+      let scrollTop = this.$refs.scrollCont.scrollTop;
+      let clientHeight = this.$refs.scrollCont.clientHeight;
+      let scrollHeight = this.$refs.scrollCont.scrollHeight;
+
+      if (scrollTop + clientHeight >= scrollHeight - 10&&this.haveMove) {
+        this.page_no++;
+        this.getPublicTableList();
+      }
+    },300),
 
 
     searchHandle() {
     searchHandle() {
       this.page_no = 1;
       this.page_no = 1;