Browse Source

保存增加参数最大最小值;读地图增加解析最大最小值

haojianlong 4 years ago
parent
commit
35601ca636
3 changed files with 48 additions and 6 deletions
  1. 4 0
      src/api/editer.js
  2. 25 4
      src/components/baseEditer.vue
  3. 19 2
      src/views/drafts.vue

+ 4 - 0
src/api/editer.js

@@ -112,4 +112,8 @@ export function deleteByCategory(params){
 // 推荐
 export function graphElementOrderInfoLocal(params){
     return httputils.getJson(`${testApi}/graphElement/orderInfoLocal`, params)
+}
+// 查询图
+export function graphQuery(params){
+    return httputils.postJson(`${testApi}/graph/query`, params)
 }

+ 25 - 4
src/components/baseEditer.vue

@@ -18,7 +18,8 @@ import {
   saveGroup,
   readGroup,
   queryTypeGraph,
-  publishGraph
+  publishGraph,
+  graphQuery
 } from "@/api/editer.js";
 import { STopologyParser } from "./../lib/parsers/STopologyParser";
 import { uuid } from "@/components/mapClass/until";
@@ -154,7 +155,16 @@ export default {
         )
           .then(response => {
             console.log("获取rf成功", response);
-            this.parserData(floorid);
+            this.getGraphDetail().then(res => {
+              if (res.Content.length == 1) {
+                const data = res.Content[0];
+                if (data.MaxY && data.MinX) {
+                  window.FENGMAP.maxY = data.MaxY;
+                  window.FENGMAP.minX = data.MinX;
+                }
+              }
+              this.parserData(floorid);
+            });
             // this.readGraph();
             // loadings.close();
           })
@@ -716,6 +726,13 @@ export default {
         this.scene.changeLengendItem(item)
       })
     },
+    // 获取图最大最小值
+    getGraphDetail(){
+      const data = {
+        Filters:`categoryId='${this.urlMsg.categoryId}';projectId='${this.urlMsg.projectId}';BuildingID='${this.urlMsg.BuildingID}';FloorID='${this.urlMsg.FloorID}'`
+      };
+      return graphQuery(data);
+    },
     // 读取数据
     readGroup() {
       const data = {
@@ -796,7 +813,9 @@ export default {
         ProjectID: this.urlMsg.projectId, // 项目ID
         BuildingID: this.urlMsg.BuildingID, // 建筑ID
         FloorID: this.urlMsg.FloorID, // 楼层id
-        Seq // 楼层id
+        Seq, // 楼层id
+        MinX: window.FENGMAP.minX,
+        MaxY: window.FENGMAP.maxY
       };
       return new Promise(resolve => {
         saveGroup(data)
@@ -838,7 +857,9 @@ export default {
           ProjectID: this.urlMsg.projectId, // 项目ID
           BuildingID: this.urlMsg.BuildingID, // 建筑ID
           FloorID: this.urlMsg.FloorID, // 楼层id
-          Seq // 楼层id
+          Seq, // 楼层id
+          MinX: window.FENGMAP.minX,
+          MaxY: window.FENGMAP.maxY
         };
         saveGroup(data)
           .then(res => {

+ 19 - 2
src/views/drafts.vue

@@ -104,7 +104,8 @@ import {
   queryStatistic,
   deleteGraph,
   publishGraph,
-  deleteByCategory
+  deleteByCategory,
+  graphQuery
 } from "@/api/editer.js";
 import { STopologyParser } from "./../lib/parsers/STopologyParser";
 import { uuid } from "@/components/mapClass/until";
@@ -568,6 +569,13 @@ export default {
         }
       });
     },
+    // 获取图最大最小值
+    getGraphDetail(){
+      const data = {
+        Filters:`categoryId='${this.categoryId}';projectId='${this.projectId}';BuildingID='${this.BuildingID}';FloorID='${this.floorId}'`
+      };
+      return graphQuery(data);
+    },
     // 读取数据
     readGroup(floorid) {
       const data = {
@@ -628,7 +636,16 @@ export default {
       }
       setTimeout(() => {
         this.view.scene = this.scene;
-        this.parserData(floorid);
+        this.getGraphDetail().then(res => {
+          if (res.Content.length == 1) {
+            const data = res.Content[0];
+            if (data.MaxY && data.MinX) {
+              fengmap.maxY = data.MaxY;
+              fengmap.minX = data.MinX;
+            }
+          }
+          this.parserData(floorid);
+        });
         this.readGroup(floorid).then(data => {
           if (data.Result == "success") {
             this.graphId = data.Data[0].ID;