Переглянути джерело

Merge branch 'develop' of http://39.106.8.246:3003/web/wanda-editer into develop

YaolongHan 4 роки тому
батько
коміт
f1a0c84a4b

+ 42 - 17
package-lock.json

@@ -1059,9 +1059,9 @@
       "dev": true
     },
     "@saga-web/base": {
-      "version": "2.1.20",
-      "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/base/-/base-2.1.20.tgz",
-      "integrity": "sha512-PtXbFcLR5Hzyh0fTZax3+u+UT0HISN6duWsOAgrikyayRiGu1bNvVOK3BhfDkYRX51GYjE0f9uAjH5upt9lLYw=="
+      "version": "2.1.21",
+      "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/base/-/base-2.1.21.tgz",
+      "integrity": "sha512-Oy5eRCxqJoP3RzT8w6auuk1M3u93CXfW7fhzL3BNhl71WnDk0hjpJ2/TXOOdS8kVqYm7zLx5PhmO/EU0CCoZTQ=="
     },
     "@saga-web/big": {
       "version": "1.0.43",
@@ -1090,18 +1090,11 @@
       }
     },
     "@saga-web/draw": {
-      "version": "2.1.96",
-      "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/draw/-/draw-2.1.96.tgz",
-      "integrity": "sha512-jEhfTJRDfObjKoig18Hh9SqKG9aV8Q2RUb+1IL71vwYwwNZx9ySY33iTgPDQ+e9dDWgvtv5v6RhkUlrFJW5O1g==",
+      "version": "2.1.97",
+      "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/draw/-/draw-2.1.97.tgz",
+      "integrity": "sha512-wQw6XI5SrY0bvgBvdPguMPEv/mY3FGUxjm9fctGDHhrX0m9x8h4wljTYaRWXe/VhtMDO4dSXLu2pzvWd+/b69g==",
       "requires": {
-        "@saga-web/base": "^2.1.20"
-      },
-      "dependencies": {
-        "@saga-web/base": {
-          "version": "2.1.20",
-          "resolved": "http://192.168.200.80:8081/repository/npm-saga/@saga-web/base/-/base-2.1.20.tgz",
-          "integrity": "sha512-PtXbFcLR5Hzyh0fTZax3+u+UT0HISN6duWsOAgrikyayRiGu1bNvVOK3BhfDkYRX51GYjE0f9uAjH5upt9lLYw=="
-        }
+        "@saga-web/base": "^2.1.21"
       }
     },
     "@saga-web/feng-map": {
@@ -1144,7 +1137,7 @@
       "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"
+        "@saga-web/draw": "2.1.97"
       }
     },
     "@saga-web/graphy": {
@@ -2800,6 +2793,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",
@@ -5712,6 +5715,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",
@@ -8159,6 +8169,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",
@@ -12150,7 +12167,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",
@@ -12455,7 +12476,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",

+ 4 - 4
package.json

@@ -8,11 +8,11 @@
     "lint": "vue-cli-service lint"
   },
   "dependencies": {
-    "@saga-web/base": "2.1.20",
-    "@saga-web/big": "1.0.43",
-    "@saga-web/draw": "2.1.96",
+    "@saga-web/base": "2.1.21",
+    "@saga-web/big": "1.0.44",
+    "@saga-web/draw": "2.1.97",
     "@saga-web/feng-map": "1.0.11",
-    "@saga-web/graph": "2.1.86",
+    "@saga-web/graph": "2.1.87",
     "@saga-web/topology": "1.0.84",
     "ant-design-vue": "^1.6.0",
     "core-js": "^3.6.4",

+ 6 - 0
src/api/editer.js

@@ -70,6 +70,12 @@ export function queryStatistic(data,params){
 export function queryDraftGroup(data,params){
     return httputils.getJson(`${testApi}/graph/draftGroup`,data, params)
 }
+
+//查询当前分类下的typeid(提取)
+export function queryTypeGraph(params){
+    return httputils.getJson(`${testApi}/graphCategory/getInfoTypeId`, params)
+}
+
 //根据id删除图形信息
 export function deleteGraph(params){
     return httputils.postJson(`${testApi}/graph/delete`, params)

+ 29 - 10
src/components/baseEditer.vue

@@ -12,10 +12,11 @@ import { SFloorParser } from "@saga-web/big";
 import { FloorView } from "./../lib/FloorView";
 import { EditScence } from "./mapClass/EditScence";
 import bus from "@/bus";
-import { saveGroup, readGroup } from "@/api/editer.js";
+import { saveGroup, readGroup, queryTypeGraph } from "@/api/editer.js";
 import { STopologyParser } from "./../lib/parsers/STopologyParser";
 import { uuid } from "@/components/mapClass/until";
 import { SImageItem } from "@saga-web/graph/lib";
+import { SPainter, SColor, SFont, SPoint } from "@saga-web/draw";
 import store from "../store";
 
 let fengmap = null;
@@ -45,7 +46,8 @@ export default {
       view: null,
       floorList: {},
       urlMsg: {},
-      chiceItemList: [] //选中itemlist
+      chiceItemList: [], //选中itemlist
+      hasTypeList: [], // 当前类型下包含的typeid(提取)
     };
   },
   mounted() {
@@ -120,10 +122,11 @@ export default {
             this.scene.Relations.push(t);
           });
           this.view.fitSceneToView();
-          bus.$emit("initElement", this.scene);
+          bus.$emit("elementDataChange", this.scene);
         }
       });
-
+      // 获取typeid
+      this.getTypeId()
       this.scene.emitChange = this.emitChange;
     },
     parserData(floor) {
@@ -219,11 +222,14 @@ export default {
       });
       bus.$on("extractItem", () => {
         const map = {};
+        console.log(this.hasTypeList)
         this.fParser.spaceList.forEach(t => {
-          if (map[t.data.Type]) {
-            map[t.data.Type]++;
-          } else {
-            map[t.data.Type] = 1;
+          if (this.hasTypeList.indexOf(t.data.Type) > -1) {
+            if (map[t.data.Type]) {
+              map[t.data.Type]++;
+            } else {
+              map[t.data.Type] = 1;
+            }
           }
         });
         const data = [];
@@ -264,11 +270,15 @@ export default {
                 AttachObjectIds: [],
                 Pos: { x: t.x, y: t.y },
                 OutLine: t.pointArr[0],
+                SubType: '',
                 Properties: {
                   strokeColor: "#3d73c0",
-                  fillColor: "#eda986"
+                  fillColor: "#eda986",
+                  font: 0,
+                  color: '',
+                  TextPos: { X: 0, Y: 0 }
                 },
-                Num: 123
+                Num: 1
               };
             }
           })
@@ -336,6 +346,15 @@ export default {
 
       };
       return readGroup(data);
+    },
+    // 获取typeid
+    getTypeId() {
+      const data = {
+        categoryId: this.urlMsg.categoryId
+      };
+      queryTypeGraph(data).then(res => {
+        this.hasTypeList = res.Data.map(t => Number(t));
+      })
     }
   },
   watch: {

+ 1 - 1
src/components/edit/left_toolbar.vue

@@ -321,7 +321,7 @@ export default {
       // 打开提取元素列表
       this.isExtract = true;
       this.visible = !this.visible;
-      bus.$emit("extr actItem");
+      bus.$emit("extractItem");
     },
     getBus() {
       bus.$on("exportItem", data => {

+ 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()}`;
 }

+ 10 - 4
src/lib/items/SZoneLegendItem.ts

@@ -103,10 +103,16 @@ export class SZoneLegendItem extends SPolygonItem {
             this.setPointList = [];
             let setPointList: SPoint[];
             if (data.OutLine) {
-                setPointList = data.OutLine.map(i => {
-                    return (new SPoint(i.X, i.Y))
-                })
-                this.setPointList = setPointList;
+                console.log(data.OutLine[0] instanceof SPoint)
+                if (data.OutLine[0] instanceof SPoint) {
+                    // @ts-ignore
+                    this.setPointList = data.OutLine;
+                } else {
+                    setPointList = data.OutLine.map(i => {
+                        return (new SPoint(i.X, i.Y))
+                    })
+                    this.setPointList = setPointList;
+                }
             }
             // 设置线宽
             if (data.Properties.LineWidth) {

+ 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[];
     /** 线的绘图样式 */

+ 3 - 3
src/views/drafts.vue

@@ -11,9 +11,9 @@
           <div class="conent-tit">
             <div class="tit-left" v-if="floorName">{{systemName}}-{{floorName}}</div>
             <div class="tit-right">
-              <a-button @click="deleteBtn">删除</a-button>
-              <a-button @click="publishBtn">发布</a-button>
-              <a-button type="primary" @click="goToEditer">编辑</a-button>
+              <a-button @click="deleteBtn" :disabled="!floorName">删除</a-button>
+              <a-button @click="publishBtn" :disabled="!floorName">发布</a-button>
+              <a-button type="primary" @click="goToEditer" :disabled="!floorName">编辑</a-button>
             </div>
           </div>
           <div class="concent-bottom">