Explorar o código

fix:清理设备,管线,位置左右侧得联动

YaolongHan %!s(int64=4) %!d(string=hai) anos
pai
achega
4269714e2d

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

@@ -346,8 +346,12 @@ export default {
         ) {
           this.lengedName = Item.data.Name;
           if (newval.itemType == "Image") {
+            this.imageNum = Item.num;
             this.color = Item.color;
             this.fontSize = Item.font.size;
+          } else if (newval.itemType == "Line") {
+            this.color = Item.color;
+            this.lineWidth = Item.lineWidth;
           }
         }
       }

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

@@ -66,7 +66,7 @@
         </li>-->
         <li @click="lockItem">
           <Icon :name="!isLock?'lock':'unlock'" />
-          <span>{{isLock?"锁":"锁"}}</span>
+          <span>{{isLock?"锁":"锁"}}</span>
         </li>
         <li @click="deleteItem">
           <a-icon type="delete" />

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

@@ -203,12 +203,15 @@ export class EditScence extends SGraphScene {
             AttachObjectIds: [],
             Type: "Zone",
             Pos: { X: event.x, Y: event.y },
-            OutLine:[{X:event.x, Y:event.y}],
+            OutLine: [{ X: event.x, Y: event.y }],
             Properties: {
                 StrokeColor: this._legend.Color,
                 FillColor: this._legend.FillColor,
                 LineDash: this._legend.LineDash,
                 LineWidth: this._legend.LineWidth,
+                font:0,
+                color:'',
+                TextPos:{X:0,Y:0}
             },
         }
 
@@ -305,6 +308,10 @@ export class EditScence extends SGraphScene {
             Properties: {
                 Url: '/serve/topology-wanda/Picture/query/' + this._legend.Url,
                 Num: 1, // 此num与信息工程化得num无关
+                sWidth:0,  //icon 的宽
+                sHeight:0,   //icon 的高
+                font:0,    //font
+                color:''  //字体颜色
             },
         }
         const item = new SImageLegendItem(null, LegendData);
@@ -398,7 +405,11 @@ export class EditScence extends SGraphScene {
     updatedWidth(width: number): void {
         if (this.focusItem) {
             // let old = this.focusItem.width;
-            this.focusItem.width = width;
+            if (this.focusItem.data && this.focusItem.data.GraphElementType && this.focusItem.data.GraphElementType == "Image") {
+                this.focusItem.sWidth = width;
+            } else {
+                this.focusItem.width = width;
+            }
             // this.undoStack.push(new SGraphPropertyCommand(this, this.focusItem, "color", old, color));
         }
     }
@@ -408,9 +419,14 @@ export class EditScence extends SGraphScene {
     * @param height number 颜色
     */
     updatedHeight(height: number): void {
+
         if (this.focusItem) {
             // let old = this.focusItem.width;
-            this.focusItem.height = height;
+            if (this.focusItem.data && this.focusItem.data.GraphElementType && this.focusItem.data.GraphElementType == "Image") {
+                this.focusItem.sHeight = height;
+            } else {
+                this.focusItem.height = height;
+            }
             // this.undoStack.push(new SGraphPropertyCommand(this, this.focusItem, "color", old, color));
         }
     }
@@ -475,7 +491,7 @@ export class EditScence extends SGraphScene {
      */
     upadataLengedName(val: string): void {
         if (this.focusItem && this.focusItem.data) {
-            this.focusItem.text= val
+            this.focusItem.text = val
         }
     }
 
@@ -485,7 +501,7 @@ export class EditScence extends SGraphScene {
      */
     upadatImageNum(num: number): void {
         if (this.focusItem && this.focusItem.num) {
-            this.focusItem.num= num
+            this.focusItem.num = num
         }
     }
     /**
@@ -553,7 +569,6 @@ export class EditScence extends SGraphScene {
         this.Relations.forEach(e => {
             Relations.push(e.toData())
         });
-
         let element = {
             Nodes, Markers, Relations
         }

+ 18 - 1
src/lib/items/SImageLegendItem.ts

@@ -4,7 +4,7 @@ import { SIconTextItem } from '@saga-web/big/lib/items/SIconTextItem';
 import { Legend } from '../types/Legend';
 import { ItemOrder } from '@saga-web/big/lib';
 import { SImgTextItem } from './SImgTextItem';
-
+import { SFont } from '@saga-web/draw/lib';
 /**
  * 图例节点Item(图标类型)
  *
@@ -59,6 +59,18 @@ export class SImageLegendItem extends SImgTextItem {
         if (data.Properties && data.Properties.Url) {
             this.img.url = data.Properties.Url;
         }
+        if (data.Properties && data.Properties.sWidth) {
+            this.sWidth = data.Properties.sWidth;
+        }
+        if (data.Properties && data.Properties.sHeight) {
+            this.sHeight = data.Properties.sHeight;
+        }
+        if (data.Properties && data.Properties.font) {
+            this.font = new SFont("sans-serif", data.Properties.font);
+        }
+        if (data.Properties && data.Properties.color) {
+            this.color = data.Properties.color;
+        }
     }
 
     toData(): Legend {
@@ -66,6 +78,11 @@ export class SImageLegendItem extends SImgTextItem {
         this.data.Size = {Width: this.width, Height: this.height};
         this.data.Name = this.name;
         this.data.Properties.Url = this.img.url;
+        this.data.Properties.sWidth = this.sWidth;
+        this.data.Properties.sHeight = this.sHeight;
+        this.data.Properties.font = this.font.size;
+        this.data.Properties.color = this.color;
+
         return this.data;
     }
 } // Class SImageLegendItem

+ 4 - 4
src/lib/items/SImgTextItem.ts

@@ -61,19 +61,19 @@ export class SImgTextItem extends SObjectItem {
   } // Set y
 
   /** icon宽 */
-  get width(): number {
+  get sWidth(): number {
     return this.img.width;
   }
-  set width(v: number) {
+  set sWidth(v: number) {
     this.img.width = v
     this.update();
   }
 
   /** icon宽 */
-  get height(): number {
+  get sHeight(): number {
     return this.img.height;
   }
-  set height(v: number) {
+  set sHeight(v: number) {
     this.img.height = v
     this.update();
   }

+ 9 - 0
src/lib/items/SZoneLegendItem.ts

@@ -85,6 +85,7 @@ export class SZoneLegendItem extends SPolygonItem {
         }
     }
 
+
     /**
      * 构造函数
      *
@@ -125,6 +126,12 @@ export class SZoneLegendItem extends SPolygonItem {
             if (data.Properties.TextPos) {
                 this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y);
             }
+            if (data.Properties.color) {
+                this.color = data.Properties.color
+            }
+            if (data.Properties.font) {
+                this.font =new SFont("sans-serif", data.Properties.font);
+            }
             //    if( data.Properties.LineDash){
             //     this.LineDash =this._legend.Properties.LineDash
             //    }
@@ -155,6 +162,8 @@ export class SZoneLegendItem extends SPolygonItem {
             }
         });
         this.data.Properties.TextPos = {X: this.textItem.x, Y: this.textItem.y};
+        this.data.Properties.font =  this.font.size;
+        this.data.Properties.color =  this.color;
         return this.data;
     }
 

+ 2 - 7
src/lib/parsers/STopologyParser.ts

@@ -71,13 +71,6 @@ export class STopologyParser extends SParser {
         if (t.GraphElementType == 'None') {
             let item = new SNoneLegendItem(null, t);
             this.noneLegendList.push(item);
-        } else if (t.GraphElementType == 'Line') {
-            let item = new TipelineItem(null, t);
-            item.selectable = true;
-            item.status = 0;
-            item.zOrder == ItemOrder.polylineOrder;
-            alert(123)
-            this.relationList.push(item);
         } else if (t.GraphElementType == "Zone") {
             let item = new SZoneLegendItem(null, t);
             item.selectable = true;
@@ -121,6 +114,8 @@ export class STopologyParser extends SParser {
      * */
     private addRelation(t: Relation): void {
         let item = new TipelineItem(null, t);
+        item.selectable = true;
+        item.zOrder == ItemOrder.polylineOrder;
         this.relationList.push(item);
     } // Function addRelation()
 } // class STopologyParser