|
@@ -2,9 +2,9 @@ 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 { 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";
|
|
@@ -372,6 +372,7 @@ export class EditScence extends SGraphScene {
|
|
/** 由应用自己定义 */
|
|
/** 由应用自己定义 */
|
|
Properties: {
|
|
Properties: {
|
|
IconUrl: require(`../../assets/images/t-img-hover.png`),
|
|
IconUrl: require(`../../assets/images/t-img-hover.png`),
|
|
|
|
+ StrokeColor: "#c0ccda",
|
|
Url: '',
|
|
Url: '',
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -522,7 +523,6 @@ export class EditScence extends SGraphScene {
|
|
if (this.focusItem) {
|
|
if (this.focusItem) {
|
|
const oldMsg = this.focusItem.color;
|
|
const oldMsg = this.focusItem.color;
|
|
const newMsg = new SColor(color);
|
|
const newMsg = new SColor(color);
|
|
-
|
|
|
|
this.focusItem.color = newMsg;
|
|
this.focusItem.color = newMsg;
|
|
this.undoStack.push(new SGraphPropertyCommand(this, this.focusItem, "color", oldMsg, newMsg));
|
|
this.undoStack.push(new SGraphPropertyCommand(this, this.focusItem, "color", oldMsg, newMsg));
|
|
}
|
|
}
|
|
@@ -763,7 +763,7 @@ export class EditScence extends SGraphScene {
|
|
if (!this.focusItemList) {
|
|
if (!this.focusItemList) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- this.undoStack.push(new SGraphDeleteListCommand(this,this.focusItemList))
|
|
|
|
|
|
+ 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
|
|
@@ -869,7 +869,7 @@ export class EditScence extends SGraphScene {
|
|
*/
|
|
*/
|
|
finishCreated(item: any) {
|
|
finishCreated(item: any) {
|
|
let arrList = []
|
|
let arrList = []
|
|
- if(this.cmd == 'baseLine'){
|
|
|
|
|
|
+ if (this.cmd == 'baseLine') {
|
|
arrList = this.Markers
|
|
arrList = this.Markers
|
|
}
|
|
}
|
|
this.cmd = 'choice';
|
|
this.cmd = 'choice';
|
|
@@ -878,7 +878,7 @@ export class EditScence extends SGraphScene {
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
this.focusItem = item;
|
|
this.focusItem = item;
|
|
})
|
|
})
|
|
- this.undoStack.push(new SGraphAddCommand(this, item,arrList));
|
|
|
|
|
|
+ this.undoStack.push(new SGraphAddCommand(this, item, arrList));
|
|
}
|
|
}
|
|
////////////////////////
|
|
////////////////////////
|
|
// 以下为鼠标键盘操作事件
|
|
// 以下为鼠标键盘操作事件
|
|
@@ -957,7 +957,7 @@ export class EditScence extends SGraphScene {
|
|
if (this.grabItem instanceof SLineMarkerItem && this.grabItem.status == SItemStatus.Edit) {
|
|
if (this.grabItem instanceof SLineMarkerItem && this.grabItem.status == SItemStatus.Edit) {
|
|
this.setLineItem(event)
|
|
this.setLineItem(event)
|
|
return true;
|
|
return true;
|
|
- } else if (this.grabItem instanceof TipelineItem){
|
|
|
|
|
|
+ } else if (this.grabItem instanceof TipelineItem) {
|
|
this.updateTipeAnc(event);
|
|
this.updateTipeAnc(event);
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
@@ -989,7 +989,7 @@ export class EditScence extends SGraphScene {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 删除键功能
|
|
// 删除键功能
|
|
- if(event.code=='Delete'){
|
|
|
|
|
|
+ if (event.code == 'Delete') {
|
|
this.deleiteItem()
|
|
this.deleiteItem()
|
|
}
|
|
}
|
|
return false
|
|
return false
|
|
@@ -1045,7 +1045,7 @@ export class EditScence extends SGraphScene {
|
|
*
|
|
*
|
|
*/
|
|
*/
|
|
updateTipeAnc(event: SMouseEvent): void {
|
|
updateTipeAnc(event: SMouseEvent): void {
|
|
- if (this.grabItem instanceof TipelineItem){
|
|
|
|
|
|
+ if (this.grabItem instanceof TipelineItem) {
|
|
const anc = this.clickIsAnchor(event);
|
|
const anc = this.clickIsAnchor(event);
|
|
if (anc) {
|
|
if (anc) {
|
|
const p = anc.mapToScene(0, 0)
|
|
const p = anc.mapToScene(0, 0)
|
|
@@ -1053,9 +1053,9 @@ export class EditScence extends SGraphScene {
|
|
event.y = p.y;
|
|
event.y = p.y;
|
|
if (this.grabItem.status == SItemStatus.Edit) {
|
|
if (this.grabItem.status == SItemStatus.Edit) {
|
|
if (this.grabItem.curIndex == 0) {
|
|
if (this.grabItem.curIndex == 0) {
|
|
- if (this.grabItem.startAnchor){
|
|
|
|
|
|
+ if (this.grabItem.startAnchor) {
|
|
this.grabItem.startAnchor.isConnected = false
|
|
this.grabItem.startAnchor.isConnected = false
|
|
- this.grabItem.startAnchor.parent.disconnect('changePos',this.grabItem);
|
|
|
|
|
|
+ this.grabItem.startAnchor.parent.disconnect('changePos', this.grabItem);
|
|
}
|
|
}
|
|
anc.isConnected = true;
|
|
anc.isConnected = true;
|
|
this.grabItem.startAnchor = anc;
|
|
this.grabItem.startAnchor = anc;
|
|
@@ -1063,10 +1063,10 @@ export class EditScence extends SGraphScene {
|
|
this.grabItem.node1Id = anc.parent.id
|
|
this.grabItem.node1Id = anc.parent.id
|
|
anc.parent.connect('changePos', this.grabItem, this.grabItem.changePos)
|
|
anc.parent.connect('changePos', this.grabItem, this.grabItem.changePos)
|
|
}
|
|
}
|
|
- if (this.grabItem.curIndex == this.grabItem.pointList.length-1) {
|
|
|
|
- if (this.grabItem.endAnchor){
|
|
|
|
|
|
+ if (this.grabItem.curIndex == this.grabItem.pointList.length - 1) {
|
|
|
|
+ if (this.grabItem.endAnchor) {
|
|
this.grabItem.endAnchor.isConnected = false
|
|
this.grabItem.endAnchor.isConnected = false
|
|
- this.grabItem.endAnchor.parent.disconnect('changePos',this.grabItem);
|
|
|
|
|
|
+ this.grabItem.endAnchor.parent.disconnect('changePos', this.grabItem);
|
|
}
|
|
}
|
|
anc.isConnected = true;
|
|
anc.isConnected = true;
|
|
this.grabItem.endAnchor = anc;
|
|
this.grabItem.endAnchor = anc;
|
|
@@ -1080,18 +1080,18 @@ export class EditScence extends SGraphScene {
|
|
} else {
|
|
} else {
|
|
if (this.grabItem.status == SItemStatus.Edit) {
|
|
if (this.grabItem.status == SItemStatus.Edit) {
|
|
if (this.grabItem.curIndex == 0) {
|
|
if (this.grabItem.curIndex == 0) {
|
|
- if (this.grabItem.startAnchor){
|
|
|
|
|
|
+ if (this.grabItem.startAnchor) {
|
|
this.grabItem.startAnchor.isConnected = false
|
|
this.grabItem.startAnchor.isConnected = false
|
|
- this.grabItem.startAnchor.parent.disconnect('changePos',this.grabItem);
|
|
|
|
|
|
+ this.grabItem.startAnchor.parent.disconnect('changePos', this.grabItem);
|
|
this.grabItem.startAnchor = null;
|
|
this.grabItem.startAnchor = null;
|
|
this.grabItem.anchor1ID = ''
|
|
this.grabItem.anchor1ID = ''
|
|
this.grabItem.node1Id = ''
|
|
this.grabItem.node1Id = ''
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (this.grabItem.curIndex == this.grabItem.pointList.length-1) {
|
|
|
|
- if (this.grabItem.endAnchor){
|
|
|
|
|
|
+ if (this.grabItem.curIndex == this.grabItem.pointList.length - 1) {
|
|
|
|
+ if (this.grabItem.endAnchor) {
|
|
this.grabItem.endAnchor.isConnected = false
|
|
this.grabItem.endAnchor.isConnected = false
|
|
- this.grabItem.endAnchor.parent.disconnect('changePos',this.grabItem);
|
|
|
|
|
|
+ this.grabItem.endAnchor.parent.disconnect('changePos', this.grabItem);
|
|
this.grabItem.endAnchor = null;
|
|
this.grabItem.endAnchor = null;
|
|
this.grabItem.anchor2ID = ''
|
|
this.grabItem.anchor2ID = ''
|
|
this.grabItem.node2Id = ''
|
|
this.grabItem.node2Id = ''
|
|
@@ -1430,7 +1430,16 @@ export class EditScence extends SGraphScene {
|
|
* 添加多个item命令
|
|
* 添加多个item命令
|
|
* @param focusItemList 鼠标事件对象
|
|
* @param focusItemList 鼠标事件对象
|
|
*/
|
|
*/
|
|
- AddListCommand (focusItemList:any[]):void{
|
|
|
|
- this.undoStack.push(new SGraphAddListCommand(this,focusItemList));
|
|
|
|
|
|
+ AddListCommand(focusItemList: any[]): void {
|
|
|
|
+ this.undoStack.push(new SGraphAddListCommand(this, focusItemList));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 选中状态方法
|
|
|
|
+ * @param item 鼠标事件对象
|
|
|
|
+ */
|
|
|
|
+ toggleItem(item: SGraphItem): void {
|
|
|
|
+ this.selectContainer.clear()
|
|
|
|
+ this.selectContainer.toggleItem(item)
|
|
}
|
|
}
|
|
}
|
|
}
|