|
@@ -24,13 +24,14 @@
|
|
|
* *********************************************************************************************************************
|
|
|
*/
|
|
|
|
|
|
-import {SGraphAddCommand, SGraphEditScene} from "../edit"
|
|
|
-import {SMouseEvent} from "@persagy-web/base/lib";
|
|
|
-import {SArrowStyleType, SPoint, SRect} from '@persagy-web/draw/lib';
|
|
|
-import {SItemStatus, SRectSelectItem} from '@persagy-web/big/lib';
|
|
|
-import {SGraphItem, SGraphSelectContainer} from "@persagy-web/graph/";
|
|
|
-import {uuid} from "./until";
|
|
|
-import {SBaseArrow, SBaseEquipment, SBaseExpainEdit, SBasePipeUninTool} from "./"
|
|
|
+import { SGraphAddCommand, SGraphEditScene, SGraphEdit } from "@persagy-web/edit/lib"
|
|
|
+import { SMouseEvent } from "@persagy-web/base/lib";
|
|
|
+import { SArrowStyleType, SPoint, SRect } from '@persagy-web/draw';
|
|
|
+import { SItemStatus, SRectSelectItem } from '@persagy-web/big/lib';
|
|
|
+import { SGraphItem, SGraphSelectContainer } from "@persagy-web/graph/lib/";
|
|
|
+import { uuid } from "./until";
|
|
|
+import { SBaseArrow, SBaseEquipment, SBaseExpainEdit, SBasePipeUninTool, SBasePipe } from "./"
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* big-edit 场景
|
|
@@ -46,6 +47,7 @@ export class SBaseEditScene extends SGraphEditScene {
|
|
|
Relations: any = [];
|
|
|
/** 复制的对象 */
|
|
|
copyString: any[] = [];
|
|
|
+ grabItem: null | SGraphEdit | SGraphItem = null
|
|
|
|
|
|
/**
|
|
|
* 构造函数
|
|
@@ -105,7 +107,7 @@ export class SBaseEditScene extends SGraphEditScene {
|
|
|
type: "BaseArrow",
|
|
|
},
|
|
|
style: {
|
|
|
- outLine: [{x: event.x, y: event.y}],
|
|
|
+ outLine: [{ x: event.x, y: event.y }],
|
|
|
begin: SArrowStyleType.None, //开端箭头样式
|
|
|
end: SArrowStyleType.None, //结尾箭头样式
|
|
|
isMove: true, //是否可以移动
|
|
@@ -148,7 +150,7 @@ export class SBaseEditScene extends SGraphEditScene {
|
|
|
style: {
|
|
|
default: {
|
|
|
strokecolor: "#c0ccda",
|
|
|
- url: require('./../../../assets/images/equip/' + legendObj.url),
|
|
|
+ // url: require('./../../../assets/images/equip/' + legendObj.url),
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -246,7 +248,7 @@ export class SBaseEditScene extends SGraphEditScene {
|
|
|
* 重做
|
|
|
*/
|
|
|
redo(): void {
|
|
|
- if (this.grabItem && this.grabItem.redo) {
|
|
|
+ if (this.grabItem && this.grabItem instanceof SGraphEdit) {
|
|
|
this.grabItem.redo()
|
|
|
} else {
|
|
|
this.undoStack.redo();
|
|
@@ -257,7 +259,7 @@ export class SBaseEditScene extends SGraphEditScene {
|
|
|
* 撤销
|
|
|
*/
|
|
|
undo(): void {
|
|
|
- if (this.grabItem && this.grabItem.undo) {
|
|
|
+ if (this.grabItem && this.grabItem instanceof SGraphEdit) {
|
|
|
this.grabItem.undo()
|
|
|
} else {
|
|
|
this.undoStack.undo();
|
|
@@ -370,7 +372,7 @@ export class SBaseEditScene extends SGraphEditScene {
|
|
|
/**
|
|
|
* 复制
|
|
|
*/
|
|
|
- copy():void {
|
|
|
+ copy(): void {
|
|
|
const itemList = this.selectContainer.itemList
|
|
|
if (itemList.length) {
|
|
|
itemList.forEach(t => {
|