|
@@ -31,13 +31,14 @@
|
|
<el-dropdown-item command="groupCreateBSpace">批量创建业务空间</el-dropdown-item>
|
|
<el-dropdown-item command="groupCreateBSpace">批量创建业务空间</el-dropdown-item>
|
|
</el-dropdown-menu>
|
|
</el-dropdown-menu>
|
|
</el-dropdown>
|
|
</el-dropdown>
|
|
|
|
+ <!-- 点击已经关联的业务空间 -->
|
|
|
|
+ <el-button type="primary" plain @click="refactorBSP" :disabled="zoneDisable" style="margin-left:10px;">重新划分业务空间</el-button>
|
|
|
|
+ <el-button type="primary" @click="editeSpaceDetail" :disabled="zoneDisable">编辑空间详情</el-button>
|
|
|
|
+ <el-button plain @click="cancelGraphy" v-show="!zoneDisable">取 消</el-button>
|
|
</div>
|
|
</div>
|
|
<!-- 点击已经关联的业务空间 -->
|
|
<!-- 点击已经关联的业务空间 -->
|
|
- <div v-show="type==2">
|
|
|
|
- <el-button type="primary" plain @click="refactorBSP">重新划分业务空间</el-button>
|
|
|
|
- <el-button type="primary" @click="editeSpaceDetail">编辑空间详情</el-button>
|
|
|
|
- <el-button plain @click="cancelGraphy">取 消</el-button>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <!-- <div v-show="type==2">
|
|
|
|
+ </div> -->
|
|
<!-- 点击未关联的业务空间 -->
|
|
<!-- 点击未关联的业务空间 -->
|
|
<div v-show="type==3">
|
|
<div v-show="type==3">
|
|
<el-button plain @click="createNewZone">创建单个全新的业务空间</el-button>
|
|
<el-button plain @click="createNewZone">创建单个全新的业务空间</el-button>
|
|
@@ -153,6 +154,7 @@ export default {
|
|
zoneList: [], // 业务空间-canvas图中
|
|
zoneList: [], // 业务空间-canvas图中
|
|
groupCreateDialogVis: false, //批量创建业务空间弹窗
|
|
groupCreateDialogVis: false, //批量创建业务空间弹窗
|
|
groupCreateType: 1, //批量创建方式
|
|
groupCreateType: 1, //批量创建方式
|
|
|
|
+ zoneDisable: true, // 重新划分是否禁用
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -169,10 +171,13 @@ export default {
|
|
init(initType) {
|
|
init(initType) {
|
|
this.type = 1;
|
|
this.type = 1;
|
|
if (this.scene) {
|
|
if (this.scene) {
|
|
- this.scene.isZoneSelectable = true;
|
|
|
|
- this.scene.isSpaceSelectable = true;
|
|
|
|
this.scene.clearSpaceSelection();
|
|
this.scene.clearSpaceSelection();
|
|
this.scene.clearZoneSelection();
|
|
this.scene.clearZoneSelection();
|
|
|
|
+ this.scene.clearCut();
|
|
|
|
+ this.scene.clearLikeSpaces();
|
|
|
|
+ this.zoneDisable = true;
|
|
|
|
+ this.scene.isZoneSelectable = true;
|
|
|
|
+ this.scene.isSpaceSelectable = false;
|
|
}
|
|
}
|
|
if (this.buildFloor.indexOf('all') > -1 || this.buildFloor.indexOf('noKnow') > -1) {
|
|
if (this.buildFloor.indexOf('all') > -1 || this.buildFloor.indexOf('noKnow') > -1) {
|
|
return;
|
|
return;
|
|
@@ -235,7 +240,7 @@ export default {
|
|
// 选中当前
|
|
// 选中当前
|
|
zone.selected = true;
|
|
zone.selected = true;
|
|
this.curZoneItem = zone;
|
|
this.curZoneItem = zone;
|
|
- this.type = 2;
|
|
|
|
|
|
+ this.zoneDisable = false;
|
|
this.view.fitSelectedToView();
|
|
this.view.fitSelectedToView();
|
|
},
|
|
},
|
|
// 父组件调用
|
|
// 父组件调用
|
|
@@ -286,6 +291,7 @@ export default {
|
|
})
|
|
})
|
|
this.scene.addSceneMark(newArr)
|
|
this.scene.addSceneMark(newArr)
|
|
}
|
|
}
|
|
|
|
+ this.scene.isSpaceSelectable = false;
|
|
// 绘制业务空间
|
|
// 绘制业务空间
|
|
that.getBusinessSpace();
|
|
that.getBusinessSpace();
|
|
that.view.fitSceneToView();
|
|
that.view.fitSceneToView();
|
|
@@ -363,7 +369,7 @@ export default {
|
|
if (this.type == 3) {
|
|
if (this.type == 3) {
|
|
this.scene.clearSpaceSelection();
|
|
this.scene.clearSpaceSelection();
|
|
}
|
|
}
|
|
- this.type = 2;
|
|
|
|
|
|
+ this.zoneDisable = false;
|
|
this.curZoneItem = item;
|
|
this.curZoneItem = item;
|
|
this.scene.clearZoneSelection();
|
|
this.scene.clearZoneSelection();
|
|
item.selected = true;
|
|
item.selected = true;
|
|
@@ -376,6 +382,7 @@ export default {
|
|
this.config.isEdit = true;
|
|
this.config.isEdit = true;
|
|
this.config.groupSelect = false;
|
|
this.config.groupSelect = false;
|
|
this.config.divide = true;
|
|
this.config.divide = true;
|
|
|
|
+ this.scene.isSpaceSelectable = true;
|
|
// 设置业务空间不可选
|
|
// 设置业务空间不可选
|
|
this.scene.isZoneSelectable = false
|
|
this.scene.isZoneSelectable = false
|
|
},
|
|
},
|
|
@@ -475,16 +482,30 @@ export default {
|
|
},
|
|
},
|
|
// 创建新的业务空间-弹窗返回确认创建
|
|
// 创建新的业务空间-弹窗返回确认创建
|
|
createRoom(val) {
|
|
createRoom(val) {
|
|
- let arr = this.scene.getSelectedSpaces();
|
|
|
|
let zoneObj = { Outline: [], Height: 0 }, IspaceIdList = [];
|
|
let zoneObj = { Outline: [], Height: 0 }, IspaceIdList = [];
|
|
- arr.map(t => {
|
|
|
|
|
|
+ let selectSpaces = this.scene.getSelectedSpaces();
|
|
|
|
+ selectSpaces.map(t => {
|
|
zoneObj.Outline.push(t.data.OutLine);
|
|
zoneObj.Outline.push(t.data.OutLine);
|
|
IspaceIdList.push(this.BIMIDToSID[t.data.SourceId]);
|
|
IspaceIdList.push(this.BIMIDToSID[t.data.SourceId]);
|
|
- console.log(zoneObj.Height)
|
|
|
|
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;
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+ // 如果有划分,求交集
|
|
|
|
+ if (this.scene.cutItem) {
|
|
|
|
+ zoneObj.Outline = [];
|
|
|
|
+ let arr = this.scene.getIntersect();
|
|
|
|
+ arr.map(t => {
|
|
|
|
+ let temp = t.map(item => {
|
|
|
|
+ return {
|
|
|
|
+ X: item.x,
|
|
|
|
+ Y: -item.y,
|
|
|
|
+ Z: 0
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ zoneObj.Outline.push([temp]);
|
|
|
|
+ })
|
|
|
|
+ }
|
|
zoneObj.RoomLocalName = val;
|
|
zoneObj.RoomLocalName = val;
|
|
zoneObj.BuildingId = this.buildFloor[0];
|
|
zoneObj.BuildingId = this.buildFloor[0];
|
|
zoneObj.FloorId = this.buildFloor[1];
|
|
zoneObj.FloorId = this.buildFloor[1];
|
|
@@ -514,31 +535,66 @@ export default {
|
|
},
|
|
},
|
|
// 重新划分业务空间
|
|
// 重新划分业务空间
|
|
refactorBSP() {
|
|
refactorBSP() {
|
|
|
|
+ this.config.isEdit = true;
|
|
|
|
+ this.config.groupSelect = false;
|
|
|
|
+ this.config.divide = true;
|
|
this.type = 4;
|
|
this.type = 4;
|
|
- // 清空选中空间
|
|
|
|
- this.scene.clearSpaceSelection();
|
|
|
|
// 设置空间可选
|
|
// 设置空间可选
|
|
this.scene.isSpaceSelectable = true;
|
|
this.scene.isSpaceSelectable = true;
|
|
// 将已关联的设置不可选,并将当前选的隐藏
|
|
// 将已关联的设置不可选,并将当前选的隐藏
|
|
this.scene.isZoneSelectable = false;
|
|
this.scene.isZoneSelectable = false;
|
|
this.curZoneItem.visible = false;
|
|
this.curZoneItem.visible = false;
|
|
|
|
+ // 将当前业务空间的每个元素添加到场景中并选中
|
|
|
|
+ this.scene.addAllLikeSpace(this.curZoneItem.data.OutLine);
|
|
},
|
|
},
|
|
// 重新划分--保存
|
|
// 重新划分--保存
|
|
saveRefactorBSP() {
|
|
saveRefactorBSP() {
|
|
- let arr = this.scene.getSelectedSpaces();
|
|
|
|
|
|
+ let selectSpace = this.scene.getSelectedSpaces();
|
|
|
|
+ let selectLikeSpace = this.scene.getSelectedLikeSpace();
|
|
//更新业务空间
|
|
//更新业务空间
|
|
let zoneObj = { Outline: [], Height: 0 }, IspaceIdList = [];
|
|
let zoneObj = { Outline: [], Height: 0 }, IspaceIdList = [];
|
|
- arr.map(t => {
|
|
|
|
|
|
+ // 空间
|
|
|
|
+ selectSpace.map(t => {
|
|
zoneObj.Outline.push(t.data.OutLine);
|
|
zoneObj.Outline.push(t.data.OutLine);
|
|
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;
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- zoneObj.RoomID = this.curZoneItem.data.RoomID;
|
|
|
|
|
|
+ // 类空间
|
|
|
|
+ selectLikeSpace.map(t => {
|
|
|
|
+ zoneObj.Outline.push(t.data);
|
|
|
|
+ })
|
|
|
|
+ // 如果有划分,求交集
|
|
|
|
+ if (this.scene.cutItem) {
|
|
|
|
+ zoneObj.Outline = [];
|
|
|
|
+ let spaceIntersect = this.scene.getIntersect();
|
|
|
|
+ spaceIntersect.map(t => {
|
|
|
|
+ let temp = t.map(item => {
|
|
|
|
+ return {
|
|
|
|
+ X: item.x,
|
|
|
|
+ Y: -item.y,
|
|
|
|
+ Z: 0
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ zoneObj.Outline.push([temp]);
|
|
|
|
+ })
|
|
|
|
+ let likeSpaceIntersect = this.scene.getLikeIntersect();
|
|
|
|
+ likeSpaceIntersect.map(t => {
|
|
|
|
+ let temp = t.map(item => {
|
|
|
|
+ return {
|
|
|
|
+ X: item.x,
|
|
|
|
+ Y: -item.y,
|
|
|
|
+ Z: 0
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ zoneObj.Outline.push([temp]);
|
|
|
|
+ })
|
|
|
|
+ }
|
|
if (!zoneObj.Outline.length) {
|
|
if (!zoneObj.Outline.length) {
|
|
zoneObj.Outline = null;
|
|
zoneObj.Outline = null;
|
|
}
|
|
}
|
|
|
|
+ zoneObj.RoomID = this.curZoneItem.data.RoomID;
|
|
this.updateBSPOutline(zoneObj, IspaceIdList)
|
|
this.updateBSPOutline(zoneObj, IspaceIdList)
|
|
},
|
|
},
|
|
// 批量创建所选业务空间
|
|
// 批量创建所选业务空间
|
|
@@ -682,11 +738,11 @@ export default {
|
|
},
|
|
},
|
|
// 切割划分
|
|
// 切割划分
|
|
divide() {
|
|
divide() {
|
|
- this.scene.isMarking = true;
|
|
|
|
|
|
+ this.scene.isCutting = true;
|
|
},
|
|
},
|
|
// 清除切割划分
|
|
// 清除切割划分
|
|
clearDivide() {
|
|
clearDivide() {
|
|
- this.scene.clearSceneMark()
|
|
|
|
|
|
+ this.scene.clearCut();
|
|
},
|
|
},
|
|
// 撤销
|
|
// 撤销
|
|
undo() {
|
|
undo() {
|
|
@@ -731,7 +787,16 @@ export default {
|
|
this.$refs.canvasFun.active = '';
|
|
this.$refs.canvasFun.active = '';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ "scene.isCutting": {
|
|
|
|
+ handler(n) {
|
|
|
|
+ if (!n) {
|
|
|
|
+ this.$refs.canvasFun.active = '';
|
|
|
|
+ this.$refs.canvasFun.isSwitch = false;
|
|
|
|
+ this.scene.isAbsorbing = false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
@@ -757,7 +822,8 @@ export default {
|
|
width: 320px;
|
|
width: 320px;
|
|
margin-right: 10px;
|
|
margin-right: 10px;
|
|
}
|
|
}
|
|
- .button-group button {
|
|
|
|
|
|
+ .button-group button,
|
|
|
|
+ .button-group .el-dropdown {
|
|
display: block;
|
|
display: block;
|
|
float: left;
|
|
float: left;
|
|
}
|
|
}
|