|
@@ -29,7 +29,7 @@
|
|
|
</div>
|
|
|
<!-- 点击已经关联的业务空间 -->
|
|
|
<div v-show="type==2">
|
|
|
- <el-button type="primary" plain>重新划分业务空间</el-button>
|
|
|
+ <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>
|
|
@@ -42,7 +42,7 @@
|
|
|
<!-- 重新划分业务空间 -->
|
|
|
<div v-show="type==4">
|
|
|
<el-button plain @click="cancelGraphy">取 消</el-button>
|
|
|
- <el-button type="primary">保存</el-button>
|
|
|
+ <el-button type="primary" @click="saveRefactorBSP">保存</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div style="position: absolute;right: 0;">
|
|
@@ -120,6 +120,7 @@ export default {
|
|
|
isAction: false,
|
|
|
curOutline: [],
|
|
|
BIMIDToSID: {}, //bimid映射元空间id
|
|
|
+ curZoneItem: {}, //当前选中的业务空间item
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -260,11 +261,21 @@ export default {
|
|
|
// canvas点击事件
|
|
|
canvasClick(item, event) {
|
|
|
console.log(arguments)
|
|
|
- if (item instanceof SpaceItem) {
|
|
|
- this.type = 3;
|
|
|
- }
|
|
|
- if (item instanceof ZoneItem) {
|
|
|
- this.type = 2;
|
|
|
+ this.scene.setSpaceSelectable(true);
|
|
|
+ this.scene.setZoneSelectable(true);
|
|
|
+ if (this.type == 4) {
|
|
|
+
|
|
|
+ } else {
|
|
|
+ if (item instanceof SpaceItem) {
|
|
|
+ this.type = 3;
|
|
|
+ this.curZoneItem = {};
|
|
|
+ this.scene.setZoneSelectable(false);
|
|
|
+ }
|
|
|
+ if (item instanceof ZoneItem) {
|
|
|
+ this.type = 2;
|
|
|
+ this.curZoneItem = item;
|
|
|
+ this.scene.setSpaceSelectable(false);
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
// 编辑平面图
|
|
@@ -360,14 +371,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
createZone(pa, res => {
|
|
|
- let params = {
|
|
|
- SpaceId: res.EntityList[0].RoomID,
|
|
|
- IspaceIdList: IspaceIdList
|
|
|
- }
|
|
|
- createRelateInZoneAndISp(params, res => {
|
|
|
- this.$message.success('创建成功');
|
|
|
- this.init();
|
|
|
- })
|
|
|
+ this.relationInBSPandISP(res.EntityList[0].RoomID, IspaceIdList)
|
|
|
})
|
|
|
},
|
|
|
// 从未关联平面图的业务空间中选择--按钮返回关联信号
|
|
@@ -391,12 +395,48 @@ export default {
|
|
|
},
|
|
|
// 编辑空间详情
|
|
|
editeSpaceDetail() {
|
|
|
+ let item = this.curZoneItem.data;
|
|
|
+ this.$router.push({
|
|
|
+ path: "/ledger/spaceDetail",
|
|
|
+ query: { RoomID: item.RoomID, zone: this.zoneCode, isMyTab: 1 }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 重新划分业务空间
|
|
|
+ refactorBSP() {
|
|
|
+ this.type = 4;
|
|
|
+ // 设置空间可选
|
|
|
+ this.scene.setSpaceSelectable(true);
|
|
|
+ // 将已关联的设置不可选,并将当前选的隐藏
|
|
|
+ this.scene.changeSelectZone(this.curZoneItem);
|
|
|
+ },
|
|
|
+ // 重新划分--保存
|
|
|
+ saveRefactorBSP() {
|
|
|
let arr = this.scene.getSelectedSpaces();
|
|
|
- console.log(arr)
|
|
|
- // this.$router.push({
|
|
|
- // path: "/ledger/spaceDetail",
|
|
|
- // query: { RoomID: infos.RoomID, zone: this.zoneCode, isMyTab: 2 }
|
|
|
- // })
|
|
|
+ //更新业务空间
|
|
|
+ let zoneObj = { Outline: [] }, IspaceIdList = [];
|
|
|
+ arr.map(t => {
|
|
|
+ zoneObj.Outline.push(t.data.OutLine);
|
|
|
+ IspaceIdList.push(this.BIMIDToSID[t.data.SourceId])
|
|
|
+ })
|
|
|
+ zoneObj.RoomID = this.curZoneItem.data.RoomID;
|
|
|
+ let pa = {
|
|
|
+ zone: this.tab.code,
|
|
|
+ data: {
|
|
|
+ Content: [zoneObj]
|
|
|
+ },
|
|
|
+ Projection: ['Outline']
|
|
|
+ }
|
|
|
+ updateZone(pa, res => {
|
|
|
+ this.relationInBSPandISP(zoneObj.RoomID, IspaceIdList)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 更新业务空间和元空间的关系
|
|
|
+ relationInBSPandISP(SpaceId, IspaceIdList) {
|
|
|
+ let pa = { SpaceId: SpaceId, IspaceIdList: IspaceIdList }
|
|
|
+ createRelateInZoneAndISp(pa, res => {
|
|
|
+ this.$message.success('创建成功');
|
|
|
+ this.init();
|
|
|
+ })
|
|
|
},
|
|
|
// canvas 获取焦点
|
|
|
focus() {
|
|
@@ -449,8 +489,8 @@ export default {
|
|
|
redo() { },
|
|
|
// 缩放
|
|
|
scale(val) {
|
|
|
- let scale = this.view.scale
|
|
|
- this.view.scaleByPoint(val / scale, this.cadWidth / 2, this.cadHeight / 2)
|
|
|
+ // let scale = this.view.scale
|
|
|
+ // this.view.scaleByPoint(val / scale, this.cadWidth / 2, this.cadHeight / 2)
|
|
|
},
|
|
|
},
|
|
|
filters: {
|