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