Parcourir la source

提取 联动当前分类下的typeid

haojianlong il y a 4 ans
Parent
commit
6c748e141f

Fichier diff supprimé car celui-ci est trop grand
+ 422 - 439
package-lock.json


+ 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",

+ 5 - 0
src/api/editer.js

@@ -69,4 +69,9 @@ 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)
 }

+ 27 - 9
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() {
@@ -122,7 +124,8 @@ export default {
           this.view.fitSceneToView();
         }
       });
-
+      // 获取typeid
+      this.getTypeId()
       this.scene.emitChange = this.emitChange;
     },
     parserData(floor) {
@@ -219,10 +222,12 @@ export default {
       bus.$on("extractItem", () => {
         const map = {};
         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 = [];
@@ -263,11 +268,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
               };
             }
           })
@@ -333,6 +342,15 @@ export default {
         FloorID: this.urlMsg.FloorID // 楼层id
       };
       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 => {

+ 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) {