|
@@ -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) {
|