Parcourir la source

图标/底图中 图片路径添加 /glsms

yunxing il y a 4 ans
Parent
commit
e83b964f36
3 fichiers modifiés avec 273 ajouts et 265 suppressions
  1. 130 122
      src/lib/parsers/STopologyParser.js
  2. 142 142
      src/lib/parsers/STopologyParser.ts
  3. 1 1
      src/views/overview/MapView.vue

+ 130 - 122
src/lib/parsers/STopologyParser.js

@@ -1,122 +1,130 @@
-import { SParser } from '@saga-web/big/lib';
-import { SNoneLegendItem } from '../items/SNoneLegendItem';
-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 { SSCPZZoneLegendItem } from '../items/SSCPZZoneLegendItem';
-import { SFHFQZoneLegendItem } from '../items/SFHFQZoneLegendItem';
-/**
- * 拓扑图信息解析器
- *
- */
-export class STopologyParser extends SParser {
-    constructor() {
-        super(...arguments);
-        /** 图例list(非图例类型)   */
-        this.noneLegendList = [];
-        /** 图例list(线类型)   */
-        this.lineLegendList = [];
-        /** 图例list(区域类型)   */
-        this.zoneLegendList = [];
-        /** 图例list(图标类型)   */
-        this.imageLegendList = [];
-        /** 标识list(图类型)   */
-        this.imageMarkerList = [];
-        /** 标识list(线类型)   */
-        this.lineMarkerList = [];
-        /** 标识list(文本类型)   */
-        this.textMarkerList = [];
-        /** 管线关系对象关系list   */
-        this.relationList = [];
-    }
-    /**
-     * 解析数据
-     *
-     * @param   data    系统图数据
-     * */
-    parseData(data) {
-        if (data.Nodes) {
-            data.Nodes.forEach((t) => {
-                this.addLegend(t);
-            });
-        }
-        if (data.Markers) {
-            data.Markers.forEach((t) => {
-                this.addMarker(t);
-            });
-        }
-        if (data.Relations) {
-            data.Relations.forEach((t) => {
-                this.addRelation(t);
-            });
-        }
-    } // Function parseData()
-    /**
-     * 添加图例节点至场景中
-     *
-     * @param   t       图例节点数据
-     * */
-    addLegend(t) {
-        if (t.GraphElementType == 'None') {
-            let item = new SNoneLegendItem(null, t);
-            this.noneLegendList.push(item);
-        }
-        else if (t.GraphElementType == "Zone") {
-            if (t.SubType == "SCPZ") {
-                let item = new SSCPZZoneLegendItem(null, t);
-                item.selectable = true;
-                this.zoneLegendList.push(item);
-            }
-            else if (t.SubType == "FHFQ") {
-                let item = new SFHFQZoneLegendItem(null, t);
-                item.selectable = true;
-                this.zoneLegendList.push(item);
-            }
-            else {
-                let item = new SZoneLegendItem(null, t);
-                item.selectable = true;
-                this.zoneLegendList.push(item);
-            }
-        }
-        else if (t.GraphElementType == 'Image') {
-            let item = new SImageLegendItem(null, t);
-            item.selectable = true;
-            this.imageLegendList.push(item);
-        }
-    } // Function addNode()
-    /**
-     * 添加标识对象至场景中
-     *
-     * @param   t       标识对象数据
-     * */
-    addMarker(t) {
-        if (t.Type == "Image") {
-            let item = new SImageMarkerItem(null, t);
-            this.imageMarkerList.push(item);
-            item.selectable = true;
-        }
-        else if (t.Type == "Line") {
-            let item = new SLineMarkerItem(null, t);
-            item.selectable = true;
-            this.lineMarkerList.push(item);
-        }
-        else if (t.Type == "Text") {
-            let item = new STextMarkerItem(null, t);
-            item.selectable = true;
-            this.textMarkerList.push(item);
-        }
-    } // Function addMarker()
-    /**
-     * 添加管线关系至场景中
-     *
-     * @param   t       管线关系对象数据
-     * */
-    addRelation(t) {
-        let item = new TipelineItem(null, t);
-        item.selectable = true;
-        this.relationList.push(item);
-    } // Function addRelation()
-} // class STopologyParser
+import { SParser } from '@saga-web/big/lib';
+import { SNoneLegendItem } from '../items/SNoneLegendItem';
+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 { SSCPZZoneLegendItem } from '../items/SSCPZZoneLegendItem';
+import { SFHFQZoneLegendItem } from '../items/SFHFQZoneLegendItem';
+/**
+ * 拓扑图信息解析器
+ *
+ */
+export class STopologyParser extends SParser {
+    constructor() {
+        super(...arguments);
+        /** 图例list(非图例类型)   */
+        this.noneLegendList = [];
+        /** 图例list(线类型)   */
+        this.lineLegendList = [];
+        /** 图例list(区域类型)   */
+        this.zoneLegendList = [];
+        /** 图例list(图标类型)   */
+        this.imageLegendList = [];
+        /** 标识list(图类型)   */
+        this.imageMarkerList = [];
+        /** 标识list(线类型)   */
+        this.lineMarkerList = [];
+        /** 标识list(文本类型)   */
+        this.textMarkerList = [];
+        /** 管线关系对象关系list   */
+        this.relationList = [];
+    }
+    /**
+     * 解析数据
+     *
+     * @param   data    系统图数据
+     * */
+    parseData(data) {
+        if (data.Nodes) {
+            data.Nodes.forEach((t) => {
+                this.addLegend(t);
+            });
+        }
+        if (data.Markers) {
+            data.Markers.forEach((t) => {
+                this.addMarker(t);
+            });
+        }
+        if (data.Relations) {
+            data.Relations.forEach((t) => {
+                this.addRelation(t);
+            });
+        }
+    } // Function parseData()
+    /**
+     * 添加图例节点至场景中
+     *
+     * @param   t       图例节点数据
+     * */
+    addLegend(t) {
+        if (t.GraphElementType == 'None') {
+            let item = new SNoneLegendItem(null, t);
+            this.noneLegendList.push(item);
+        }
+        else if (t.GraphElementType == "Zone") {
+            if (t.SubType == "SCPZ") {
+                let item = new SSCPZZoneLegendItem(null, t);
+                item.selectable = true;
+                this.zoneLegendList.push(item);
+            }
+            else if (t.SubType == "FHFQ") {
+                let item = new SFHFQZoneLegendItem(null, t);
+                item.selectable = true;
+                this.zoneLegendList.push(item);
+            }
+            else {
+                let item = new SZoneLegendItem(null, t);
+                item.selectable = true;
+                this.zoneLegendList.push(item);
+            }
+        }
+        else if (t.GraphElementType == 'Image') {
+            if(t.Properties){
+                t.Properties.Url ? t.Properties.Url ='/glsms' + t.Properties.Url :t.Properties;
+                t.Properties.IconUrl ? t.Properties.IconUrl ='/glsms' + t.Properties.IconUrl :t.Properties
+            }
+            let item = new SImageLegendItem(null, t);
+            item.selectable = true;
+            this.imageLegendList.push(item);
+        }
+    } // Function addNode()
+    /**
+     * 添加标识对象至场景中
+     *
+     * @param   t       标识对象数据
+     * */
+    addMarker(t) {
+        if (t.Type == "Image") {
+            if(t.Properties){
+                t.Properties.Url ? t.Properties.Url ='/glsms' + t.Properties.Url :t.Properties;
+                t.Properties.IconUrl ? t.Properties.IconUrl ='/glsms' + t.Properties.IconUrl :t.Properties
+            }
+            let item = new SImageMarkerItem(null, t);
+            this.imageMarkerList.push(item);
+            item.selectable = true;
+        }
+        else if (t.Type == "Line") {
+            let item = new SLineMarkerItem(null, t);
+            item.selectable = true;
+            this.lineMarkerList.push(item);
+        }
+        else if (t.Type == "Text") {
+            let item = new STextMarkerItem(null, t);
+            item.selectable = true;
+            this.textMarkerList.push(item);
+        }
+    } // Function addMarker()
+    /**
+     * 添加管线关系至场景中
+     *
+     * @param   t       管线关系对象数据
+     * */
+    addRelation(t) {
+        let item = new TipelineItem(null, t);
+        item.selectable = true;
+        this.relationList.push(item);
+    } // Function addRelation()
+} // class STopologyParser

+ 142 - 142
src/lib/parsers/STopologyParser.ts

@@ -1,142 +1,142 @@
-// @ts-nocheck
-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 { SSCPZZoneLegendItem } from '../items/SSCPZZoneLegendItem';
-import { SFHFQZoneLegendItem } from '../items/SFHFQZoneLegendItem';
-import { SCustomLegendItem } from "../items/SCustomLegendItem";
-/**
- * 拓扑图信息解析器
- *
- */
-export class STopologyParser extends SParser {
-    /** 图例list(非图例类型)   */
-    noneLegendList: SNoneLegendItem[] = [];
-    /** 图例list(线类型)   */
-    lineLegendList: SLineLegendItem[] = [];
-    /** 图例list(区域类型)   */
-    zoneLegendList: SZoneLegendItem[] = [];
-    /** 图例list(图标类型)   */
-    imageLegendList: SImageLegendItem[] = [];
-
-    /** 标识list(图类型)   */
-    imageMarkerList: SImageMarkerItem[] = [];
-    /** 标识list(线类型)   */
-    lineMarkerList: SLineMarkerItem[] = [];
-    /** 标识list(文本类型)   */
-    textMarkerList: STextMarkerItem[] = [];
-
-    /** 管线关系对象关系list   */
-    relationList: SRelation[] = [];
-
-    /**
-     * 解析数据
-     *
-     * @param   data    系统图数据
-     * */
-    parseData(data: ElementData): void {
-        if (data.Nodes) {
-            data.Nodes.forEach((t: Legend): void => {
-                this.addLegend(t);
-            });
-        }
-        if (data.Markers) {
-            data.Markers.forEach((t: Marker): void => {
-                this.addMarker(t);
-            });
-        }
-        if (data.Relations) {
-            data.Relations.forEach((t: Relation): void => {
-                this.addRelation(t);
-            });
-        }
-    } // Function parseData()
-
-    /**
-     * 添加图例节点至场景中
-     *
-     * @param   t       图例节点数据
-     * */
-    private addLegend(t: Legend): void {
-        if (t.GraphElementType == 'None') {
-            let item = new SNoneLegendItem(null, t);
-            this.noneLegendList.push(item);
-        } else if (t.GraphElementType == "Zone") {
-            if (t.SubType == "SCPZ") {
-                let item = new SSCPZZoneLegendItem(null, t);
-                item.selectable = true;
-                this.zoneLegendList.push(item);
-            } else if (t.SubType == "FHFQ") {
-                let item = new SFHFQZoneLegendItem(null, t);
-                item.selectable = true;
-                this.zoneLegendList.push(item);
-            }  else if (t.SubType == "CUSTOM") {
-                let item = new SCustomLegendItem(null, t);
-                item.selectable = true;
-                this.zoneLegendList.push(item);
-            } else {
-                let item = new SZoneLegendItem(null, t);
-                item.selectable = true;
-                this.zoneLegendList.push(item);
-            }
-        } else if (t.GraphElementType == 'x') {
-            if(t.Properties){
-                t.Properties.Url ? t.Properties.Url ='glsms' + t.Properties.Url :t.Properties;
-                t.Properties.IconUrl ? t.Properties.IconUrl ='glsms' + t.Properties.IconUrl :t.Properties
-            }
-            let item = new SImageLegendItem(null, t);
-            item.selectable = true;
-            this.imageLegendList.push(item);
-        }
-    } // Function addNode()
-
-    /**
-     * 添加标识对象至场景中
-     *
-     * @param   t       标识对象数据
-     * */
-    private addMarker(t: Marker): void {
-        if (t.Type == "Image") {
-            if(t.Properties){
-                t.Properties.Url ? t.Properties.Url ='glsms' + t.Properties.Url :t.Properties;
-                t.Properties.IconUrl ? t.Properties.IconUrl ='glsms' + t.Properties.IconUrl :t.Properties
-            }
-            let item = new SImageMarkerItem(null, t);
-            this.imageMarkerList.push(item);
-            item.selectable = true;
-        } else if (t.Type == "Line") {
-            let item = new SLineMarkerItem(null, t);
-            item.selectable = true;
-            this.lineMarkerList.push(item);
-        } else if (t.Type == "Text") {
-            let item = new STextMarkerItem(null, t);
-            item.selectable = true;
-            this.textMarkerList.push(item);
-        }
-    } // Function addMarker()
-
-    /**
-     * 添加管线关系至场景中
-     *
-     * @param   t       管线关系对象数据
-     * */
-    private addRelation(t: Relation): void {
-        let item = new TipelineItem(null, t);
-        item.selectable = true;
-        this.relationList.push(item);
-    } // Function addRelation()
-} // class STopologyParser
+// @ts-nocheck
+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 { SSCPZZoneLegendItem } from '../items/SSCPZZoneLegendItem';
+import { SFHFQZoneLegendItem } from '../items/SFHFQZoneLegendItem';
+import { SCustomLegendItem } from "../items/SCustomLegendItem";
+/**
+ * 拓扑图信息解析器
+ *
+ */
+export class STopologyParser extends SParser {
+    /** 图例list(非图例类型)   */
+    noneLegendList: SNoneLegendItem[] = [];
+    /** 图例list(线类型)   */
+    lineLegendList: SLineLegendItem[] = [];
+    /** 图例list(区域类型)   */
+    zoneLegendList: SZoneLegendItem[] = [];
+    /** 图例list(图标类型)   */
+    imageLegendList: SImageLegendItem[] = [];
+
+    /** 标识list(图类型)   */
+    imageMarkerList: SImageMarkerItem[] = [];
+    /** 标识list(线类型)   */
+    lineMarkerList: SLineMarkerItem[] = [];
+    /** 标识list(文本类型)   */
+    textMarkerList: STextMarkerItem[] = [];
+
+    /** 管线关系对象关系list   */
+    relationList: SRelation[] = [];
+
+    /**
+     * 解析数据
+     *
+     * @param   data    系统图数据
+     * */
+    parseData(data: ElementData): void {
+        if (data.Nodes) {
+            data.Nodes.forEach((t: Legend): void => {
+                this.addLegend(t);
+            });
+        }
+        if (data.Markers) {
+            data.Markers.forEach((t: Marker): void => {
+                this.addMarker(t);
+            });
+        }
+        if (data.Relations) {
+            data.Relations.forEach((t: Relation): void => {
+                this.addRelation(t);
+            });
+        }
+    } // Function parseData()
+
+    /**
+     * 添加图例节点至场景中
+     *
+     * @param   t       图例节点数据
+     * */
+    private addLegend(t: Legend): void {
+        if (t.GraphElementType == 'None') {
+            let item = new SNoneLegendItem(null, t);
+            this.noneLegendList.push(item);
+        } else if (t.GraphElementType == "Zone") {
+            if (t.SubType == "SCPZ") {
+                let item = new SSCPZZoneLegendItem(null, t);
+                item.selectable = true;
+                this.zoneLegendList.push(item);
+            } else if (t.SubType == "FHFQ") {
+                let item = new SFHFQZoneLegendItem(null, t);
+                item.selectable = true;
+                this.zoneLegendList.push(item);
+            }  else if (t.SubType == "CUSTOM") {
+                let item = new SCustomLegendItem(null, t);
+                item.selectable = true;
+                this.zoneLegendList.push(item);
+            } else {
+                let item = new SZoneLegendItem(null, t);
+                item.selectable = true;
+                this.zoneLegendList.push(item);
+            }
+        } else if (t.GraphElementType == 'x') {
+            if(t.Properties){
+                t.Properties.Url ? t.Properties.Url ='/glsms' + t.Properties.Url :t.Properties;
+                t.Properties.IconUrl ? t.Properties.IconUrl ='/glsms' + t.Properties.IconUrl :t.Properties
+            }
+            let item = new SImageLegendItem(null, t);
+            item.selectable = true;
+            this.imageLegendList.push(item);
+        }
+    } // Function addNode()
+
+    /**
+     * 添加标识对象至场景中
+     *
+     * @param   t       标识对象数据
+     * */
+    private addMarker(t: Marker): void {
+        if (t.Type == "Image") {
+            if(t.Properties){
+                t.Properties.Url ? t.Properties.Url ='glsms' + t.Properties.Url :t.Properties;
+                t.Properties.IconUrl ? t.Properties.IconUrl ='glsms' + t.Properties.IconUrl :t.Properties
+            }
+            let item = new SImageMarkerItem(null, t);
+            this.imageMarkerList.push(item);
+            item.selectable = true;
+        } else if (t.Type == "Line") {
+            let item = new SLineMarkerItem(null, t);
+            item.selectable = true;
+            this.lineMarkerList.push(item);
+        } else if (t.Type == "Text") {
+            let item = new STextMarkerItem(null, t);
+            item.selectable = true;
+            this.textMarkerList.push(item);
+        }
+    } // Function addMarker()
+
+    /**
+     * 添加管线关系至场景中
+     *
+     * @param   t       管线关系对象数据
+     * */
+    private addRelation(t: Relation): void {
+        let item = new TipelineItem(null, t);
+        item.selectable = true;
+        this.relationList.push(item);
+    } // Function addRelation()
+} // class STopologyParser

+ 1 - 1
src/views/overview/MapView.vue

@@ -12,7 +12,7 @@
       <div class="legendBox" v-show="show" @touchmove="show=false">
         <ul class="legend-list">
           <li class="legend-item" v-for="(item, index) in legendList" :key="`legend${index}`">
-            <img :src="`/glsms/topology-wanda/Picture/query/${item.Url}`" alt>
+            <img :src="`/glsms/serve/topology-wanda/Picture/query/${item.Url}`" alt>
             {{`${item.Name}×${item.Num}`}}
           </li>
         </ul>