|
@@ -604,21 +604,48 @@ export default {
|
|
|
// 根据图批量创建所选业务空间
|
|
|
groupCreateZone() {
|
|
|
let arr = this.scene.getSelectedSpaces();
|
|
|
- let spaces = arr.map(t => {
|
|
|
- return {
|
|
|
- IspaceId: this.BIMIDToSID[t.data.SourceId],
|
|
|
- RoomLocalName: t.data.Name,
|
|
|
- Outline: [t.data.OutLine],
|
|
|
- BuildingId: this.buildFloor[0],
|
|
|
- FloorId: this.buildFloor[1],
|
|
|
- Height: t.data.Height > 100 ? (t.data.Height / 1000).toFixed(2) : t.data.Height || 0
|
|
|
+ let spaces = [];
|
|
|
+ // 如果有划分,求交集
|
|
|
+ if (this.scene.cutItem || this.scene.sceneMark) {
|
|
|
+ let outlines = this.scene.getIntersectInSpace();
|
|
|
+ for (let k in outlines) {
|
|
|
+ outlines[k] = outlines[k].map(t => {
|
|
|
+ t = t.map(item => {
|
|
|
+ item = item.map(j => {
|
|
|
+ return { X: j.x, Y: -j.y, Z: 0 }
|
|
|
+ })
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ return t;
|
|
|
+ })
|
|
|
}
|
|
|
- })
|
|
|
+ spaces = arr.map(t => {
|
|
|
+ return {
|
|
|
+ IspaceId: this.BIMIDToSID[t.data.SourceId],
|
|
|
+ RoomLocalName: t.data.Name,
|
|
|
+ Outline: outlines[t.data.SourceId],
|
|
|
+ BuildingId: this.buildFloor[0],
|
|
|
+ FloorId: this.buildFloor[1],
|
|
|
+ Height: t.data.Height > 100 ? (t.data.Height / 1000).toFixed(2) : t.data.Height || 0
|
|
|
+ }
|
|
|
+ }).filter(item => item.Outline && item.Outline.length)
|
|
|
+ } else {
|
|
|
+ spaces = arr.map(t => {
|
|
|
+ return {
|
|
|
+ IspaceId: this.BIMIDToSID[t.data.SourceId],
|
|
|
+ RoomLocalName: t.data.Name,
|
|
|
+ Outline: [t.data.OutLine],
|
|
|
+ BuildingId: this.buildFloor[0],
|
|
|
+ FloorId: this.buildFloor[1],
|
|
|
+ Height: t.data.Height > 100 ? (t.data.Height / 1000).toFixed(2) : t.data.Height || 0
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
if (spaces.length) {
|
|
|
this.canvasLoading = true;
|
|
|
this.groupCreateBSP(spaces)
|
|
|
} else {
|
|
|
- this.$message.warning('未选择空间');
|
|
|
+ this.$message.warning('未选择本层空间');
|
|
|
}
|
|
|
},
|
|
|
// 更新业务空间和元空间的关系
|
|
@@ -753,7 +780,7 @@ export default {
|
|
|
},
|
|
|
// 框选
|
|
|
groupSelect() {
|
|
|
- this.scene.isRectSelection = true;
|
|
|
+ this.scene.isRectSelection = 1;
|
|
|
},
|
|
|
// 适配底图到窗口
|
|
|
fit() {
|