Browse Source

模型质量报告

yangjunjing 4 years ago
parent
commit
584be3d75e
2 changed files with 48 additions and 27 deletions
  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>
 <template>
   <!-- 待删除页面 -->
   <!-- 待删除页面 -->
-  <div class="box">
+  <div class="box" ref="boxBody">
     <div class="content-box" v-for="(item,index) in pageData" :key="index">
     <div class="content-box" v-for="(item,index) in pageData" :key="index">
       <div class="content-top">
       <div class="content-top">
         <div class="details">
         <div class="details">
@@ -74,24 +74,28 @@ export default {
       scene: '',
       scene: '',
       view: '',
       view: '',
       page: {
       page: {
-        pageSize: 50,
+        pageSize: 20,
         pageNumber: 1,
         pageNumber: 1,
+        total: 0
       }
       }
     }
     }
   },
   },
   mounted() {
   mounted() {
     this.queryToBelDelEquip();
     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++;
           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
         PageSize: this.page.pageSize
       }
       }
       toBeDelEquipPage(params, res => {
       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) {
         if (this.page.pageNumber == 1) {
           this.pageData = res.Content;
           this.pageData = res.Content;
           this.$nextTick(() => {
           this.$nextTick(() => {
@@ -188,6 +207,7 @@ export default {
           })
           })
         } else {
         } else {
           this.pageData = this.pageData.concat(res.Content);
           this.pageData = this.pageData.concat(res.Content);
+          console.log(this.pageData.length, 19)
           this.$nextTick(() => {
           this.$nextTick(() => {
             this.getGraphy();
             this.getGraphy();
           })
           })
@@ -209,6 +229,7 @@ export default {
       })
       })
     },
     },
     getGraphy() {// 绘制空间位置图片
     getGraphy() {// 绘制空间位置图片
+      console.log(this.i);
       let can = this.$refs.canvas;
       let can = this.$refs.canvas;
       let that = this;
       let that = this;
       that.clearGraphy(this.i)
       that.clearGraphy(this.i)
@@ -378,9 +399,4 @@ export default {
 canvas {
 canvas {
   position: static !important;
   position: static !important;
 }
 }
-</style>
-<style>
-html {
-  height: auto;
-}
 </style>
 </style>

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

@@ -1,6 +1,6 @@
 <template>
 <template>
   <!-- 待补充页面 -->
   <!-- 待补充页面 -->
-  <div class="box">
+  <div class="box" ref="boxBody">
     <div class="content-box" v-for="(item,index) in pageData" :key="index">
     <div class="content-box" v-for="(item,index) in pageData" :key="index">
       <div class="content-top">
       <div class="content-top">
         <div class="details">
         <div class="details">
@@ -66,8 +66,9 @@ export default {
       view: '',
       view: '',
       i: 0,
       i: 0,
       page: {
       page: {
-        pageSize: 50,
+        pageSize: 20,
         pageNumber: 1,
         pageNumber: 1,
+        total: 0
       }
       }
     }
     }
   },
   },
@@ -94,17 +95,20 @@ export default {
   },
   },
   mounted() {
   mounted() {
     this.getToBeSuppement();
     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++;
           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
         PageSize: this.page.pageSize
       }
       }
       toBeSupplementEquip(params, res => {
       toBeSupplementEquip(params, res => {
+        this.page.total = res.PageSize < 20 ? res.PageSize : res.Total;
         if (this.page.pageNumber == 1) {
         if (this.page.pageNumber == 1) {
           this.pageData = res.Content;
           this.pageData = res.Content;
           this.$nextTick(() => {
           this.$nextTick(() => {