|
@@ -15,6 +15,7 @@ import bus from "@/bus";
|
|
import { saveGroup, readGroup } from "@/api/editer.js";
|
|
import { saveGroup, readGroup } from "@/api/editer.js";
|
|
import { STopologyParser } from "./../lib/parsers/STopologyParser";
|
|
import { STopologyParser } from "./../lib/parsers/STopologyParser";
|
|
import { uuid } from "@/components/mapClass/until";
|
|
import { uuid } from "@/components/mapClass/until";
|
|
|
|
+import { SImageItem } from '@saga-web/graph/lib'
|
|
import store from "../store";
|
|
import store from "../store";
|
|
|
|
|
|
let fengmap = null;
|
|
let fengmap = null;
|
|
@@ -60,20 +61,24 @@ export default {
|
|
document.getElementById(`canvas`).focus();
|
|
document.getElementById(`canvas`).focus();
|
|
this.clearGraphy();
|
|
this.clearGraphy();
|
|
this.scene = new EditScence();
|
|
this.scene = new EditScence();
|
|
- console.log(this.urlMsg.fmapID,)
|
|
|
|
fengmap = new SFengParser(
|
|
fengmap = new SFengParser(
|
|
"fengMap",
|
|
"fengMap",
|
|
- this.mapServerURL + "/" + this.urlMsg.fmapID,
|
|
|
|
|
|
+ this.mapServerURL + "/fmap/" + this.urlMsg.fmapID,
|
|
this.key,
|
|
this.key,
|
|
this.appName,
|
|
this.appName,
|
|
null
|
|
null
|
|
);
|
|
);
|
|
- const floorid = "f1";
|
|
|
|
|
|
+ console.log(this.urlMsg.fmapID)
|
|
|
|
+ const floorid = this.urlMsg.FloorID;
|
|
fengmap.loadMap(this.urlMsg.fmapID, resp => {
|
|
fengmap.loadMap(this.urlMsg.fmapID, resp => {
|
|
this.floorList = resp;
|
|
this.floorList = resp;
|
|
- this.parserData(floorid);
|
|
|
|
|
|
+ fengmap.loadTheme(`${this.mapServerURL}/webtheme/${this.urlMsg.fmapID}/${this.urlMsg.fmapID}.theme`).then(response => {
|
|
|
|
+ console.log('获取rf成功', response)
|
|
|
|
+ this.parserData(floorid);
|
|
|
|
+ })
|
|
this.view.fitSceneToView();
|
|
this.view.fitSceneToView();
|
|
});
|
|
});
|
|
|
|
+ // 获取主题数据
|
|
this.readGroup().then(data => {
|
|
this.readGroup().then(data => {
|
|
const parserData = new STopologyParser(null);
|
|
const parserData = new STopologyParser(null);
|
|
parserData.parseData(data.data.Data[0].Elements);
|
|
parserData.parseData(data.data.Data[0].Elements);
|
|
@@ -114,31 +119,44 @@ export default {
|
|
this.scene.emitChange = this.emitChange;
|
|
this.scene.emitChange = this.emitChange;
|
|
},
|
|
},
|
|
parserData(floor) {
|
|
parserData(floor) {
|
|
- if (this.floorList[floor]) {
|
|
|
|
- fengmap.parseData(this.floorList[floor], res => {
|
|
|
|
- if (res.err) {
|
|
|
|
- console.log(res.err);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- this.fParser = new SFloorParser(null);
|
|
|
|
- this.fParser.parseData(res);
|
|
|
|
- this.fParser.spaceList.forEach(t => {
|
|
|
|
- t.selectable = true;
|
|
|
|
- this.scene.addItem(t);
|
|
|
|
- });
|
|
|
|
- this.fParser.wallList.forEach(t => this.scene.addItem(t));
|
|
|
|
- this.fParser.virtualWallList.forEach(t => this.scene.addItem(t));
|
|
|
|
- this.fParser.doorList.forEach(t => this.scene.addItem(t));
|
|
|
|
- this.fParser.columnList.forEach(t => this.scene.addItem(t));
|
|
|
|
- this.fParser.casementList.forEach(t => this.scene.addItem(t));
|
|
|
|
- this.view.scene = this.scene;
|
|
|
|
- this.view.fitSceneToView();
|
|
|
|
- this.loading = false;
|
|
|
|
- this.isQuerying = false;
|
|
|
|
- console.log("success");
|
|
|
|
- });
|
|
|
|
|
|
+ floor = 'g80'
|
|
|
|
+ if (floor == 'g80') {
|
|
|
|
+ // 屋顶
|
|
|
|
+ if (fengmap.frImg) {
|
|
|
|
+ const imgItem = new SImageItem(null, `${this.mapServerURL}/webtheme/${this.urlMsg.fmapID}/${fengmap.frImg}`)
|
|
|
|
+ this.scene.addItem(imgItem)
|
|
|
|
+ this.view.scene = this.scene
|
|
|
|
+ this.view.fitSceneToView()
|
|
|
|
+ this.loading = false
|
|
|
|
+ this.isQuerying = false
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
- console.log("楼层不正确");
|
|
|
|
|
|
+ if (this.floorList[floor]) {
|
|
|
|
+ fengmap.parseData(this.floorList[floor], res => {
|
|
|
|
+ if (res.err) {
|
|
|
|
+ console.log(res.err);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ this.fParser = new SFloorParser(null);
|
|
|
|
+ this.fParser.parseData(res);
|
|
|
|
+ this.fParser.spaceList.forEach(t => {
|
|
|
|
+ t.selectable = true;
|
|
|
|
+ this.scene.addItem(t);
|
|
|
|
+ });
|
|
|
|
+ this.fParser.wallList.forEach(t => this.scene.addItem(t));
|
|
|
|
+ this.fParser.virtualWallList.forEach(t => this.scene.addItem(t));
|
|
|
|
+ this.fParser.doorList.forEach(t => this.scene.addItem(t));
|
|
|
|
+ this.fParser.columnList.forEach(t => this.scene.addItem(t));
|
|
|
|
+ this.fParser.casementList.forEach(t => this.scene.addItem(t));
|
|
|
|
+ this.view.scene = this.scene;
|
|
|
|
+ this.view.fitSceneToView();
|
|
|
|
+ this.loading = false;
|
|
|
|
+ this.isQuerying = false;
|
|
|
|
+ console.log("success");
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ console.log("楼层不正确");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 监听变化
|
|
// 监听变化
|
|
@@ -310,7 +328,7 @@ export default {
|
|
params = decodeURIComponent(params);
|
|
params = decodeURIComponent(params);
|
|
// params = "categoryId=NTXT&ProjectID=5&BuildingID=1&FloorID=1"; // mock 参数
|
|
// params = "categoryId=NTXT&ProjectID=5&BuildingID=1&FloorID=1"; // mock 参数
|
|
const paramsArr = params.split("&");
|
|
const paramsArr = params.split("&");
|
|
- console.log('paramsArr',paramsArr)
|
|
|
|
|
|
+ console.log('paramsArr', paramsArr)
|
|
const obj = {};
|
|
const obj = {};
|
|
paramsArr.map(item => {
|
|
paramsArr.map(item => {
|
|
const arr = item.split("=");
|
|
const arr = item.split("=");
|