Przeglądaj źródła

Merge branch 'msg-sever' of http://39.106.8.246:3003/web/ibms into msg-sever

LXXXY 5 lat temu
rodzic
commit
c7a345ba82

+ 41 - 29
src/components/business_space/newGraphy/graphy.vue

@@ -320,13 +320,18 @@ export default {
         })
         // 绘制业务空间
         let tempArr = this.BSPRelaISPList.map((t, i) => {
-          return {
-            RoomLocalName: t.RoomLocalName,
-            OutLine: t.Outline,
-            RoomID: t.RoomID,
-            Color: colorArr[i % colorArr.length],
+          if (t.FloorId == this.buildFloor[1] && t.ObjectType == this.tab.code) {
+            return {
+              RoomLocalName: t.RoomLocalName,
+              OutLine: t.Outline,
+              RoomID: t.RoomID,
+              Color: colorArr[i % colorArr.length],
+            }
+          } else {
+            console.log('internet slow')
+            return undefined;
           }
-        })
+        }).filter(item => item)
         this.scene.removeAllZone();
         this.scene.addZoneList(tempArr);
         this.scene.click(this, this.canvasClick);
@@ -407,7 +412,7 @@ export default {
         this.scene.isZoneSelectable = false;
       }
     },
-    // 批量创建业务空间
+    // 根据未关联元空间批量创建业务空间
     groupCreateBSpace() {
       let text = []
       let Spaces = this.allUnRelatISP.map(t => {
@@ -449,7 +454,7 @@ export default {
           });
         });
       } else {
-        this.$message('没有未关联的空间')
+        this.$message('没有未关联的空间')
       }
     },
     // 创建新的业务空间
@@ -465,7 +470,7 @@ export default {
         this.$message.warning('请至少选择一个空间');
       }
     },
-    // 创建新的业务空间-弹窗返回确认创建
+    // 根据图创建新的业务空间-弹窗返回确认创建
     createRoom(val) {
       let zoneObj = { Outline: [], Height: 0 }, IspaceIdList = [];
       let selectSpaces = this.scene.getSelectedSpaces();
@@ -475,7 +480,7 @@ export default {
           IspaceIdList.push(this.BIMIDToSID[t.data.SourceId]);
         }
         if (t.data.Height && (zoneObj.Height == 0 || t.data.Height < zoneObj.Height)) {
-          zoneObj.Height = t.data.Height;
+          zoneObj.Height = t.data.Height > 100 ? (t.data.Height / 1000).toFixed(2) : t.data.Height;
         }
       })
       // 如果有划分,求交集
@@ -501,7 +506,7 @@ export default {
       zoneObj.FloorId = this.buildFloor[1];
       this.createSingleBSP(zoneObj, IspaceIdList)
     },
-    // 从未关联平面图的业务空间中选择--按钮返回关联信号
+    // 根据图从未关联平面图的业务空间中选择--按钮返回关联信号
     createFromUnrelated(BSP) {
       BSP.Outline = [];
       BSP.Height = 0;
@@ -512,7 +517,7 @@ export default {
           IspaceIdList.push(this.BIMIDToSID[t.data.SourceId]);
         }
         if (t.Height && (BSP.Height == 0 || t.Height < BSP.Height)) {
-          BSP.Height = t.Height;
+          BSP.Height = t.Height > 100 ? (t.Height / 1000).toFixed(2) : t.Height;
         }
       })
       this.updateBSPOutline(BSP, IspaceIdList)
@@ -520,12 +525,12 @@ export default {
     // 编辑空间详情
     editeSpaceDetail() {
       let item = this.curZoneItem.data;
-        let query = {
-          RoomID: item.RoomID,
-          zone: this.tab.code,
-          isMyTab: 1,
-          buildFloorSelectd: this.buildFloor
-        }
+      let query = {
+        RoomID: item.RoomID,
+        zone: this.tab.code,
+        isMyTab: 1,
+        buildFloorSelectd: this.buildFloor
+      }
       this.$router.push({
         path: "/ledger/spaceDetail",
         query: query
@@ -558,7 +563,7 @@ export default {
           IspaceIdList.push(this.BIMIDToSID[t.data.SourceId]);
         }
         if (t.Height && (zoneObj.Height == 0 || t.Height < zoneObj.Height)) {
-          zoneObj.Height = t.Height;
+          zoneObj.Height = t.Height > 100 ? (t.Height / 1000).toFixed(2) : t.Height;
         }
       })
       // 类空间
@@ -597,7 +602,7 @@ export default {
       zoneObj.RoomID = this.curZoneItem.data.RoomID;
       this.updateBSPOutline(zoneObj, IspaceIdList)
     },
-    // 批量创建所选业务空间
+    // 根据图批量创建所选业务空间
     groupCreateZone() {
       let arr = this.scene.getSelectedSpaces();
       let spaces = arr.map(t => {
@@ -607,7 +612,7 @@ export default {
           Outline: [t.data.OutLine],
           BuildingId: this.buildFloor[0],
           FloorId: this.buildFloor[1],
-          Height: t.data.Height || 0
+          Height: t.data.Height > 100 ? (t.data.Height / 1000).toFixed(2) : t.data.Height || 0
         }
       })
       if (spaces.length) {
@@ -630,17 +635,24 @@ export default {
     },
     // 批量更新业务空间和元空间的关系
     groupCreRelaZoneAndISp(Spaces) {
-      let param = {
-        data: {
-          Content: Spaces
-        },
-        type: this.tab.code
-      }
-      groupCreRelaZoneAndISp(param, res => {
+      Spaces = Spaces.filter(item => item.IspaceId);
+      if (Spaces.length) {
+        let param = {
+          data: {
+            Content: Spaces
+          },
+          type: this.tab.code
+        }
+        groupCreRelaZoneAndISp(param, res => {
+          this.$message.success('创建成功')
+          this.canvasLoading = false;
+          this.init(2)
+        })
+      } else {
         this.$message.success('创建成功')
         this.canvasLoading = false;
         this.init(2)
-      })
+      }
     },
     // 批量创建
     groupCreateBSP(spaces) {

+ 7 - 5
src/views/ledger/spacelist/index.vue

@@ -113,7 +113,7 @@ export default {
       },
       floorToMap: {}, //楼层及其对应的模型图
       FloorMap: {}, //当前选中的楼层对象
-      buildFloorSelectd: ['all'], //当前所选的建筑楼层
+      buildFloorSelectd: [''], //当前所选的建筑楼层
       childBackParam: {}
     };
   },
@@ -151,6 +151,8 @@ export default {
         if (this.childBackParam.zone) {
           this.changeCascader(this.buildFloorSelectd);
           this.$refs.floorCascader.setValue(this.buildFloorSelectd)
+        } else {
+          this.$refs.floorCascader.setValue([''])
         }
       })
     },
@@ -213,6 +215,10 @@ export default {
     // 判断切换至图还是表
     changeGraphyOrTable(num) {
       this.activeTabType = this.getItemForType()
+      if(!this.buildFloorSelectd[0]) {
+        this.$message.warning('请选择建筑楼层')
+        return
+      };
       if (num == 2) {
         this.initMessage();
       } else {
@@ -233,10 +239,6 @@ export default {
         this.$refs.handsontable.getHeader(res.Content, this.buildFloorSelectd);
       })
     },
-    // 批量创建业务空间
-    groupCreateBSpace() {
-      this.$refs.graphy.groupCreateBSpace()
-    },
     checkSpace(list, build, graphyId) {
       this.floor.notRelated = true;
       this.$refs.notRelated.getIdList(list, build, graphyId, this.activeTabType);