Explorar el Código

模型质量报告

yangjunjing hace 5 años
padre
commit
a308d2ed82

+ 36 - 3
src/views/model/report/deleted.vue

@@ -21,7 +21,7 @@
               <p><span>执行人:{{item.ScanTaskBase[0].WorkerName}}</span><span>确认人:{{item.ScanTaskBase[0].ConfirmingPersonName}}</span></p>
             </div>
             <div class="plan">
-              <p>平面图上的位置:<span>{{`${'('+'X:'+'329'+','+'Y:'+'398'+')'}`}}</span></p>
+              <p>平面图上的位置:<span>{{item.local | localTransformation}}</span></p>
               <div class="img-box">
                 <canvas id="floorCanvas" :width="canvasWidth" :height="canvasHeight" ref="canvas" tabindex="0"></canvas>
               </div>
@@ -39,7 +39,7 @@
               </el-scrollbar>
             </div>
             <div class="photo" v-for="(it,ind) in item.ScanTaskBase[0].TaskPicList" :key='ind'>
-              <p>{{it.Name}}<span>拍摄时间:{{it.CreateTime}}</span></p>
+              <p>{{it.Name}}<span>拍摄时间:{{it.CreateTime | timeTransformation}}</span></p>
               <div class="img-box">
                 {{it.Key}}
                 <img :src="`/image-service/common/image_get?systemId=dataPlatform&key=${it.Key}`" alt="现场拍摄照片">
@@ -92,6 +92,30 @@ export default {
     bimIdTransformation(bimId) {// bimID转换
       let ary = bimId.split(":");
       return ary[1];
+    },
+    localTransformation(local) {// 转换坐标
+      let str = "";
+      for (let key in local) {
+        if (key !== "Z") {
+          str += key + ':' + local[key] + ',';
+        } else {
+          str += key + ':' + local[key];
+        }
+      }
+      return str;
+    },
+    timeTransformation(time) {
+      time = time.replace(/(\d+)\-(\d+)\-(\d+)\ (\d+)\:(\d+)\:(\d+)/, function () {
+        let str = '';
+        let ary = ['年', '月', '日', '时', '分'];
+        let time = Array.prototype.concat.apply([], arguments);
+        time = time.splice(1, 5);
+        time.forEach((item, index) => {
+          str += item + ary[index];
+        })
+        return str;
+      })
+      return time;
     }
   },
   methods: {
@@ -152,8 +176,17 @@ export default {
       }
       toBeDelEquipPage(params, res => {
         this.pageData = res.Content;
-        console.log(this.pageData, 12)
+        console.log(this.pageData, 121)
         this.pageData.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();
           }

+ 1 - 0
src/views/model/report/index.vue

@@ -275,6 +275,7 @@ export default {
         Filters: `FolderId='${this.activeTab}';Status=4`
       }
       queryLostReportList(params, res => {
+        console.log(res,392)
         this.LostFloorName = res.Content;
         this.getToBeCount();
       })

+ 79 - 32
src/views/model/report/supplement.vue

@@ -14,28 +14,32 @@
               <p style="margin-top:30px;">建议使用的Revit族:{{item.Res}}</p>
               <p>设计图纸中编码:{{item.CADID}}</p>
               <!-- <p><span>设备类型:{{'XXXXXXX'}}</span><span>设备ID:{{'XXXXXXX'}}</span></p> -->
-              <p><span>资产族:{{'XXXXXXX'}}</span></p>
+              <p><span>资产族:{{item.FamilyName.Name}}</span></p>
               <p><span style="width:500px;">资产ID:{{item.EquipID}}</span></p>
               <p>现场发现人:{{item.FindPeople}}</p>
             </div>
             <div class="plan">
-              <p>平面图上的位置:<span>{{`${'('+'X:'+'329'+','+'Y:'+'398'+')'}`}}</span></p>
+              <p>平面图上的位置:<span>{{item.local | localTransformation}}</span></p>
               <div class="img-box">
-                <canvas id="floorCanvas" :width="canvasWidth" :height="canvasHeight" ref="canvas" tabindex="0"></canvas>
+                <canvas :id="'canvas'+index" :width="canvasWidth" :height="canvasHeight" ref="canvas" tabindex="0"
+                  :data-modelid="item.ModelId"></canvas>
               </div>
             </div>
           </div>
           <div class="content-bottom">
             <div class="photo" v-for="(it,ind) in item.LedgerParam.PhotoDoc.Nameplate" :key="ind">
-              <p>{{it.name}}<span>拍摄时间:{{it.createTime}}</span></p>
+              <p>{{it.name}}<span>拍摄时间:{{it.createTime | timeTransformation}}</span></p>
               <div class="img-box">
                 <img :src="`/image-service/common/image_get?systemId=dataPlatform&key=${it.key}`" alt="铭牌图片">
               </div>
             </div>
             <div class="photo" v-for="(photo,num) in item.LedgerParam.PhotoDoc.Pic" :key="num+photo">
-              <p v-if="item.LedgerParam.PhotoDoc.Pic">{{photo.name}}<span>拍摄时间:{{photo.createTime}}</span></p>
+              <p v-if="item.LedgerParam.PhotoDoc.Pic">{{photo.name}}<span>拍摄时间:{{photo.createTime | timeTransformation}}</span></p>
               <div class="img-box" v-if="item.LedgerParam.PhotoDoc.Pic">
-                <img :src="`/image-service/common/image_get?systemId=dataPlatform&key=${photo.key}`" alt="设备图片">
+                <img :src="`/image-service/common/image_get?systemId=dataPlatform&key=${photo.key}`" alt="设备图片" v-if="photo.type !=='video'">
+                <video :src="'/image-service/common/image_get?systemId=dataPlatform&key='+photo.key" controls
+                  :poster="'/image-service/common/image_get?systemId=dataPlatform&key='+ photo.key" v-if="photo.type === 'video'" width="400px"
+                  height="300px"></video>
               </div>
             </div>
           </div>
@@ -48,6 +52,7 @@
 <script>
 import { mapGetters } from "vuex";
 import { toBeSupplementEquip } from "@/api/scan/request.js";
+import { LocationPointScene, FloorView } from "@saga-web/cad-engine/lib";
 
 export default {
   components: {
@@ -66,18 +71,46 @@ export default {
       },
       canvasWidth: 400,
       canvasHeight: 300,
+      scene: '',
+      view: ''
     }
   },
   filters: {
     numTransformation(num, length) {// 序列号转换为4位
       num = Number(num + 1)
       return (Array(length).join('0') + num).slice(-length);
+    },
+    localTransformation(local) {
+      let str = "";
+      for (let key in local) {
+        if (key !== "Z") {
+          str += key + ':' + local[key] + ',';
+        } else {
+          str += key + ':' + local[key];
+        }
+      }
+      return str;
+    },
+    timeTransformation(time) {
+      time = time.replace(/(\d+)\-(\d+)\-(\d+)\ (\d+)\:(\d+)\:(\d+)/, function () {
+        let str = '';
+        let ary = ['年', '月', '日', '时', '分'];
+        let time = Array.prototype.concat.apply([], arguments);
+        time = time.splice(1, 5);
+        time.forEach((item, index) => {
+          str += item + ary[index];
+        })
+        return str;
+      })
+      return time;
     }
   },
-  mounted() { },
+  mounted() {
+    // this.getGraphy();
+    this.getToBeSuppement();
+  },
   created() {
     this.equipComDelList = decodeURIComponent(this.$route.query.equipComDelList);
-    this.getToBeSuppement();
   },
   computed: {
     ...mapGetters('layout', ['projectId'])
@@ -129,9 +162,18 @@ export default {
         PageSize: this.page.pageSize
       }
       toBeSupplementEquip(params, res => {
+        console.log(res, 39)
         this.pageData = res.Content;
-        console.log(this.pageData, 12)
         this.pageData.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();
           }
@@ -146,30 +188,34 @@ export default {
             })
           }
         });
+        this.$nextTick(() => {
+          this.getGraphy();
+        })
       })
     },
     getGraphy() {// 绘制空间位置图片
-      let that = this;
-      that.clearGraphy()
-      that.scene = new DivideFloorScene();
-      this.canvasLoading = true;
-      that.scene.loadUrl(`/image-service/common/file_get?systemId=revit&key=${this.FloorMap}`).then(res => {
-        that.canvasLoading = false;
-        if (res == 'error') {
-          this.FloorMap = '';
-          this.$message.warning('数据解析异常');
-          return;
-        }
-        that.view.scene = that.scene;
-        that.view.fitSceneToView();
-        let tempArr = {
-          RoomLocalName: this.spaceDetails.RoomLocalName,
-          OutLine: this.spaceDetails.Outline,
-          RoomID: this.spaceDetails.RoomID,
-          Color: "#a384fc",
-        }
-        that.scene.addZoneList([tempArr]);
-        this.scene.isSpaceSelectable = false;
+      this.pageData.forEach((item, index) => {
+        let that = this;
+        that.clearGraphy()
+        that.scene = new LocationPointScene();
+        this.canvasLoading = true;
+        that.scene.getFloorData('/modelapi/base-graph/query', { ModelId: item.ModelId }).then(res => {
+          that.canvasLoading = false;
+          console.log(res, 2847)
+          if (res == 'error') {
+            this.FloorMap = '';
+            this.$message.warning('数据解析异常');
+            return;
+          }
+          that.view.scene = that.scene;
+          this.scene.addMarker({
+            Id: 'Eq420105000136d2753ce7b94f5b98496e51fa89379a',
+            X: -35559.48,
+            Y: 16647.19
+          })
+          that.view.fitSceneToView();
+          this.scene.isSpaceSelectable = false;
+        })
       })
     },
     clearGraphy() {
@@ -177,8 +223,9 @@ export default {
         this.view.scene = null;
         return
       }
-      this.view = new FloorView('floorCanvas')
-    },
+      console.log(document.getElementById('canvas0'))
+      this.view = new FloorView('canvas0')
+    }
   }
 }
 </script>