Quellcode durchsuchen

添加高亮显示未验证区块

zhangyu vor 5 Jahren
Ursprung
Commit
7e7ca8f828

+ 1 - 1
src/components/data_admin/buildTask/dialog/modelTaskDialog.vue

@@ -124,7 +124,7 @@ export default {
       }
 
       if (this.params.spaceList && this.params.spaceList.length) {
-        //通过平面图区域查询(接口未支持)paramsQuery:{listId:[]}
+        //通过平面图区域查询
         params.IdList = this.params.spaceList
         queryModelDiglog(params, res => {
           this.dataFormatter(res)

+ 57 - 2
src/components/data_admin/buildTask/draw/drawModel.vue

@@ -11,7 +11,7 @@
 import { DivideFloorScene, FloorView } from "@saga-web/cad-engine/lib"
 import { SColor, SPoint } from "@sybotan-web/draw/lib";
 import canvasFun from "@/components/business_space/newGraphy/canvasFun"
-import { floorQuery } from "@/api/scan/request";
+import { floorQuery, queryEquip } from "@/api/scan/request";
 export default {
   components: {
     canvasFun
@@ -27,6 +27,7 @@ export default {
       modelId: '',
       FloorID: '',
       Outline: [],
+      deviceList: [],
       buttonContent: "",
       showTools: false,
       config: {
@@ -44,6 +45,10 @@ export default {
     dialog: {
       default: false
     },
+    isLight:{
+      type: Boolean,
+      default: false
+    },
     CurrentModelId: String
   },
   created() { },
@@ -106,15 +111,53 @@ export default {
         return;
       }
       this.view.scene = this.drawMainScene;
+      if(this.isLight){//高亮显示未验证的区块
+        this.deviceList = []
+        this.highLightPoint()
+      }
       this.view.fitSceneToView();
       this.drawMainScene.click(this, this.canvasClick);
-
       if (this.$refs.canvasFun) {
         this.view.maxScale = this.view.scale * 10;
         this.view.minScale = this.view.scale;
         this.$refs.canvasFun.everyScale = this.view.scale;
       }
     },
+    //高亮未完成验证的区块
+    async highLightPoint() {
+      await this.getUnverificationDevice()
+      this.view.scene.spaceList.forEach(item => {
+        for(let deviceItem of this.deviceList) {
+          if(deviceItem.LocationJson && item.contains(deviceItem.LocationJson.X, -deviceItem.LocationJson.Y)){//注:坐标体系不同,Y坐标取反
+            item.selected = true
+            break
+          }
+        }
+      })
+    },
+    //获取模型下未验证的设备
+    getUnverificationDevice(pageNum) {
+      return new Promise((resolve) => {
+        pageNum = pageNum ? pageNum : 1
+        let params = {
+          Filters: `TaskState isNull;ModelId='${this.CurrentModelId}'`,
+          Orders: "CreateTime desc, EquipID asc",
+          Projection: ["EquipID", "BIMID", "BIMLocation", "LocationJson"],
+          PageNumber: pageNum,
+          PageSize: 1000
+        }
+        queryEquip(params, res => {
+          this.deviceList = res.Content
+          resolve();
+        });
+      });
+      // queryEquip(params, res => {
+      //   this.deviceList = this.deviceList.concat(res.Content)
+      //   if (res.Total / (res.PageSize * res.PageNumber) > 1) {
+      //     this.getUnverificationDevice(res.PageNumber + 1)
+      //   } else { }
+      // });
+    },
     // canvas 获取焦点
     focus() {
       document.getElementById(`floorCanvas${this.id}`).focus()
@@ -142,6 +185,18 @@ export default {
     }
   },
   watch: {
+    isLight: {
+      handler(newValue, oldValue) {
+        if(newValue){//高亮显示未验证的区块
+          this.deviceList = []
+          this.highLightPoint()
+        } else {
+          this.view.scene.spaceList.forEach(item => {
+            item.selected = false
+          })
+        }
+      }
+    },
     CurrentModelId: {
       handler(newName, oldName) {
         if (newName) {