|
@@ -43,6 +43,7 @@ export default {
|
|
|
scene: null,
|
|
|
view: null,
|
|
|
floorList: {},
|
|
|
+ fmapID:'1000423_120',
|
|
|
urlMsg: {}
|
|
|
};
|
|
|
},
|
|
@@ -62,16 +63,16 @@ export default {
|
|
|
this.scene = new EditScence();
|
|
|
fengmap = new SFengParser(
|
|
|
"fengMap",
|
|
|
- this.mapServerURL + "/" + this.urlMsg.fmapID,
|
|
|
+ this.mapServerURL + "/" + this.fmapID,
|
|
|
this.key,
|
|
|
this.appName,
|
|
|
null
|
|
|
);
|
|
|
const floorid = "f1";
|
|
|
- fengmap.loadMap(this.urlMsg.fmapID, resp => {
|
|
|
- console.log("load-map-succ", resp);
|
|
|
+ fengmap.loadMap(this.fmapID, resp => {
|
|
|
this.floorList = resp;
|
|
|
this.parserData(floorid);
|
|
|
+ this.view.fitSceneToView();
|
|
|
});
|
|
|
this.readGroup().then(data => {
|
|
|
const parserData = new STopologyParser(null);
|
|
@@ -107,7 +108,9 @@ export default {
|
|
|
this.scene.addItem(t);
|
|
|
this.scene.Relations.push(t);
|
|
|
});
|
|
|
+ this.view.fitSceneToView();
|
|
|
});
|
|
|
+
|
|
|
this.scene.emitChange = this.emitChange;
|
|
|
},
|
|
|
parserData(floor) {
|
|
@@ -215,7 +218,7 @@ export default {
|
|
|
Elements,
|
|
|
Name: this.appName, // 名称
|
|
|
categoryId: this.urlMsg.categoryId,
|
|
|
- ProjectID: this.urlMsg.ProjectID, // 项目ID
|
|
|
+ ProjectID: this.urlMsg.projectId, // 项目ID
|
|
|
BuildingID: this.urlMsg.BuildingID, // 建筑ID
|
|
|
FloorID: this.urlMsg.FloorID // 楼层id
|
|
|
};
|
|
@@ -271,8 +274,8 @@ export default {
|
|
|
// 读取数据
|
|
|
readGroup() {
|
|
|
const data = {
|
|
|
- categoryId: "NTXT",
|
|
|
- projectId: 5
|
|
|
+ categoryId: this.urlMsg.categoryId,
|
|
|
+ projectId: this.urlMsg.projectId
|
|
|
};
|
|
|
return readGroup(data);
|
|
|
}
|
|
@@ -302,24 +305,17 @@ export default {
|
|
|
let params = href.split("?")[1];
|
|
|
if (!params) {
|
|
|
// 参数有问题
|
|
|
- // return false
|
|
|
+ return false
|
|
|
}
|
|
|
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("&");
|
|
|
- // console.log(paramsArr)
|
|
|
- let obj = {};
|
|
|
- // paramsArr.map(item => {
|
|
|
- // const arr = item.split("=");
|
|
|
- // obj[arr[0]] = arr[1];
|
|
|
- // });
|
|
|
- obj = {
|
|
|
- categoryId: "NTXT",
|
|
|
- ProjectID: "5",
|
|
|
- BuildingID: "1",
|
|
|
- FloorID: "1",
|
|
|
- fmapID: "1001724_29"
|
|
|
- };
|
|
|
+ console.log('paramsArr',paramsArr)
|
|
|
+ const obj = {};
|
|
|
+ paramsArr.map(item => {
|
|
|
+ const arr = item.split("=");
|
|
|
+ obj[arr[0]] = arr[1];
|
|
|
+ });
|
|
|
this.urlMsg = obj;
|
|
|
/**
|
|
|
* obj:
|