|
@@ -1,43 +1,43 @@
|
|
|
-import { ElementData } from "../types/ElementData";
|
|
|
-import { Legend } from "../types/Legend";
|
|
|
-import { Marker } from "../types/Marker";
|
|
|
-import { Relation } from "../types/Relation";
|
|
|
-import { SGraphElementType } from "../enums/SGraphElementType";
|
|
|
-import { SMarkerType } from "../enums/SMarkerType";
|
|
|
-import { SParser, SRelation } from '@saga-web/big/lib';
|
|
|
-import { SNoneLegendItem } from '../items/SNoneLegendItem';
|
|
|
-import { SLineLegendItem } from '../items/SLineLegendItem';
|
|
|
-import { SZoneLegendItem } from '../items/SZoneLegendItem';
|
|
|
-import { SImageLegendItem } from '../items/SImageLegendItem';
|
|
|
-import { SImageMarkerItem } from '../items/SImageMarkerItem';
|
|
|
-import { SLineMarkerItem } from '../items/SLineMarkerItem';
|
|
|
-import { STextMarkerItem } from '../items/STextMarkerItem';
|
|
|
-import { TipelineItem } from '../items/TipelineItem';
|
|
|
-import { ItemOrder } from "@saga-web/big";
|
|
|
-import { SItemStatus } from "@saga-web/big";
|
|
|
+import { ElementData } from '../types/ElementData'
|
|
|
+import { Legend } from '../types/Legend'
|
|
|
+import { Marker } from '../types/Marker'
|
|
|
+import { Relation } from '../types/Relation'
|
|
|
+import { SGraphElementType } from '../enums/SGraphElementType'
|
|
|
+import { SMarkerType } from '../enums/SMarkerType'
|
|
|
+import { SParser, SRelation } from '@saga-web/big/lib'
|
|
|
+import { SNoneLegendItem } from '../items/SNoneLegendItem'
|
|
|
+import { SLineLegendItem } from '../items/SLineLegendItem'
|
|
|
+import { SZoneLegendItem } from '../items/SZoneLegendItem'
|
|
|
+import { SImageLegendItem } from '../items/SImageLegendItem'
|
|
|
+import { SImageMarkerItem } from '../items/SImageMarkerItem'
|
|
|
+import { SLineMarkerItem } from '../items/SLineMarkerItem'
|
|
|
+import { STextMarkerItem } from '../items/STextMarkerItem'
|
|
|
+import { TipelineItem } from '../items/TipelineItem'
|
|
|
+import { ItemOrder } from '@saga-web/big'
|
|
|
+import { SItemStatus } from '@saga-web/big'
|
|
|
/**
|
|
|
* 拓扑图信息解析器
|
|
|
*
|
|
|
*/
|
|
|
export class STopologyParser extends SParser {
|
|
|
/** 图例list(非图例类型) */
|
|
|
- noneLegendList: SNoneLegendItem[] = [];
|
|
|
+ noneLegendList: SNoneLegendItem[] = []
|
|
|
/** 图例list(线类型) */
|
|
|
- lineLegendList: SLineLegendItem[] = [];
|
|
|
+ lineLegendList: SLineLegendItem[] = []
|
|
|
/** 图例list(区域类型) */
|
|
|
- zoneLegendList: SZoneLegendItem[] = [];
|
|
|
+ zoneLegendList: SZoneLegendItem[] = []
|
|
|
/** 图例list(图标类型) */
|
|
|
- imageLegendList: SImageLegendItem[] = [];
|
|
|
+ imageLegendList: SImageLegendItem[] = []
|
|
|
|
|
|
/** 标识list(图类型) */
|
|
|
- imageMarkerList: SImageMarkerItem[] = [];
|
|
|
+ imageMarkerList: SImageMarkerItem[] = []
|
|
|
/** 标识list(线类型) */
|
|
|
- lineMarkerList: SLineMarkerItem[] = [];
|
|
|
+ lineMarkerList: SLineMarkerItem[] = []
|
|
|
/** 标识list(文本类型) */
|
|
|
- textMarkerList: STextMarkerItem[] = [];
|
|
|
+ textMarkerList: STextMarkerItem[] = []
|
|
|
|
|
|
/** 管线关系对象关系list */
|
|
|
- relationList: SRelation[] = [];
|
|
|
+ relationList: SRelation[] = []
|
|
|
|
|
|
/**
|
|
|
* 解析数据
|
|
@@ -47,18 +47,18 @@ export class STopologyParser extends SParser {
|
|
|
parseData(data: ElementData): void {
|
|
|
if (data.Nodes) {
|
|
|
data.Nodes.forEach((t: Legend): void => {
|
|
|
- this.addLegend(t);
|
|
|
- });
|
|
|
+ this.addLegend(t)
|
|
|
+ })
|
|
|
}
|
|
|
if (data.Markers) {
|
|
|
data.Markers.forEach((t: Marker): void => {
|
|
|
- this.addMarker(t);
|
|
|
- });
|
|
|
+ this.addMarker(t)
|
|
|
+ })
|
|
|
}
|
|
|
if (data.Relations) {
|
|
|
data.Relations.forEach((t: Relation): void => {
|
|
|
- this.addRelation(t);
|
|
|
- });
|
|
|
+ this.addRelation(t)
|
|
|
+ })
|
|
|
}
|
|
|
} // Function parseData()
|
|
|
|
|
@@ -69,24 +69,23 @@ export class STopologyParser extends SParser {
|
|
|
* */
|
|
|
private addLegend(t: Legend): void {
|
|
|
if (t.GraphElementType == 'None') {
|
|
|
- let item = new SNoneLegendItem(null, t);
|
|
|
- this.noneLegendList.push(item);
|
|
|
+ let item = new SNoneLegendItem(null, t)
|
|
|
+ this.noneLegendList.push(item)
|
|
|
} else if (t.GraphElementType == 'Line') {
|
|
|
- let item = new TipelineItem(null, t);
|
|
|
- item.selectable = true;
|
|
|
- item.status = 0;
|
|
|
- item.zOrder == ItemOrder.polylineOrder;
|
|
|
- alert(123)
|
|
|
- this.relationList.push(item);
|
|
|
- } else if (t.GraphElementType == "Zone") {
|
|
|
- let item = new SZoneLegendItem(null, t);
|
|
|
- item.selectable = true;
|
|
|
- item.zOrder == ItemOrder.polygonOrder;
|
|
|
- this.zoneLegendList.push(item);
|
|
|
+ let item = new TipelineItem(null, t)
|
|
|
+ item.selectable = true
|
|
|
+ item.status = 0
|
|
|
+ item.zOrder == ItemOrder.polylineOrder
|
|
|
+ this.relationList.push(item)
|
|
|
+ } else if (t.GraphElementType == 'Zone') {
|
|
|
+ let item = new SZoneLegendItem(null, t)
|
|
|
+ item.selectable = true
|
|
|
+ item.zOrder == ItemOrder.polygonOrder
|
|
|
+ this.zoneLegendList.push(item)
|
|
|
} else if (t.GraphElementType == 'Image') {
|
|
|
- let item = new SImageLegendItem(null, t);
|
|
|
- item.selectable = true;
|
|
|
- this.imageLegendList.push(item);
|
|
|
+ let item = new SImageLegendItem(null, t)
|
|
|
+ item.selectable = true
|
|
|
+ this.imageLegendList.push(item)
|
|
|
}
|
|
|
} // Function addNode()
|
|
|
|
|
@@ -96,21 +95,21 @@ export class STopologyParser extends SParser {
|
|
|
* @param t 标识对象数据
|
|
|
* */
|
|
|
private addMarker(t: Marker): void {
|
|
|
- if (t.Type == "Image") {
|
|
|
- let item = new SImageMarkerItem(null, t);
|
|
|
- this.imageMarkerList.push(item);
|
|
|
- item.selectable = true;
|
|
|
- item.zOrder = ItemOrder.imageOrder;
|
|
|
- } else if (t.Type == "Line") {
|
|
|
- let item = new SLineMarkerItem(null, t);
|
|
|
- item.selectable = true;
|
|
|
- item.zOrder = ItemOrder.lineOrder;
|
|
|
- this.lineMarkerList.push(item);
|
|
|
- } else if (t.Type == "Text") {
|
|
|
- let item = new STextMarkerItem(null, t);
|
|
|
- item.selectable = true;
|
|
|
- item.zOrder = ItemOrder.lineOrder;
|
|
|
- this.textMarkerList.push(item);
|
|
|
+ if (t.Type == 'Image') {
|
|
|
+ let item = new SImageMarkerItem(null, t)
|
|
|
+ this.imageMarkerList.push(item)
|
|
|
+ item.selectable = true
|
|
|
+ item.zOrder = ItemOrder.imageOrder
|
|
|
+ } else if (t.Type == 'Line') {
|
|
|
+ let item = new SLineMarkerItem(null, t)
|
|
|
+ item.selectable = true
|
|
|
+ item.zOrder = ItemOrder.lineOrder
|
|
|
+ this.lineMarkerList.push(item)
|
|
|
+ } else if (t.Type == 'Text') {
|
|
|
+ let item = new STextMarkerItem(null, t)
|
|
|
+ item.selectable = true
|
|
|
+ item.zOrder = ItemOrder.lineOrder
|
|
|
+ this.textMarkerList.push(item)
|
|
|
}
|
|
|
} // Function addMarker()
|
|
|
|
|
@@ -120,7 +119,7 @@ export class STopologyParser extends SParser {
|
|
|
* @param t 管线关系对象数据
|
|
|
* */
|
|
|
private addRelation(t: Relation): void {
|
|
|
- let item = new TipelineItem(null, t);
|
|
|
- this.relationList.push(item);
|
|
|
+ let item = new TipelineItem(null, t)
|
|
|
+ this.relationList.push(item)
|
|
|
} // Function addRelation()
|
|
|
} // class STopologyParser
|