فهرست منبع

'添加元素展示'

zhangyu 4 سال پیش
والد
کامیت
59a8c61daa

+ 52 - 12
package-lock.json

@@ -1064,11 +1064,11 @@
       "integrity": "sha512-PtXbFcLR5Hzyh0fTZax3+u+UT0HISN6duWsOAgrikyayRiGu1bNvVOK3BhfDkYRX51GYjE0f9uAjH5upt9lLYw=="
     },
     "@saga-web/big": {
-      "version": "1.0.41",
-      "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/big/-/big-1.0.41.tgz",
-      "integrity": "sha512-/BJJlKVsW8bRO8gxN57qJ5AwHQXno+AbGE0G9FqLPlmpaW9SPLe8rV3EQ7QavVG1VPGdoSGJ1UIqNp4KVBujpg==",
+      "version": "1.0.43",
+      "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/big/-/big-1.0.43.tgz",
+      "integrity": "sha512-AAi/EBXfdb4nuMYkY6Tl2/bB9uNt/X7Py0BBR1L6Yof8xqpALULKFT4dZoU+3CU7yG6yNAW6+jK3wGzd3ApMwQ==",
       "requires": {
-        "@saga-web/graph": "2.1.82"
+        "@saga-web/graph": "2.1.84"
       },
       "dependencies": {
         "@saga-web/draw": {
@@ -1080,9 +1080,9 @@
           }
         },
         "@saga-web/graph": {
-          "version": "2.1.82",
-          "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/graph/-/graph-2.1.82.tgz",
-          "integrity": "sha512-JyX74MLDZdRK4hbbwV7d5YJaaQJ84FCTqeJFlBOaXS0prXUmlGdB8HikQuQAyK15smosdw0ILYUNTn3wjGkgQw==",
+          "version": "2.1.84",
+          "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/graph/-/graph-2.1.84.tgz",
+          "integrity": "sha512-7RwFNoVQcjrmWmzZhOrSUkvCeBfJsf7i0HElXvouN8ooy9R3KP1xcJnDGZ2MP9i9udmw09JEbjMVHrLhXZrEsQ==",
           "requires": {
             "@saga-web/draw": "2.1.94"
           }
@@ -1121,6 +1121,14 @@
             "@saga-web/graph": "2.1.81"
           }
         },
+        "@saga-web/draw": {
+          "version": "2.1.94",
+          "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/draw/-/draw-2.1.94.tgz",
+          "integrity": "sha512-niu1zEvTv4l3Gnx+Qv7LPjgaPAgKQIIjUGM0H2nyvfJlRZb96LVJSum77cGJunhTl7ak6opg28JWCUUCKW/qRw==",
+          "requires": {
+            "@saga-web/base": "^2.1.19"
+          }
+        },
         "@saga-web/graph": {
           "version": "2.1.81",
           "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/graph/-/graph-2.1.81.tgz",
@@ -1132,9 +1140,9 @@
       }
     },
     "@saga-web/graph": {
-      "version": "2.1.84",
-      "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/graph/-/graph-2.1.84.tgz",
-      "integrity": "sha512-7RwFNoVQcjrmWmzZhOrSUkvCeBfJsf7i0HElXvouN8ooy9R3KP1xcJnDGZ2MP9i9udmw09JEbjMVHrLhXZrEsQ==",
+      "version": "2.1.86",
+      "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/graph/-/graph-2.1.86.tgz",
+      "integrity": "sha512-ZapOQ7BJymzsYcW5qjv5dWjUiDeI3gHOZOIv8UV3/CuQ3s09WMv75jGG/D0dQtiDhICoUYc5IVZlZVBS184a5g==",
       "requires": {
         "@saga-web/draw": "2.1.96"
       }
@@ -2792,6 +2800,16 @@
       "integrity": "sha1-I8DfFPaogHf1+YbA0WfsA8PVU3w=",
       "dev": true
     },
+    "bindings": {
+      "version": "1.5.0",
+      "resolved": "http://192.168.200.80:8081/repository/npm-saga/bindings/-/bindings-1.5.0.tgz",
+      "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
+      "dev": true,
+      "optional": true,
+      "requires": {
+        "file-uri-to-path": "1.0.0"
+      }
+    },
     "bluebird": {
       "version": "3.7.2",
       "resolved": "https://registry.npm.taobao.org/bluebird/download/bluebird-3.7.2.tgz",
@@ -5704,6 +5722,13 @@
         "schema-utils": "^2.5.0"
       }
     },
+    "file-uri-to-path": {
+      "version": "1.0.0",
+      "resolved": "http://192.168.200.80:8081/repository/npm-saga/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
+      "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
+      "dev": true,
+      "optional": true
+    },
     "filesize": {
       "version": "3.6.1",
       "resolved": "https://registry.npm.taobao.org/filesize/download/filesize-3.6.1.tgz",
@@ -8151,6 +8176,13 @@
         "thenify-all": "^1.0.0"
       }
     },
+    "nan": {
+      "version": "2.14.1",
+      "resolved": "http://192.168.200.80:8081/repository/npm-saga/nan/-/nan-2.14.1.tgz",
+      "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==",
+      "dev": true,
+      "optional": true
+    },
     "nanomatch": {
       "version": "1.2.13",
       "resolved": "https://registry.npm.taobao.org/nanomatch/download/nanomatch-1.2.13.tgz",
@@ -12142,7 +12174,11 @@
           "resolved": "http://192.168.200.80:8081/repository/npm-saga/fsevents/-/fsevents-1.2.13.tgz",
           "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==",
           "dev": true,
-          "optional": true
+          "optional": true,
+          "requires": {
+            "bindings": "^1.5.0",
+            "nan": "^2.12.1"
+          }
         },
         "glob-parent": {
           "version": "3.1.0",
@@ -12447,7 +12483,11 @@
           "resolved": "http://192.168.200.80:8081/repository/npm-saga/fsevents/-/fsevents-1.2.13.tgz",
           "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==",
           "dev": true,
-          "optional": true
+          "optional": true,
+          "requires": {
+            "bindings": "^1.5.0",
+            "nan": "^2.12.1"
+          }
         },
         "glob-parent": {
           "version": "3.1.0",

+ 1 - 1
src/components/baseEditer.vue

@@ -120,7 +120,7 @@ export default {
             this.scene.Relations.push(t);
           });
           this.view.fitSceneToView();
-          bus.$emit("initElement", this.scene);
+          bus.$emit("elementDataChange", this.scene);
         }
       });
 

+ 35 - 12
src/components/edit/right_toolbar.vue

@@ -24,11 +24,11 @@
       </a-tab-pane>
       <a-tab-pane key="2" tab="元素" force-render>
         <div class="element">
-          <a-input-search placeholder="搜索" @search="onSearch" />
+          <a-input-search placeholder="搜索" style="margin-bottom: 12px;" v-model="key" @search="onSearch" />
           <ul class="element-list">
-            <li>
-              <a-icon type="play-circle" />
-              <span>电梯系统</span>
+            <li v-for="ele in elementData" :key="ele.id" v-show="ele.name == key">
+              <el-image style="width: 45px; height: 26px; margin-top: 6px;" :src="ele.data.Properties.IconUrl" fit="contain"></el-image>
+              <span class="element-name">{{ele.name}}</span>
             </li>
           </ul>
         </div>
@@ -87,26 +87,39 @@ export default {
     attrSelect
   },
   created() {
-    
+    this.listenElementData();
   },
   data() {
     return {
       msgList,
       attrType: "",
-      elementData: []
+      elementData: [],
+      key: "",
     };
   },
   methods: {
-    getElementData() {
-      bus.$on("initElement", val => {
-        console.log(val);
-        debugger
+    // 获取元素数据
+    listenElementData() {
+      bus.$on("elementDataChange", val => {
+        this.elementData = [];
+        if (val.Nodes.length) {
+          this.elementData = this.elementData.concat(val.Nodes);
+        }
+        if (val.Markers.length) {
+          this.elementData = this.elementData.concat(val.Markers);
+        }
+        if (val.Relations.length) {
+          this.elementData = this.elementData.concat(val.Relations);
+        }
       });
     },
     callback(key) {
       console.log(key);
     },
-    onSearch() {},
+    // 元素检索
+    onSearch(key) {
+
+    },
     // 改变状态
     changeStatus(item) {
       if (item.name == "Width") {
@@ -244,8 +257,10 @@ li {
   }
   .element {
     margin: 0 12px 0 12px;
+    height: 100%;
     .element-list {
-      padding-top: 12px;
+      height: calc(100% - 44px);
+      overflow-y: auto;
       box-sizing: border-box;
       li {
         width: 100%;
@@ -254,6 +269,11 @@ li {
         padding-left: 12px;
         box-sizing: border-box;
         color: #1f2429;
+        .element-name {
+          display: inline-block;
+          vertical-align: top;
+          line-height: 38px;
+        }
         &:hover {
           background: #f5f6f7;
         }
@@ -261,4 +281,7 @@ li {
     }
   }
 }
+/deep/ .ant-tabs .ant-tabs-top-content.ant-tabs-content-animated {
+  height: calc(100% - 60px);
+}
 </style>

+ 7 - 6
src/components/mapClass/EditScence.ts

@@ -126,6 +126,7 @@ export class EditScence extends SGraphScene {
             Pos: { X: 0, Y: 0 },
             /** 由应用自己定义  */
             Properties: {
+                IconUrl: require("../../assets/images/t-line-hover.png"),
                 Line: [{ X: event.x, Y: event.y }]
             }
         }
@@ -167,14 +168,11 @@ export class EditScence extends SGraphScene {
         const LegendData: Relation = {
             ID: uuid(),
             Name: this._legend.Name,
-            GraphElementType: this._legend.Type,
-            Num: 1,
             GraphElementId: this._legend.Id,
-            AttachObjectIds: [],
-            Type: "Line",
             PointList: [{ X: event.x, Y: event.y }],
-            LineType: 0,
+            LineType: "Line",
             Properties: {
+                IconUrl: '/serve/topology-wanda/Picture/query/' + this._legend.Url,
                 LineDash: this._legend.LineDash,
                 LineWidth: this._legend.LineWidth,
                 Color: this._legend.Color,
@@ -199,7 +197,6 @@ export class EditScence extends SGraphScene {
      * 增加多边形item lenged
      */
     addPolygonItem(event: SMouseEvent): void {
-
         const SubType = this._legend.SubType ? this._legend.SubType : ''
         const LegendData: Legend = {
             ID: uuid(),
@@ -213,6 +210,7 @@ export class EditScence extends SGraphScene {
             OutLine: [{ X: event.x, Y: event.y }],
             SubType: SubType,
             Properties: {
+                IconUrl: '/serve/topology-wanda/Picture/query/' + this._legend.Url,
                 StrokeColor: this._legend.Color,
                 FillColor: this._legend.FillColor,
                 LineDash: this._legend.LineDash,
@@ -258,6 +256,7 @@ export class EditScence extends SGraphScene {
             Pos: { X: event.x, Y: event.y },
             /** 由应用自己定义  */
             Properties: {
+                IconUrl: require(`../../assets/images/t-img-hover.png`),
                 Url: '',
             }
         }
@@ -287,6 +286,7 @@ export class EditScence extends SGraphScene {
             Pos: { X: event.x, Y: event.y },
             /** 由应用自己定义  */
             Properties: {
+                IconUrl: require(`../../assets/images/t-text-hover.png`),
                 Text: '请在右侧属性栏输入文字!',
                 Color: '',
                 Font: 0,
@@ -320,6 +320,7 @@ export class EditScence extends SGraphScene {
             Rolate: { X: 0, Y: 0, Z: 0 },
             Size: { Width: 0, Height: 0 },         // 大小
             Properties: {
+                IconUrl: '/serve/topology-wanda/Picture/query/' + this._legend.Url,
                 Url: '/serve/topology-wanda/Picture/query/' + this._legend.Url,
                 Num: 1, // 此num与信息工程化得num无关
                 sWidth: 0,  //icon 的宽

+ 1 - 1
src/components/mapClass/until.ts

@@ -23,5 +23,5 @@
     s[8] = s[13] = s[18] = s[23] = "-";
 
     var uuid = s.join("");
-    return uuid;
+    return `${uuid}-${new Date().getTime()}`;
 }

+ 1 - 0
src/lib/items/TipelineItem.ts

@@ -96,6 +96,7 @@ export class TipelineItem extends SPolylineItem {
       return new SPoint(item.X, item.Y);
     });
     this.data = data;
+    this.name = data.Name;
     this.id = data.ID;
     if (data.GraphElementId) {
       this._graphElementId = data.GraphElementId

+ 1 - 1
src/lib/types/Relation.ts

@@ -47,7 +47,7 @@ export interface Relation {
     /** 方向(0:无向,1:节点1到节点2,2:节点2到节点1) */
     Dir?: SRelationDir;
     /** 线类型(0:直线,1:水平/垂直线,2:曲线) */
-    LineType: SLineType;
+    LineType: string;
     /** 线的顶点坐标 */
     PointList: Point[];
     /** 线的绘图样式 */