|
@@ -14,7 +14,7 @@ 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 { uuid } from "@/components/mapClass/until";
|
|
|
export default {
|
|
|
props: {
|
|
|
cmdType: {
|
|
@@ -57,7 +57,7 @@ export default {
|
|
|
this.scene = new EditScence();
|
|
|
this.fmap = new SFengParser(
|
|
|
"fengMap",
|
|
|
- this.mapServerURL + '/1001724_29',
|
|
|
+ this.mapServerURL + "/1001724_29",
|
|
|
this.key,
|
|
|
this.appName,
|
|
|
null
|
|
@@ -85,11 +85,17 @@ export default {
|
|
|
// 多边形
|
|
|
parserData.zoneLegendList.forEach(t => {
|
|
|
this.scene.addItem(t);
|
|
|
- this.scene.Nodes.push(t)
|
|
|
+ this.scene.Nodes.push(t);
|
|
|
});
|
|
|
- parserData.zoneLegendList.forEach(t => {
|
|
|
+ // 增加文字
|
|
|
+ parserData.textMarkerList.forEach(t => {
|
|
|
+ this.scene.addItem(t);
|
|
|
+ this.scene.Markers.push(t);
|
|
|
+ });
|
|
|
+ // 增加图片
|
|
|
+ parserData.imageMarkerList.forEach(t => {
|
|
|
this.scene.addItem(t);
|
|
|
- this.scene.Nodes.push(t)
|
|
|
+ this.scene.Markers.push(t);
|
|
|
});
|
|
|
});
|
|
|
this.scene.emitChange = this.emitChange;
|
|
@@ -169,7 +175,7 @@ export default {
|
|
|
const Elements = this.scene.saveMsgItem();
|
|
|
const data = {
|
|
|
Elements,
|
|
|
- ID: "a36a8b30423a44bba03be989ddc36737", // 如果id为空则为地图
|
|
|
+ ID: "a36a8b30423a44bba03be989ddc36737", // 如果id为空则为地图
|
|
|
Name: "1", // 名称
|
|
|
CategoryID: "", // 图分类ID
|
|
|
ProjectID: "1", // 项目ID
|
|
@@ -182,30 +188,31 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
bus.$on("exportByKey", val => {
|
|
|
- const list = this.fParser.spaceList.map(t => {
|
|
|
- if (t.data.Type == val.key) {
|
|
|
- return {
|
|
|
- ID: uuid(),
|
|
|
- Name: t.name,
|
|
|
- GraphElementType: 'Zone',
|
|
|
- GraphElementId: "273d633cc5c54a4882794b34843d1a00",
|
|
|
- AttachObjectIds:[],
|
|
|
- Pos: { x: t.x, y: t.y },
|
|
|
- OutLine: t.pointArr,
|
|
|
- Properties: {
|
|
|
- strokeColor: '#3d73c0',
|
|
|
- fillColor: '#eda986'
|
|
|
- },
|
|
|
- Num: 123
|
|
|
- };
|
|
|
- }
|
|
|
- }).filter(item => item);
|
|
|
- console.log(list)
|
|
|
+ const list = this.fParser.spaceList
|
|
|
+ .map(t => {
|
|
|
+ if (t.data.Type == val.key) {
|
|
|
+ return {
|
|
|
+ ID: uuid(),
|
|
|
+ Name: t.name,
|
|
|
+ GraphElementType: "Zone",
|
|
|
+ GraphElementId: "273d633cc5c54a4882794b34843d1a00",
|
|
|
+ AttachObjectIds: [],
|
|
|
+ Pos: { x: t.x, y: t.y },
|
|
|
+ OutLine: t.pointArr,
|
|
|
+ Properties: {
|
|
|
+ strokeColor: "#3d73c0",
|
|
|
+ fillColor: "#eda986"
|
|
|
+ },
|
|
|
+ Num: 123
|
|
|
+ };
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .filter(item => item);
|
|
|
const parserData = new STopologyParser(null);
|
|
|
parserData.parseData({ Nodes: list });
|
|
|
parserData.zoneLegendList.forEach(t => {
|
|
|
this.scene.addItem(t);
|
|
|
- this.scene.Nodes.push(t)
|
|
|
+ this.scene.Nodes.push(t);
|
|
|
});
|
|
|
});
|
|
|
// 设备图例样式对象
|
|
@@ -214,7 +221,7 @@ export default {
|
|
|
});
|
|
|
// 修改图片url
|
|
|
bus.$on("upadataImageUrl", val => {
|
|
|
- this.scene.upadataImageUrl(val)
|
|
|
+ this.scene.upadataImageUrl(val);
|
|
|
});
|
|
|
},
|
|
|
// 读取数据
|