|
@@ -46,6 +46,11 @@
|
|
|
<el-button type="primary" @click="groupCreateZone">批量创建所选业务空间</el-button>
|
|
|
<el-button plain @click="cancelGraphy">取 消</el-button>
|
|
|
</div>
|
|
|
+ <!-- 保存墙 -->
|
|
|
+ <div v-if="type==6">
|
|
|
+ <el-button plain @click="cancelGraphy">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="saveMap">保存</el-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</el-row>
|
|
|
|
|
@@ -53,7 +58,8 @@
|
|
|
|
|
|
<el-row class="canvas-actions-box">
|
|
|
<canvas-fun :config="config" @fit="fit" @savePng="savePng" @saveSvg="saveSvg" @divide="divide" @clearDivide="clearDivide"
|
|
|
- ref="canvasFun" @saveJson="saveJson" @changeAbsorb="changeAbsorb" @scale="scale" @groupSelect="groupSelect" />
|
|
|
+ ref="canvasFun" @saveJson="saveJson" @changeAbsorb="changeAbsorb" @scale="scale" @groupSelect="groupSelect"
|
|
|
+ @drawWall="drawWall" />
|
|
|
</el-row>
|
|
|
</div>
|
|
|
<div v-show="!floorKey">
|
|
@@ -98,6 +104,7 @@ export default class spaceGraph extends Vue {
|
|
|
isEdit: false,
|
|
|
divide: true,
|
|
|
groupSelect: false,
|
|
|
+ drawWall: false,
|
|
|
};
|
|
|
search = ""; //搜索
|
|
|
zoneDisable = true;
|
|
@@ -131,11 +138,10 @@ export default class spaceGraph extends Vue {
|
|
|
this.canvasLoading = true;
|
|
|
if (floor.infos && floor.infos.floorMap) {
|
|
|
this.floor = floor;
|
|
|
- const url = this.mapBaseUrl + floor.infos.floorMap;
|
|
|
- if (url == this.floorKey) {
|
|
|
+ if (floor.infos.floorMap == this.floorKey) {
|
|
|
this.init(2);
|
|
|
} else {
|
|
|
- this.floorKey = this.mapBaseUrl + floor.infos.floorMap;
|
|
|
+ this.floorKey = floor.infos.floorMap;
|
|
|
this.init(1);
|
|
|
}
|
|
|
} else {
|
|
@@ -176,6 +182,7 @@ export default class spaceGraph extends Vue {
|
|
|
isEdit: false,
|
|
|
divide: true,
|
|
|
groupSelect: true,
|
|
|
+ drawWall: false,
|
|
|
};
|
|
|
if (this.$refs.canvasFun) {
|
|
|
// @ts-ignore
|
|
@@ -191,7 +198,7 @@ export default class spaceGraph extends Vue {
|
|
|
this.clearGraphy();
|
|
|
this.scene = null;
|
|
|
console.log(this.floorKey);
|
|
|
- scene.loadUrl(this.floorKey).then((res) => {
|
|
|
+ scene.loadUrl(this.mapBaseUrl + this.floorKey).then((res) => {
|
|
|
if (this.view) {
|
|
|
this.view.scene = scene;
|
|
|
}
|
|
@@ -259,6 +266,7 @@ export default class spaceGraph extends Vue {
|
|
|
this.config.isEdit = true;
|
|
|
this.config.groupSelect = false;
|
|
|
this.config.divide = true;
|
|
|
+ this.config.drawWall = false;
|
|
|
if (this.scene) {
|
|
|
this.scene.isSpaceSelectable = true;
|
|
|
this.scene.isZoneSelectable = false;
|
|
@@ -291,12 +299,27 @@ export default class spaceGraph extends Vue {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- handleCommand() {}
|
|
|
+ // 下拉菜单
|
|
|
+ handleCommand(command: string) {
|
|
|
+ if (command == "createWall") {
|
|
|
+ // 绘制墙
|
|
|
+ this.config.isEdit = true;
|
|
|
+ this.config.groupSelect = false;
|
|
|
+ this.config.divide = false;
|
|
|
+ this.config.drawWall = true;
|
|
|
+ this.type = 6;
|
|
|
+ if (this.scene) {
|
|
|
+ this.scene.isSpaceSelectable = false;
|
|
|
+ this.scene.isZoneSelectable = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
// 编辑业务空间
|
|
|
refactorBSP() {
|
|
|
this.config.isEdit = true;
|
|
|
this.config.groupSelect = false;
|
|
|
this.config.divide = true;
|
|
|
+ this.config.drawWall = false;
|
|
|
if (this.scene) {
|
|
|
this.scene.isZoneSelectable = false;
|
|
|
this.scene.isSpaceSelectable = true;
|
|
@@ -448,6 +471,20 @@ export default class spaceGraph extends Vue {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 生成底图json
|
|
|
+ */
|
|
|
+ saveMap() {}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 画墙
|
|
|
+ */
|
|
|
+ drawWall() {
|
|
|
+ if (this.scene) {
|
|
|
+ this.scene.drawCmd = "wallDraw";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 单个计算交集
|
|
|
*/
|
|
|
calIntersect(zoneObj: any) {
|
|
@@ -583,7 +620,18 @@ export default class spaceGraph extends Vue {
|
|
|
}
|
|
|
// 保存json
|
|
|
saveJson() {
|
|
|
- this.view?.saveFloorJson(`1.json`);
|
|
|
+ console.log(this.scene);
|
|
|
+
|
|
|
+ this.scene?.getMapObject();
|
|
|
+ return;
|
|
|
+ try {
|
|
|
+ this.view?.saveFloorJson(
|
|
|
+ `${this.floor.build}-${this.floor.localName}.json`
|
|
|
+ );
|
|
|
+ } catch (err) {
|
|
|
+ console.log(err);
|
|
|
+ this.view?.saveFloorJson(`1.json`);
|
|
|
+ }
|
|
|
}
|
|
|
// 切割划分
|
|
|
divide() {
|