Просмотр исходного кода

增加万达特殊信息点处理

haojianlong 4 лет назад
Родитель
Сommit
affaee1edb
1 измененных файлов с 27 добавлено и 2 удалено
  1. 27 2
      src/views/maintain/space/components/spaceGraph.vue

+ 27 - 2
src/views/maintain/space/components/spaceGraph.vue

@@ -113,6 +113,7 @@ export default class spaceGraph extends Vue {
     BIMIDToSID = {};
     BIMIDToSIName = {};
     sourceIdToISP = {};
+    localFun = [];
 
     get mapBaseUrl() {
         return AppModule.mapBaseUrl;
@@ -262,7 +263,7 @@ export default class spaceGraph extends Vue {
         if (this.scene) {
             this.scene.isSpaceSelectable = true;
             this.scene.isZoneSelectable = false;
-            this.scene.selectContainer.clear()
+            this.scene.selectContainer.clear();
         }
         this.view?.update();
     }
@@ -271,8 +272,17 @@ export default class spaceGraph extends Vue {
         let arr = this.scene?.selectContainer.itemList;
         if (arr.length) {
             let tempArr = [];
+            this.localFun = [];
             arr.map((t) => {
                 tempArr.push(this.BIMIDToSIName[t.data.SourceId]);
+                if (
+                    this.sourceIdToISP[t.data.SourceId] &&
+                    this.sourceIdToISP[t.data.SourceId].infos
+                ) {
+                    this.localFun.push(
+                        this.sourceIdToISP[t.data.SourceId].infos
+                    );
+                }
             });
             this.$refs.createBSP.showDialog(tempArr.toString());
         } else {
@@ -362,6 +372,18 @@ export default class spaceGraph extends Vue {
             classCode: this.curZoneType,
             outline: [],
         };
+        // 没有业务空间,也没有绘制切割区域
+        let arr = this.scene?.selectContainer.itemList;
+        let temp = arr
+            ?.map((t) => {
+                return this.sourceIdToISP[t.data.SourceId]
+                    ? this.sourceIdToISP[t.data.SourceId].infos
+                    : undefined;
+            })
+            .filter((item) => item);
+        if (temp?.length) {
+            zoneObj.infos = temp[0];
+        }
         if (this.scene) {
             zoneObj = this.calIntersect(zoneObj);
             this.handleUpdateZone(zoneObj);
@@ -410,6 +432,9 @@ export default class spaceGraph extends Vue {
             floorId: this.floor.id,
             classCode: this.curZoneType,
         };
+        if (this.localFun.length) {
+            zoneObj.infos = this.localFun[0];
+        }
         if (this.scene) {
             zoneObj = this.calIntersect(zoneObj);
             this.handleCreateZone(zoneObj);
@@ -526,7 +551,7 @@ export default class spaceGraph extends Vue {
     // 切割划分
     divide() {
         if (this.scene) {
-            this.scene.drawCmd = 'cut';
+            this.scene.drawCmd = "cut";
         }
     }
     // 清除切割划分