Pārlūkot izejas kodu

模型质量报告

yangjunjing 4 gadi atpakaļ
vecāks
revīzija
584be3d75e
2 mainītis faili ar 48 papildinājumiem un 27 dzēšanām
  1. 32 16
      src/views/model/report/deleted.vue
  2. 16 11
      src/views/model/report/supplement.vue

+ 32 - 16
src/views/model/report/deleted.vue

@@ -1,6 +1,6 @@
 <template>
   <!-- 待删除页面 -->
-  <div class="box">
+  <div class="box" ref="boxBody">
     <div class="content-box" v-for="(item,index) in pageData" :key="index">
       <div class="content-top">
         <div class="details">
@@ -74,24 +74,28 @@ export default {
       scene: '',
       view: '',
       page: {
-        pageSize: 50,
+        pageSize: 20,
         pageNumber: 1,
+        total: 0
       }
     }
   },
   mounted() {
     this.queryToBelDelEquip();
-    window.addEventListener('scroll', () => {
-      let clientHeight = document.documentElement.clientHeight;
-      let scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
-      let scrollHeight = document.body.scrollHeight || document.documentElement.scrollHeight;
-      if (clientHeight + scrollTop + 100 >= scrollHeight) {
-        if (this.pageData.length < 50) {
-          this.page.pageNumber = 1
-        } else {
+    this.boxBody = this.$refs.boxBody;
+    this.boxBody.addEventListener('scroll', () => {
+      let clientHeight = this.boxBody.clientHeight;
+      let scrollTop = this.boxBody.scrollTop;
+      let scrollHeight = this.boxBody.scrollHeight;
+      if (clientHeight + scrollTop === scrollHeight) {
+        console.log(this.page.pageNumber * this.page.pageSize)
+        if (this.page.pageNumber * this.page.pageSize < this.page.total) {
           this.page.pageNumber++;
+          if (this.pageData.length < 20) {
+            this.page.pageNumber = 1
+          }
+          this.queryToBelDelEquip();
         }
-        this.queryToBelDelEquip();
       }
     })
   },
@@ -181,6 +185,21 @@ export default {
         PageSize: this.page.pageSize
       }
       toBeDelEquipPage(params, res => {
+        this.page.total = res.PageSize < 20 ? res.PageSize : res.Total;
+        res.Content.forEach(item => {
+          if (item.BIMLocation) {
+            let local = {};
+            let ary = item.BIMLocation.split(',');
+            let localAry = ['X', 'Y', 'Z'];
+            ary.forEach((item, index) => {
+              local[localAry[index]] = ary[index];
+            })
+            item.local = local;
+          }
+          if (item.ScanTaskBase && item.ScanTaskBase.length > 1) {
+            item.ScanTaskBase = item.ScanTaskBase.shift();
+          }
+        });
         if (this.page.pageNumber == 1) {
           this.pageData = res.Content;
           this.$nextTick(() => {
@@ -188,6 +207,7 @@ export default {
           })
         } else {
           this.pageData = this.pageData.concat(res.Content);
+          console.log(this.pageData.length, 19)
           this.$nextTick(() => {
             this.getGraphy();
           })
@@ -209,6 +229,7 @@ export default {
       })
     },
     getGraphy() {// 绘制空间位置图片
+      console.log(this.i);
       let can = this.$refs.canvas;
       let that = this;
       that.clearGraphy(this.i)
@@ -378,9 +399,4 @@ export default {
 canvas {
   position: static !important;
 }
-</style>
-<style>
-html {
-  height: auto;
-}
 </style>

+ 16 - 11
src/views/model/report/supplement.vue

@@ -1,6 +1,6 @@
 <template>
   <!-- 待补充页面 -->
-  <div class="box">
+  <div class="box" ref="boxBody">
     <div class="content-box" v-for="(item,index) in pageData" :key="index">
       <div class="content-top">
         <div class="details">
@@ -66,8 +66,9 @@ export default {
       view: '',
       i: 0,
       page: {
-        pageSize: 50,
+        pageSize: 20,
         pageNumber: 1,
+        total: 0
       }
     }
   },
@@ -94,17 +95,20 @@ export default {
   },
   mounted() {
     this.getToBeSuppement();
-    window.addEventListener('scroll', () => {
-      let clientHeight = document.documentElement.clientHeight;
-      let scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
-      let scrollHeight = document.body.scrollHeight || document.documentElement.scrollHeight;
-      if (clientHeight + scrollTop + 100 >= scrollHeight) {
-        if (this.pageData.length < 50) {
-          this.page.pageNumber = 1
-        } else {
+    this.boxBody = this.$refs.boxBody;
+    this.boxBody.addEventListener('scroll', () => {
+      let clientHeight = this.boxBody.clientHeight;
+      let scrollTop = this.boxBody.scrollTop;
+      let scrollHeight = this.boxBody.scrollHeight;
+      if (clientHeight + scrollTop === scrollHeight) {
+        console.log(this.page.pageNumber * this.page.pageSize)
+        if (this.page.pageNumber * this.page.pageSize < this.page.total) {
           this.page.pageNumber++;
+          if (this.pageData.length < 20) {
+            this.page.pageNumber = 1
+          }
+          this.queryToBelDelEquip();
         }
-        this.queryToBelDelEquip();
       }
     })
   },
@@ -158,6 +162,7 @@ export default {
         PageSize: this.page.pageSize
       }
       toBeSupplementEquip(params, res => {
+        this.page.total = res.PageSize < 20 ? res.PageSize : res.Total;
         if (this.page.pageNumber == 1) {
           this.pageData = res.Content;
           this.$nextTick(() => {