|
@@ -1,7 +1,11 @@
|
|
import { SMouseEvent, SUndoStack } from "@saga-web/base";
|
|
import { SMouseEvent, SUndoStack } from "@saga-web/base";
|
|
import { SGraphScene, SGraphLayoutType, SAnchorItem } from '@saga-web/graph/lib';
|
|
import { SGraphScene, SGraphLayoutType, SAnchorItem } from '@saga-web/graph/lib';
|
|
import { SFloorParser, SLineItem, SPolylineItem, SItemStatus, ItemOrder, STooltipItem, ItemColor } from "@saga-web/big";
|
|
import { SFloorParser, SLineItem, SPolylineItem, SItemStatus, ItemOrder, STooltipItem, ItemColor } from "@saga-web/big";
|
|
-import { SGraphItem, SLineStyle,SGraphPropertyCommand, SImageItem, STextItem, SGraphPointListInsert, SGraphPointListDelete, SGraphPointListUpdate, SGraphAddCommand } from "@saga-web/graph/lib";
|
|
|
|
|
|
+import { SGraphItem, SLineStyle, SGraphPropertyCommand, SImageItem, STextItem, SGraphPointListInsert, SGraphPointListDelete, SGraphPointListUpdate, SGraphAddCommand } from "@saga-web/graph/lib";
|
|
|
|
+import {SGraphAddListCommand} from "./SGraphAddListCommand"
|
|
|
|
+import {SGraphDeleteCommand} from "./SGraphDeleteCommand"
|
|
|
|
+import {SGraphDeleteListCommand} from "./SGraphDeleteListCommand"
|
|
|
|
+
|
|
import { SZoneLegendItem } from "@/lib/items/SZoneLegendItem";
|
|
import { SZoneLegendItem } from "@/lib/items/SZoneLegendItem";
|
|
import { SSCPZZoneLegendItem } from "@/lib/items/SSCPZZoneLegendItem";
|
|
import { SSCPZZoneLegendItem } from "@/lib/items/SSCPZZoneLegendItem";
|
|
import { SFHFQZoneLegendItem } from "@/lib/items/SFHFQZoneLegendItem";
|
|
import { SFHFQZoneLegendItem } from "@/lib/items/SFHFQZoneLegendItem";
|
|
@@ -184,7 +188,6 @@ export class EditScence extends SGraphScene {
|
|
clickItem.connect('onMove', item, item.changePos);
|
|
clickItem.connect('onMove', item, item.changePos);
|
|
}
|
|
}
|
|
this.scenceUpdate(this);
|
|
this.scenceUpdate(this);
|
|
- // item.connect("onMove", this, this.onItemMove.bind(this));
|
|
|
|
return true
|
|
return true
|
|
}
|
|
}
|
|
|
|
|
|
@@ -243,7 +246,7 @@ export class EditScence extends SGraphScene {
|
|
// 起始锚点
|
|
// 起始锚点
|
|
item.startAnchor = anc;
|
|
item.startAnchor = anc;
|
|
if (anc) {
|
|
if (anc) {
|
|
- anc.parent?.connect('changePos', item, item.changePos)
|
|
|
|
|
|
+ anc.parent ?.connect('changePos', item, item.changePos)
|
|
item.anchor1ID = anc.id;
|
|
item.anchor1ID = anc.id;
|
|
item.node1Id = anc.parent.id;
|
|
item.node1Id = anc.parent.id;
|
|
}
|
|
}
|
|
@@ -425,7 +428,7 @@ export class EditScence extends SGraphScene {
|
|
*/
|
|
*/
|
|
addIconItem(event: SMouseEvent): void {
|
|
addIconItem(event: SMouseEvent): void {
|
|
//获取信息工程化相关参数
|
|
//获取信息工程化相关参数
|
|
- const InfoSystemId = this._legend.InfoSystemId ? this._legend.InfoSystemId :'';
|
|
|
|
|
|
+ const InfoSystemId = this._legend.InfoSystemId ? this._legend.InfoSystemId : '';
|
|
const LegendData: Legend = {
|
|
const LegendData: Legend = {
|
|
ID: uuid(),
|
|
ID: uuid(),
|
|
Name: this._legend.Name,
|
|
Name: this._legend.Name,
|
|
@@ -447,7 +450,7 @@ export class EditScence extends SGraphScene {
|
|
font: 12, //font
|
|
font: 12, //font
|
|
color: '', //字体颜色
|
|
color: '', //字体颜色
|
|
GraphCategoryId: this._legend.GraphCategoryId,
|
|
GraphCategoryId: this._legend.GraphCategoryId,
|
|
- InfoSystemId:InfoSystemId //信息工程话分类ID分类
|
|
|
|
|
|
+ InfoSystemId: InfoSystemId //信息工程话分类ID分类
|
|
},
|
|
},
|
|
}
|
|
}
|
|
const item = new SImageLegendItem(null, LegendData);
|
|
const item = new SImageLegendItem(null, LegendData);
|
|
@@ -617,7 +620,7 @@ export class EditScence extends SGraphScene {
|
|
upadataImageUrl(url: string): void {
|
|
upadataImageUrl(url: string): void {
|
|
if (this.focusItem) {
|
|
if (this.focusItem) {
|
|
const newMsg = '/serve/topology-wanda/Picture/query/' + url;
|
|
const newMsg = '/serve/topology-wanda/Picture/query/' + url;
|
|
- const oldMsg = this.focusItem.url;
|
|
|
|
|
|
+ const oldMsg = this.focusItem.url;
|
|
this.focusItem.url = newMsg;
|
|
this.focusItem.url = newMsg;
|
|
this.undoStack.push(new SGraphPropertyCommand(this, this.focusItem, "url", oldMsg, newMsg));
|
|
this.undoStack.push(new SGraphPropertyCommand(this, this.focusItem, "url", oldMsg, newMsg));
|
|
}
|
|
}
|
|
@@ -638,7 +641,7 @@ export class EditScence extends SGraphScene {
|
|
borderStyle = SLineStyle.Soild;
|
|
borderStyle = SLineStyle.Soild;
|
|
}
|
|
}
|
|
const newMsg = borderStyle;
|
|
const newMsg = borderStyle;
|
|
- const oldMsg = this.focusItem.lineStyle;
|
|
|
|
|
|
+ const oldMsg = this.focusItem.lineStyle;
|
|
this.focusItem.lineStyle = borderStyle;
|
|
this.focusItem.lineStyle = borderStyle;
|
|
this.undoStack.push(new SGraphPropertyCommand(this, this.focusItem, "lineStyle", oldMsg, newMsg));
|
|
this.undoStack.push(new SGraphPropertyCommand(this, this.focusItem, "lineStyle", oldMsg, newMsg));
|
|
}
|
|
}
|
|
@@ -651,7 +654,7 @@ export class EditScence extends SGraphScene {
|
|
upadataLengedName(val: string): void {
|
|
upadataLengedName(val: string): void {
|
|
if (this.focusItem && this.focusItem.data) {
|
|
if (this.focusItem && this.focusItem.data) {
|
|
const newMsg = val;
|
|
const newMsg = val;
|
|
- const oldMsg = this.focusItem.text;
|
|
|
|
|
|
+ const oldMsg = this.focusItem.text;
|
|
this.focusItem.text = val;
|
|
this.focusItem.text = val;
|
|
this.undoStack.push(new SGraphPropertyCommand(this, this.focusItem, "text", oldMsg, newMsg));
|
|
this.undoStack.push(new SGraphPropertyCommand(this, this.focusItem, "text", oldMsg, newMsg));
|
|
this.scenceUpdate(this);
|
|
this.scenceUpdate(this);
|
|
@@ -665,7 +668,7 @@ export class EditScence extends SGraphScene {
|
|
upadatImageNum(num: number): void {
|
|
upadatImageNum(num: number): void {
|
|
if (this.focusItem && this.focusItem.num) {
|
|
if (this.focusItem && this.focusItem.num) {
|
|
const newMsg = num;
|
|
const newMsg = num;
|
|
- const oldMsg = this.focusItem.num;
|
|
|
|
|
|
+ const oldMsg = this.focusItem.num;
|
|
this.focusItem.num = num;
|
|
this.focusItem.num = num;
|
|
this.undoStack.push(new SGraphPropertyCommand(this, this.focusItem, "num", oldMsg, newMsg));
|
|
this.undoStack.push(new SGraphPropertyCommand(this, this.focusItem, "num", oldMsg, newMsg));
|
|
}
|
|
}
|
|
@@ -677,8 +680,8 @@ export class EditScence extends SGraphScene {
|
|
*/
|
|
*/
|
|
upadatfillColor(fillColor: string): void {
|
|
upadatfillColor(fillColor: string): void {
|
|
if (this.focusItem && this.focusItem.fillColor) {
|
|
if (this.focusItem && this.focusItem.fillColor) {
|
|
- const newMsg = new SColor(fillColor);
|
|
|
|
- const oldMsg = this.focusItem.fillColor;
|
|
|
|
|
|
+ const newMsg = new SColor(fillColor);
|
|
|
|
+ const oldMsg = this.focusItem.fillColor;
|
|
this.focusItem.fillColor = new SColor(fillColor);
|
|
this.focusItem.fillColor = new SColor(fillColor);
|
|
this.undoStack.push(new SGraphPropertyCommand(this, this.focusItem, "num", oldMsg, newMsg));
|
|
this.undoStack.push(new SGraphPropertyCommand(this, this.focusItem, "num", oldMsg, newMsg));
|
|
}
|
|
}
|
|
@@ -701,7 +704,7 @@ export class EditScence extends SGraphScene {
|
|
if (this.focusItem) {
|
|
if (this.focusItem) {
|
|
this.focusItem.data.AttachObjectIds = AttachObjectIds;
|
|
this.focusItem.data.AttachObjectIds = AttachObjectIds;
|
|
// 重新选中focusitem
|
|
// 重新选中focusitem
|
|
- const item = this.focusItem;
|
|
|
|
|
|
+ const item = this.focusItem;
|
|
this.selectContainer.clear();
|
|
this.selectContainer.clear();
|
|
this.selectContainer.toggleItem(item)
|
|
this.selectContainer.toggleItem(item)
|
|
}
|
|
}
|
|
@@ -720,6 +723,7 @@ export class EditScence extends SGraphScene {
|
|
) {
|
|
) {
|
|
this.focusItem.deletePoint(this.focusItem.curIndex);
|
|
this.focusItem.deletePoint(this.focusItem.curIndex);
|
|
} else {
|
|
} else {
|
|
|
|
+ this.undoStack.push(new SGraphDeleteCommand(this, this.focusItem));
|
|
this.removeItem(this.focusItem);
|
|
this.removeItem(this.focusItem);
|
|
let a = -1
|
|
let a = -1
|
|
this.Nodes.forEach((item: any, index: number) => {
|
|
this.Nodes.forEach((item: any, index: number) => {
|
|
@@ -759,6 +763,7 @@ export class EditScence extends SGraphScene {
|
|
if (!this.focusItemList) {
|
|
if (!this.focusItemList) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ this.undoStack.push(new SGraphDeleteListCommand(this,this.focusItemList))
|
|
this.focusItemList.forEach((focusItem) => {
|
|
this.focusItemList.forEach((focusItem) => {
|
|
this.removeItem(focusItem);
|
|
this.removeItem(focusItem);
|
|
let a = -1
|
|
let a = -1
|
|
@@ -841,28 +846,39 @@ export class EditScence extends SGraphScene {
|
|
* 执行取消操作
|
|
* 执行取消操作
|
|
*/
|
|
*/
|
|
redo(): void {
|
|
redo(): void {
|
|
- console.log('afdafsdaf',this.grabItem)
|
|
|
|
- this.undoStack.undo();
|
|
|
|
|
|
+ if (this.grabItem && this.grabItem.redo) {
|
|
|
|
+ this.grabItem.redo()
|
|
|
|
+ } else {
|
|
|
|
+ this.undoStack.redo();
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 执行重做操作执行
|
|
* 执行重做操作执行
|
|
*/
|
|
*/
|
|
undo(): void {
|
|
undo(): void {
|
|
- this.undoStack.redo();
|
|
|
|
|
|
+ if (this.grabItem && this.grabItem.undo) {
|
|
|
|
+ this.grabItem.undo()
|
|
|
|
+ } else {
|
|
|
|
+ this.undoStack.undo();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
/**
|
|
/**
|
|
* 完成事件创建的回调函数
|
|
* 完成事件创建的回调函数
|
|
*/
|
|
*/
|
|
finishCreated(item: any) {
|
|
finishCreated(item: any) {
|
|
|
|
+ let arrList = []
|
|
|
|
+ if(this.cmd == 'baseLine'){
|
|
|
|
+ arrList = this.Markers
|
|
|
|
+ }
|
|
this.cmd = 'choice';
|
|
this.cmd = 'choice';
|
|
this.selectContainer.clear()
|
|
this.selectContainer.clear()
|
|
this.selectContainer.toggleItem(item)
|
|
this.selectContainer.toggleItem(item)
|
|
- setTimeout(()=>{
|
|
|
|
|
|
+ setTimeout(() => {
|
|
this.focusItem = item;
|
|
this.focusItem = item;
|
|
})
|
|
})
|
|
- // 做相应得redo/undo处理
|
|
|
|
- this.undoStack.push(new SGraphAddCommand(this, item));
|
|
|
|
|
|
+ this.undoStack.push(new SGraphAddCommand(this, item,arrList));
|
|
}
|
|
}
|
|
////////////////////////
|
|
////////////////////////
|
|
// 以下为鼠标键盘操作事件
|
|
// 以下为鼠标键盘操作事件
|
|
@@ -1338,4 +1354,12 @@ export class EditScence extends SGraphScene {
|
|
Line: Line
|
|
Line: Line
|
|
};
|
|
};
|
|
} // Function absorbSpaceLine()
|
|
} // Function absorbSpaceLine()
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 添加多个item命令
|
|
|
|
+ * @param focusItemList 鼠标事件对象
|
|
|
|
+ */
|
|
|
|
+ AddListCommand (focusItemList:any[]):void{
|
|
|
|
+ this.undoStack.push(new SGraphAddListCommand(this,focusItemList));
|
|
|
|
+ }
|
|
}
|
|
}
|