Procházet zdrojové kódy

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

haojianlong před 4 roky
rodič
revize
ea006de49d

+ 9 - 1
src/components/baseEditer.vue

@@ -102,6 +102,12 @@ export default {
       document.getElementById(`canvas`).focus();
       this.clearGraphy();
       this.scene = new EditScence();
+
+      if(this.urlMsg.fmapID.includes('null')){
+          this.loadings.close();
+          this.view.scene = this.scene;
+          this.readGraph();
+      }
       window.FENGMAP = new SFengParser(
         "fengMap",
         this.mapServerURL + "/fmap/" + this.urlMsg.fmapID,
@@ -122,7 +128,9 @@ export default {
             this.parserData(floorid);
             // this.readGraph();
             // loadings.close();
-          });
+          }).catch(()=>{
+              this.loadings.close();
+          })
         // this.view.fitSceneToView();
       });
       // 获取typeid

+ 4 - 4
src/components/edit/attr_select.vue

@@ -682,12 +682,12 @@ export default {
               this.attrCards = this.attrCards.concat(res.data.data);
             }
           } else {
-            this.$message.error("工程信息化中的位置信息获取失败");
+            // this.$message.error("工程信息化中的位置信息获取失败");
           }
         }
       ).catch(()=>{
         this.spinning = false;
-        this.$message.error("工程信息化中的位置信息获取失败");
+        // this.$message.error("工程信息化中的位置信息获取失败");
       });
       // }else if(newval.itemType == 'Image'){
       this.spinning = true;
@@ -704,11 +704,11 @@ export default {
             this.attrCards = this.attrCards.concat(res.data.data);
           }
         } else {
-          this.$message.error("工程信息化中的设备信息获取失败");
+          // this.$message.error("工程信息化中的设备信息获取失败");
         }
       }).catch(()=>{
         this.spinning = false;
-        this.$message.error("工程信息化中的设备信息获取失败");
+        // this.$message.error("工程信息化中的设备信息获取失败");
       });
       // }
       console.log(this.attrCards);

+ 54 - 26
src/components/mapClass/EditScence.ts

@@ -1,6 +1,6 @@
 import { SMouseEvent, SUndoStack } from "@saga-web/base";
 import { SGraphScene, SGraphLayoutType, SAnchorItem } from '@saga-web/graph/lib';
-import { SFloorParser, SLineItem, SPolylineItem, SItemStatus, ItemOrder, STooltipItem, ItemColor,Transparency, SPolygonItem } from "@saga-web/big";
+import { SFloorParser, SLineItem, SPolylineItem, SItemStatus, ItemOrder, STooltipItem, ItemColor, Transparency, SPolygonItem } from "@saga-web/big";
 import { SGraphItem, SLineStyle, SGraphPropertyCommand, SImageItem, STextItem, SGraphPointListInsert, SGraphPointListDelete, SGraphPointListUpdate, SGraphAddCommand } from "@saga-web/graph/lib";
 import { SGraphAddListCommand } from "./SGraphAddListCommand"
 import { SGraphDeleteCommand } from "./SGraphDeleteCommand"
@@ -275,9 +275,9 @@ export class EditScence extends SGraphScene {
                 font: 14,
                 color: "#1F2429",
                 TextPos: { X: 0, Y: 0 },
-                InfoTypeId:this._legend.InfoTypeId.length? this._legend.InfoTypeId :[],
-                InfoSystemId:this._legend.InfoSystemId ? this._legend.InfoSystemId :'',
-                InfoLocal:this._legend.InfoLocal.length ?this._legend.InfoLocal :[]
+                InfoTypeId: this._legend.InfoTypeId.length ? this._legend.InfoTypeId : [],
+                InfoSystemId: this._legend.InfoSystemId ? this._legend.InfoSystemId : '',
+                InfoLocal: this._legend.InfoLocal.length ? this._legend.InfoLocal : []
             },
         }
         let Polylines = null;
@@ -330,9 +330,9 @@ export class EditScence extends SGraphScene {
                     color: "#1F2429",
                     FID: item.data.SourceId,
                     TextPos: { X: item.data.Location.Points[0].X, Y: -item.data.Location.Points[0].Y },
-                    InfoTypeId:this._legend.InfoTypeId.length? this._legend.InfoTypeId :[],
-                    InfoSystemId:this._legend.InfoSystemId ? this._legend.InfoSystemId :'',
-                    InfoLocal:this._legend.InfoLocal.length ?this._legend.InfoLocal :[]
+                    InfoTypeId: this._legend.InfoTypeId.length ? this._legend.InfoTypeId : [],
+                    InfoSystemId: this._legend.InfoSystemId ? this._legend.InfoSystemId : '',
+                    InfoLocal: this._legend.InfoLocal.length ? this._legend.InfoLocal : []
                 },
             }
             let Polylines = null;
@@ -448,9 +448,9 @@ export class EditScence extends SGraphScene {
                 color: "#1F2429",  //字体颜色
                 FrameColor: this._legend.FrameColor,
                 GraphCategoryId: this._legend.GraphCategoryId,
-                InfoSystemId:this._legend.InfoSystemId ? this._legend.InfoSystemId :'' ,
-                InfoTypeId:this._legend.InfoTypeId.length? this._legend.InfoTypeId :[],// 铺位可视化Typeid(用于编辑工程信息化时默认问题)
-                InfoLocal:this._legend.InfoLocal.length ?this._legend.InfoLocal :[]
+                InfoSystemId: this._legend.InfoSystemId ? this._legend.InfoSystemId : '',
+                InfoTypeId: this._legend.InfoTypeId.length ? this._legend.InfoTypeId : [],// 铺位可视化Typeid(用于编辑工程信息化时默认问题)
+                InfoLocal: this._legend.InfoLocal.length ? this._legend.InfoLocal : []
             },
         }
         const item = new SImageLegendItem(null, LegendData);
@@ -592,9 +592,9 @@ export class EditScence extends SGraphScene {
             let p = this.focusItem.mapFromScene(x, y)
             // newx - oldx = newleft - oldleft
             // 要求的值(新的x坐标) - 旧的x坐标 = 新的左边界(用户输入的值) - 旧的左边界
-            this.focusItem.x = (p.x - this.focusItem.boundingRect().left)*this.focusItem.inverseScale + this.focusItem.x;
-            this.focusItem.y = (p.y - this.focusItem.boundingRect().top)*this.focusItem.inverseScale + this.focusItem.y;
-            if(this.focusItem instanceof SPolylineItem || this.focusItem instanceof SPolygonItem || this.focusItem instanceof SLineItem){
+            this.focusItem.x = (p.x - this.focusItem.boundingRect().left) * this.focusItem.inverseScale + this.focusItem.x;
+            this.focusItem.y = (p.y - this.focusItem.boundingRect().top) * this.focusItem.inverseScale + this.focusItem.y;
+            if (this.focusItem instanceof SPolylineItem || this.focusItem instanceof SPolygonItem || this.focusItem instanceof SLineItem) {
                 this.focusItem.moveToOrigin(this.focusItem.x, this.focusItem.y)
             }
         }
@@ -722,9 +722,9 @@ export class EditScence extends SGraphScene {
                 item instanceof SFHFQZoneLegendItem
             ) {
                 let arr = item.data.AttachObjectIds;
-                if (arr && arr.length && arr[arr.length-1].name) {
-                    item.text = arr[arr.length-1].name;
-                    item.name = arr[arr.length-1].name;
+                if (arr && arr.length && arr[arr.length - 1].name) {
+                    item.text = arr[arr.length - 1].name;
+                    item.name = arr[arr.length - 1].name;
                 }
                 // 绑定工程信息化数据后设置状态
                 if (item.data.AttachObjectIds && item.data.AttachObjectIds.length) {
@@ -908,7 +908,17 @@ export class EditScence extends SGraphScene {
         let arrList = []
         if (this.cmd == 'baseLine') {
             arrList = this.Markers;
-            this.Markers.push(item);
+            // 对数组遍历防止相同得id注入
+            let canPush = true;  //是否可注入
+            this.Markers.forEach((arrItem: any) => {
+                if (arrItem.id == item.id) {
+                    canPush = false
+                }
+            })
+            if (canPush) {
+                this.Markers.push(item);
+                this.undoStack.push(new SGraphAddCommand(this, item));
+            }
         }
         this.cmd = 'choice';
         this.selectContainer.clear()
@@ -917,15 +927,33 @@ export class EditScence extends SGraphScene {
             this.focusItem = item;
         });
 
-       if(item instanceof SZoneLegendItem || item instanceof SFHFQZoneLegendItem || item instanceof SSCPZZoneLegendItem){
-            this.Nodes.push(item); //完成后,方可扔到Node节点
-       }
-       //    管道完成后方可保存
-       if(item instanceof TipelineItem ){
-           this.Relations.push(item);
-       }
-       this.scenceUpdate(this);
-       this.undoStack.push(new SGraphAddCommand(this, item, arrList));
+        if (item instanceof SZoneLegendItem || item instanceof SFHFQZoneLegendItem || item instanceof SSCPZZoneLegendItem) {
+            let canPush = true;  //是否可注入
+            this.Nodes.forEach((arrItem: any) => {
+                if (arrItem.id == item.id) {
+                    canPush = false
+                }
+            })
+            if (canPush) {
+                this.Nodes.push(item); //完成后,方可扔到Node节点
+                this.undoStack.push(new SGraphAddCommand(this, arrList));
+            }
+        }
+        //    管道完成后方可保存
+        if (item instanceof TipelineItem) {
+            let canPush = true;  //是否可注入
+            this.Relations.forEach((arrItem: any) => {
+                if (arrItem.id == item.id) {
+                    canPush = false
+                }
+            })
+            if (canPush) {
+                this.Relations.push(item);
+                this.undoStack.push(new SGraphAddCommand(this, arrList));
+            }
+
+        }
+        this.scenceUpdate(this);
     }
     ////////////////////////
     //  以下为鼠标键盘操作事件

+ 5 - 1
src/views/drafts.vue

@@ -160,6 +160,10 @@ export default {
       });
       // const loadings = this.$loading({type: 'global'});
       document.getElementById(`canvas`).focus();
+        if(this.fmapID.includes('null')){
+          loadings.close();
+          this.getTreeData();
+      }
       fengmap = new SFengParser(
         "fengMap",
         this.mapServerURL + "/fmap/" + this.fmapID,
@@ -198,7 +202,6 @@ export default {
             `${this.mapServerURL}/webtheme/${this.fmapID}/${fengmap.frImg}`
           );
           this.scene.addItem(imgItem);
-          this.view.scene = this.scene;
           this.view.fitSceneToView();
           this.loading = false;
           this.isQuerying = false;
@@ -487,6 +490,7 @@ export default {
         return
       }
       setTimeout(() => {
+        this.view.scene = this.scene;
         this.parserData(floorid);
         this.readGroup(floorid).then(data => {
           if (data.Result == "success") {