|
@@ -1,6 +1,6 @@
|
|
|
import { SMouseEvent, SUndoStack } from "@saga-web/base";
|
|
|
import { SGraphScene, SGraphLayoutType } from '@saga-web/graph/lib';
|
|
|
-import { SFloorParser, SLineItem, SPolylineItem, SItemStatus, ItemOrder } from "@saga-web/big";
|
|
|
+import { SFloorParser, SLineItem, SPolylineItem, SItemStatus, ItemOrder, STooltipItem } from "@saga-web/big";
|
|
|
import { SGraphItem, SLineStyle, SImageItem, STextItem, SGraphPointListInsert, SGraphPointListDelete, SGraphPointListUpdate, SGraphAddCommand } from "@saga-web/graph/lib";
|
|
|
import { SZoneLegendItem } from "@/lib/items/SZoneLegendItem";
|
|
|
import { SSCPZZoneLegendItem } from "@/lib/items/SSCPZZoneLegendItem";
|
|
@@ -143,7 +143,8 @@ export class EditScence extends SGraphScene {
|
|
|
this.addItem(item);
|
|
|
item.connect("finishCreated", this, this.finishCreated);
|
|
|
this.grabItem = item;
|
|
|
- this.Markers.push(item)
|
|
|
+ this.Markers.push(item);
|
|
|
+ this.scenceUpdate(this);
|
|
|
// this.undoStack.push(new SGraphAddCommand(this, item));
|
|
|
// item.connect("onMove", this, this.onItemMove.bind(this));
|
|
|
return true
|
|
@@ -196,6 +197,7 @@ export class EditScence extends SGraphScene {
|
|
|
// this.undoStack.push(new SGraphAddCommand(this, item));
|
|
|
this.grabItem = item;
|
|
|
this.focusItem = item;
|
|
|
+ this.scenceUpdate(this);
|
|
|
return true
|
|
|
}
|
|
|
|
|
@@ -244,6 +246,7 @@ export class EditScence extends SGraphScene {
|
|
|
this.grabItem = Polylines;
|
|
|
this.focusItem = Polylines;
|
|
|
this.Nodes.push(Polylines);
|
|
|
+ this.scenceUpdate(this);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -268,6 +271,7 @@ export class EditScence extends SGraphScene {
|
|
|
OutLine: item.pointArr[0],
|
|
|
SubType: SubType,
|
|
|
Properties: {
|
|
|
+ IconUrl: '/serve/topology-wanda/Picture/query/' + this._legend.Url,
|
|
|
StrokeColor: this._legend.Color,
|
|
|
FillColor: this._legend.FillColor,
|
|
|
LineDash: this._legend.LineDash,
|
|
@@ -292,6 +296,7 @@ export class EditScence extends SGraphScene {
|
|
|
Polylines.connect("finishCreated", this, this.finishCreated);
|
|
|
this.focusItem = Polylines;
|
|
|
this.Nodes.push(Polylines);
|
|
|
+ this.scenceUpdate(this);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -323,7 +328,8 @@ export class EditScence extends SGraphScene {
|
|
|
this.grabItem == null;
|
|
|
this.focusItem = item;
|
|
|
this.cmd = 'choice';
|
|
|
- this.Markers.push(item)
|
|
|
+ this.Markers.push(item);
|
|
|
+ this.scenceUpdate(this);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -356,7 +362,8 @@ export class EditScence extends SGraphScene {
|
|
|
this.addItem(item);
|
|
|
this.grabItem == null
|
|
|
this.cmd = 'choice';
|
|
|
- this.Markers.push(item)
|
|
|
+ this.Markers.push(item);
|
|
|
+ this.scenceUpdate(this);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -393,6 +400,7 @@ export class EditScence extends SGraphScene {
|
|
|
// item.moveTo(event.x, event.y);
|
|
|
this.addItem(item);
|
|
|
this.Nodes.push(item);
|
|
|
+ this.scenceUpdate(this);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -410,6 +418,7 @@ export class EditScence extends SGraphScene {
|
|
|
if (this.focusItem) {
|
|
|
const old = this.focusItem.text;
|
|
|
this.focusItem.text = str;
|
|
|
+ this.scenceUpdate(this);
|
|
|
// this.undoStack.push(new SGraphPropertyCommand(this, this.focusItem, "text", old, str));
|
|
|
}
|
|
|
}
|
|
@@ -565,7 +574,8 @@ export class EditScence extends SGraphScene {
|
|
|
*/
|
|
|
upadataLengedName(val: string): void {
|
|
|
if (this.focusItem && this.focusItem.data) {
|
|
|
- this.focusItem.text = val
|
|
|
+ this.focusItem.text = val;
|
|
|
+ this.scenceUpdate(this);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -575,7 +585,7 @@ export class EditScence extends SGraphScene {
|
|
|
*/
|
|
|
upadatImageNum(num: number): void {
|
|
|
if (this.focusItem && this.focusItem.num) {
|
|
|
- this.focusItem.num = num
|
|
|
+ this.focusItem.num = num;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -603,34 +613,51 @@ export class EditScence extends SGraphScene {
|
|
|
*/
|
|
|
deleiteItem(): void {
|
|
|
if (this.focusItem) {
|
|
|
- this.removeItem(this.focusItem);
|
|
|
- let a = -1
|
|
|
- this.Nodes.forEach((item: any, index: number) => {
|
|
|
- if (item.id == this.focusItem.id) {
|
|
|
- a = index
|
|
|
+ if ((this.focusItem instanceof SZoneLegendItem ||
|
|
|
+ this.focusItem instanceof SSCPZZoneLegendItem ||
|
|
|
+ this.focusItem instanceof SFHFQZoneLegendItem ||
|
|
|
+ this.focusItem instanceof TipelineItem) &&
|
|
|
+ this.focusItem.curIndex != -1
|
|
|
+ ) {
|
|
|
+ this.focusItem.deletePoint(this.focusItem.curIndex);
|
|
|
+ } else {
|
|
|
+ this.removeItem(this.focusItem);
|
|
|
+ let a = -1
|
|
|
+ this.Nodes.forEach((item: any, index: number) => {
|
|
|
+ if (item.id == this.focusItem.id) {
|
|
|
+ a = index
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if(a > -1) {
|
|
|
+ this.Nodes.splice(a, 1);
|
|
|
}
|
|
|
- });
|
|
|
- this.Nodes.splice(a, 1);
|
|
|
- let b = -1;
|
|
|
- this.Markers.forEach((item: any, index: number) => {
|
|
|
- if (item.id == this.focusItem.id) {
|
|
|
- b = index
|
|
|
+ let b = -1;
|
|
|
+ this.Markers.forEach((item: any, index: number) => {
|
|
|
+ if (item.id == this.focusItem.id) {
|
|
|
+ b = index
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (b > -1) {
|
|
|
+ this.Markers.splice(b, 1);
|
|
|
}
|
|
|
- });
|
|
|
- this.Markers.splice(b, 1);
|
|
|
- let c = -1;
|
|
|
- this.Relations.forEach((item: any, index: number) => {
|
|
|
- if (item.id == this.focusItem.id) {
|
|
|
- c = index
|
|
|
+ let c = -1;
|
|
|
+ this.Relations.forEach((item: any, index: number) => {
|
|
|
+ if (item.id == this.focusItem.id) {
|
|
|
+ c = index
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (c > -1) {
|
|
|
+ this.Relations.splice(c, 1);
|
|
|
}
|
|
|
- });
|
|
|
- this.Relations.splice(c, 1);
|
|
|
- this.focusItem = null;
|
|
|
- }
|
|
|
- if (this.view) {
|
|
|
- this.view.update();
|
|
|
+ this.focusItem = null;
|
|
|
+ if (this.view) {
|
|
|
+ this.view.update();
|
|
|
+ }
|
|
|
+ this.scenceUpdate(this);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ scenceUpdate(scence: any) {}
|
|
|
|
|
|
/**
|
|
|
* 对齐指定item
|