|
@@ -18,7 +18,7 @@
|
|
</div>
|
|
</div>
|
|
<div class="button-group">
|
|
<div class="button-group">
|
|
<!-- 默认操作模式 -->
|
|
<!-- 默认操作模式 -->
|
|
- <div v-show="type==1">
|
|
|
|
|
|
+ <div v-if="type==1">
|
|
<el-dropdown split-button type="primary" @click="editGraphy" @command="handleCommand">
|
|
<el-dropdown split-button type="primary" @click="editGraphy" @command="handleCommand">
|
|
创建业务空间
|
|
创建业务空间
|
|
<el-dropdown-menu slot="dropdown">
|
|
<el-dropdown-menu slot="dropdown">
|
|
@@ -32,17 +32,17 @@
|
|
<el-button plain @click="cancelGraphy" v-show="!zoneDisable">取 消</el-button>
|
|
<el-button plain @click="cancelGraphy" v-show="!zoneDisable">取 消</el-button>
|
|
</div>
|
|
</div>
|
|
<!-- 点击未关联的业务空间 -->
|
|
<!-- 点击未关联的业务空间 -->
|
|
- <div v-show="type==3">
|
|
|
|
|
|
+ <div v-if="type==3">
|
|
<el-button plain @click="createNewZone">创建单个全新的业务空间</el-button>
|
|
<el-button plain @click="createNewZone">创建单个全新的业务空间</el-button>
|
|
<el-button plain @click="cancelGraphy">取 消</el-button>
|
|
<el-button plain @click="cancelGraphy">取 消</el-button>
|
|
</div>
|
|
</div>
|
|
<!-- 重新划分业务空间 -->
|
|
<!-- 重新划分业务空间 -->
|
|
- <div v-show="type==4">
|
|
|
|
|
|
+ <div v-if="type==4">
|
|
<el-button plain @click="cancelGraphy">取 消</el-button>
|
|
<el-button plain @click="cancelGraphy">取 消</el-button>
|
|
<el-button type="primary" @click="saveRefactorBSP">保存</el-button>
|
|
<el-button type="primary" @click="saveRefactorBSP">保存</el-button>
|
|
</div>
|
|
</div>
|
|
<!-- 批量创建所选业务空间 -->
|
|
<!-- 批量创建所选业务空间 -->
|
|
- <div v-show="type==5">
|
|
|
|
|
|
+ <div v-if="type==5">
|
|
<el-button type="primary" @click="groupCreateZone">批量创建所选业务空间</el-button>
|
|
<el-button type="primary" @click="groupCreateZone">批量创建所选业务空间</el-button>
|
|
<el-button plain @click="cancelGraphy">取 消</el-button>
|
|
<el-button plain @click="cancelGraphy">取 消</el-button>
|
|
</div>
|
|
</div>
|
|
@@ -220,7 +220,6 @@ export default class spaceGraph extends Vue {
|
|
this.scene.isSpaceSelectable = false;
|
|
this.scene.isSpaceSelectable = false;
|
|
}
|
|
}
|
|
this.getBussiness();
|
|
this.getBussiness();
|
|
- this.canvasLoading = false;
|
|
|
|
}
|
|
}
|
|
// 清除canvas
|
|
// 清除canvas
|
|
clearGraphy() {
|
|
clearGraphy() {
|
|
@@ -269,24 +268,27 @@ export default class spaceGraph extends Vue {
|
|
}
|
|
}
|
|
// 创建新的业务空间
|
|
// 创建新的业务空间
|
|
createNewZone() {
|
|
createNewZone() {
|
|
- let arr = this.scene?.selectContainer.itemList;
|
|
|
|
- if (arr.length) {
|
|
|
|
- let tempArr = [];
|
|
|
|
- this.localFun = [];
|
|
|
|
- arr.map((t) => {
|
|
|
|
- tempArr.push(this.BIMIDToSIName[t.data.SourceId]);
|
|
|
|
- if (
|
|
|
|
- this.sourceIdToISP[t.data.SourceId] &&
|
|
|
|
- this.sourceIdToISP[t.data.SourceId].infos
|
|
|
|
- ) {
|
|
|
|
- this.localFun.push(
|
|
|
|
|
|
+ if (this.scene) {
|
|
|
|
+ let arr = this.scene.selectContainer.itemList;
|
|
|
|
+ if (arr.length || this.scene.drawItem) {
|
|
|
|
+ // 手绘的空间只有轮廓线可用
|
|
|
|
+ let tempArr = [];
|
|
|
|
+ this.localFun = [];
|
|
|
|
+ arr.map((t) => {
|
|
|
|
+ tempArr.push(this.BIMIDToSIName[t.data.SourceId]);
|
|
|
|
+ if (
|
|
|
|
+ this.sourceIdToISP[t.data.SourceId] &&
|
|
this.sourceIdToISP[t.data.SourceId].infos
|
|
this.sourceIdToISP[t.data.SourceId].infos
|
|
- );
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- this.$refs.createBSP.showDialog(tempArr.toString());
|
|
|
|
- } else {
|
|
|
|
- this.$message.warning("请至少选择一个空间");
|
|
|
|
|
|
+ ) {
|
|
|
|
+ this.localFun.push(
|
|
|
|
+ this.sourceIdToISP[t.data.SourceId].infos
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ this.$refs.createBSP.showDialog(tempArr.toString());
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.warning("请至少选择一个空间");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
handleCommand() {}
|
|
handleCommand() {}
|
|
@@ -385,7 +387,7 @@ export default class spaceGraph extends Vue {
|
|
zoneObj.infos = temp[0];
|
|
zoneObj.infos = temp[0];
|
|
}
|
|
}
|
|
if (this.scene) {
|
|
if (this.scene) {
|
|
- zoneObj = this.calIntersect(zoneObj);
|
|
|
|
|
|
+ zoneObj = this.setZoneOutline(zoneObj);
|
|
this.handleUpdateZone(zoneObj);
|
|
this.handleUpdateZone(zoneObj);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -436,7 +438,11 @@ export default class spaceGraph extends Vue {
|
|
zoneObj.infos = this.localFun[0];
|
|
zoneObj.infos = this.localFun[0];
|
|
}
|
|
}
|
|
if (this.scene) {
|
|
if (this.scene) {
|
|
- zoneObj = this.calIntersect(zoneObj);
|
|
|
|
|
|
+ // 旧逻辑--计算区域交集--
|
|
|
|
+ // zoneObj = this.calIntersect(zoneObj);
|
|
|
|
+
|
|
|
|
+ // 设置业务空间轮廓线
|
|
|
|
+ zoneObj = this.setZoneOutline(zoneObj);
|
|
this.handleCreateZone(zoneObj);
|
|
this.handleCreateZone(zoneObj);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -499,6 +505,37 @@ export default class spaceGraph extends Vue {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+ * 新逻辑添加业务空间轮廓线
|
|
|
|
+ */
|
|
|
|
+ setZoneOutline(zoneObj: any) {
|
|
|
|
+ if (this.scene) {
|
|
|
|
+ if (this.scene.drawItem) {
|
|
|
|
+ if (
|
|
|
|
+ this.scene.drawItem.pointList.length &&
|
|
|
|
+ this.scene.drawItem.pointList.length > 2
|
|
|
|
+ ) {
|
|
|
|
+ const temp = this.scene.drawItem.pointList.map((t) => {
|
|
|
|
+ return {
|
|
|
|
+ X: t.x,
|
|
|
|
+ Y: -t.y,
|
|
|
|
+ Z: 0,
|
|
|
|
+ };
|
|
|
|
+ });
|
|
|
|
+ zoneObj.outline.push([temp]);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ let arr = this.scene.selectContainer.itemList;
|
|
|
|
+ if (arr.length) {
|
|
|
|
+ arr.forEach((t) => {
|
|
|
|
+ if (t instanceof SSpaceItem)
|
|
|
|
+ zoneObj.outline.push(t.data.OutLine);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return zoneObj;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
* 创建业务空间接口
|
|
* 创建业务空间接口
|
|
*/
|
|
*/
|
|
handleCreateZone(zoneObj: any) {
|
|
handleCreateZone(zoneObj: any) {
|
|
@@ -551,7 +588,7 @@ export default class spaceGraph extends Vue {
|
|
// 切割划分
|
|
// 切割划分
|
|
divide() {
|
|
divide() {
|
|
if (this.scene) {
|
|
if (this.scene) {
|
|
- this.scene.drawCmd = "cut";
|
|
|
|
|
|
+ this.scene.drawCmd = "zoneDraw";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 清除切割划分
|
|
// 清除切割划分
|