|
@@ -14,8 +14,8 @@ import { EditScence } from "./mapClass/EditScence";
|
|
|
import bus from "@/bus";
|
|
|
import { saveGroup, readGroup } from "@/api/editer.js";
|
|
|
import { STopologyParser } from "./../lib/parsers/STopologyParser";
|
|
|
-import { uuid } from "@/components/mapClass/until"
|
|
|
-import store from '../store'
|
|
|
+import { uuid } from "@/components/mapClass/until";
|
|
|
+import store from "../store";
|
|
|
|
|
|
let fengmap = null;
|
|
|
|
|
@@ -37,13 +37,13 @@ export default {
|
|
|
appName: "万达可视化系统",
|
|
|
key: "23f30a832a862c58637a4aadbf50a566",
|
|
|
mapServerURL: "/wdfn",
|
|
|
- fmapID: "1001724_29",
|
|
|
canvasWidth: 700,
|
|
|
canvasHeight: 800,
|
|
|
fParser: null,
|
|
|
scene: null,
|
|
|
view: null,
|
|
|
- floorList: {}
|
|
|
+ floorList: {},
|
|
|
+ urlMsg: {}
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -52,7 +52,7 @@ export default {
|
|
|
this.init();
|
|
|
// 挂在bus
|
|
|
this.getBus();
|
|
|
- store.dispatch('getElementType',{PageSize:1000})
|
|
|
+ store.dispatch("getElementType", { PageSize: 1000 });
|
|
|
},
|
|
|
methods: {
|
|
|
init() {
|
|
@@ -62,13 +62,13 @@ export default {
|
|
|
this.scene = new EditScence();
|
|
|
fengmap = new SFengParser(
|
|
|
"fengMap",
|
|
|
- this.mapServerURL + "/" + this.fmapID,
|
|
|
+ this.mapServerURL + "/" + this.urlMsg.fmapID,
|
|
|
this.key,
|
|
|
this.appName,
|
|
|
null
|
|
|
);
|
|
|
const floorid = "f1";
|
|
|
- fengmap.loadMap(this.fmapID, resp => {
|
|
|
+ fengmap.loadMap(this.urlMsg.fmapID, resp => {
|
|
|
console.log("load-map-succ", resp);
|
|
|
this.floorList = resp;
|
|
|
this.parserData(floorid);
|
|
@@ -213,11 +213,11 @@ export default {
|
|
|
const Elements = this.scene.saveMsgItem();
|
|
|
const data = {
|
|
|
Elements,
|
|
|
- Name: "1", // 名称
|
|
|
- categoryId: "NTXT",
|
|
|
- ProjectID: "5", // 项目ID
|
|
|
- BuildingID: "1", // 建筑ID
|
|
|
- FloorID: "1", // 楼层id
|
|
|
+ Name: this.appName, // 名称
|
|
|
+ categoryId: this.urlMsg.categoryId,
|
|
|
+ ProjectID: this.urlMsg.ProjectID, // 项目ID
|
|
|
+ BuildingID: this.urlMsg.BuildingID, // 建筑ID
|
|
|
+ FloorID: this.urlMsg.FloorID // 楼层id
|
|
|
};
|
|
|
saveGroup(data).then(res => {
|
|
|
console.log("aaaaaaaaaaaaaa", res);
|
|
@@ -293,6 +293,38 @@ export default {
|
|
|
},
|
|
|
deep: true
|
|
|
}
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ const href = window.location.href;
|
|
|
+ // 路由
|
|
|
+ // const route = href.split("?")[0];
|
|
|
+ // 参数处理
|
|
|
+ let params = href.split("?")[1];
|
|
|
+ if (!params) {
|
|
|
+ // 参数有问题
|
|
|
+ // return false
|
|
|
+ }
|
|
|
+ params = decodeURIComponent(params);
|
|
|
+ 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"
|
|
|
+ };
|
|
|
+ this.urlMsg = obj;
|
|
|
+ /**
|
|
|
+ * obj:
|
|
|
+
|
|
|
+ */
|
|
|
}
|
|
|
};
|
|
|
</script>
|