|
@@ -44,7 +44,7 @@ export class EditScence extends SGraphScene {
|
|
// 取消操作
|
|
// 取消操作
|
|
this.focusItem.cancelOperate();
|
|
this.focusItem.cancelOperate();
|
|
this.focusItem = null;
|
|
this.focusItem = null;
|
|
- // this.selectContainer.
|
|
|
|
|
|
+ // this.selectContainer.clear()
|
|
}
|
|
}
|
|
if (this.view) {
|
|
if (this.view) {
|
|
this.view.update();
|
|
this.view.update();
|
|
@@ -61,7 +61,7 @@ export class EditScence extends SGraphScene {
|
|
/** 当前选中焦点Item */
|
|
/** 当前选中焦点Item */
|
|
focusItem: SGraphItem | null = null;
|
|
focusItem: SGraphItem | null = null;
|
|
/** 当前选中焦点ItemList */
|
|
/** 当前选中焦点ItemList */
|
|
- focusItemList:SGraphItem[] | null = null;
|
|
|
|
|
|
+ focusItemList: SGraphItem[] | null = null;
|
|
/**图例节点 */
|
|
/**图例节点 */
|
|
Nodes: any = []; // 图例节点,所有与工程信息化相关的图例(图标类型与区域)
|
|
Nodes: any = []; // 图例节点,所有与工程信息化相关的图例(图标类型与区域)
|
|
/**图例节点 */ // 与工程信息无关的标识对象(增加文本注释,图上的图片说明)
|
|
/**图例节点 */ // 与工程信息无关的标识对象(增加文本注释,图上的图片说明)
|
|
@@ -130,7 +130,7 @@ export class EditScence extends SGraphScene {
|
|
if (obj.itemList.length == 1) {
|
|
if (obj.itemList.length == 1) {
|
|
// 获取聚焦item
|
|
// 获取聚焦item
|
|
this.focusItem = obj.itemList[0]
|
|
this.focusItem = obj.itemList[0]
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
this.focusItem = null
|
|
this.focusItem = null
|
|
}
|
|
}
|
|
let msg = {
|
|
let msg = {
|
|
@@ -351,7 +351,6 @@ export class EditScence extends SGraphScene {
|
|
this.addItem(Polylines);
|
|
this.addItem(Polylines);
|
|
this.Nodes.push(Polylines);
|
|
this.Nodes.push(Polylines);
|
|
Polylines.connect("finishCreated", this, this.finishCreated);
|
|
Polylines.connect("finishCreated", this, this.finishCreated);
|
|
- this.finishCreated(Polylines)
|
|
|
|
this.focusItem = Polylines;
|
|
this.focusItem = Polylines;
|
|
this.scenceUpdate(this);
|
|
this.scenceUpdate(this);
|
|
}
|
|
}
|
|
@@ -385,7 +384,7 @@ export class EditScence extends SGraphScene {
|
|
this.Markers.push(item);
|
|
this.Markers.push(item);
|
|
this.grabItem == null;
|
|
this.grabItem == null;
|
|
this.focusItem = item;
|
|
this.focusItem = item;
|
|
- this.cmd = 'choice';
|
|
|
|
|
|
+ this.finishCreated(item);
|
|
this.scenceUpdate(this);
|
|
this.scenceUpdate(this);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -421,6 +420,7 @@ export class EditScence extends SGraphScene {
|
|
this.grabItem = item;
|
|
this.grabItem = item;
|
|
this.focusItem = item;
|
|
this.focusItem = item;
|
|
this.cmd = 'choice';
|
|
this.cmd = 'choice';
|
|
|
|
+ this.finishCreated(item);
|
|
this.scenceUpdate(this);
|
|
this.scenceUpdate(this);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -461,6 +461,7 @@ export class EditScence extends SGraphScene {
|
|
this.Nodes.push(item);
|
|
this.Nodes.push(item);
|
|
this.grabItem = item;
|
|
this.grabItem = item;
|
|
this.focusItem = item;
|
|
this.focusItem = item;
|
|
|
|
+ this.finishCreated(item);
|
|
this.scenceUpdate(this);
|
|
this.scenceUpdate(this);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -674,7 +675,7 @@ export class EditScence extends SGraphScene {
|
|
* @param AttachObjectIds Array
|
|
* @param AttachObjectIds Array
|
|
*/
|
|
*/
|
|
upadatAttachObjectIds(AttachObjectIds: []): void {
|
|
upadatAttachObjectIds(AttachObjectIds: []): void {
|
|
- console.log('AttachObjectIds',AttachObjectIds)
|
|
|
|
|
|
+ console.log('AttachObjectIds', AttachObjectIds)
|
|
if (this.focusItem) {
|
|
if (this.focusItem) {
|
|
this.focusItem.data.AttachObjectIds = AttachObjectIds;
|
|
this.focusItem.data.AttachObjectIds = AttachObjectIds;
|
|
}
|
|
}
|
|
@@ -727,12 +728,12 @@ export class EditScence extends SGraphScene {
|
|
}
|
|
}
|
|
this.scenceUpdate(this);
|
|
this.scenceUpdate(this);
|
|
}
|
|
}
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
//批量删除
|
|
//批量删除
|
|
- if(!this.focusItemList){
|
|
|
|
|
|
+ if (!this.focusItemList) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- this.focusItemList.forEach((focusItem)=>{
|
|
|
|
|
|
+ this.focusItemList.forEach((focusItem) => {
|
|
this.removeItem(focusItem);
|
|
this.removeItem(focusItem);
|
|
let a = -1
|
|
let a = -1
|
|
this.Nodes.forEach((item: any, index: number) => {
|
|
this.Nodes.forEach((item: any, index: number) => {
|
|
@@ -830,9 +831,12 @@ export class EditScence extends SGraphScene {
|
|
* 完成事件创建的回调函数
|
|
* 完成事件创建的回调函数
|
|
*/
|
|
*/
|
|
finishCreated(item: any) {
|
|
finishCreated(item: any) {
|
|
- this.setCmd = 'choice';
|
|
|
|
- this.focusItem = item;
|
|
|
|
|
|
+ this.cmd = 'choice';
|
|
|
|
+ this.selectContainer.clear()
|
|
this.selectContainer.toggleItem(item)
|
|
this.selectContainer.toggleItem(item)
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.focusItem = item;
|
|
|
|
+ })
|
|
}
|
|
}
|
|
////////////////////////
|
|
////////////////////////
|
|
// 以下为鼠标键盘操作事件
|
|
// 以下为鼠标键盘操作事件
|
|
@@ -952,8 +956,8 @@ export class EditScence extends SGraphScene {
|
|
onDoubleClick(event: SMouseEvent): boolean {
|
|
onDoubleClick(event: SMouseEvent): boolean {
|
|
if (!this.isEditStatus) {
|
|
if (!this.isEditStatus) {
|
|
return true
|
|
return true
|
|
- }else{
|
|
|
|
- return super.onDoubleClick(event);
|
|
|
|
|
|
+ } else {
|
|
|
|
+ return super.onDoubleClick(event);
|
|
}
|
|
}
|
|
|
|
|
|
} // Function onDoubleClick()
|
|
} // Function onDoubleClick()
|
|
@@ -991,7 +995,7 @@ export class EditScence extends SGraphScene {
|
|
* 设置直线结束Item
|
|
* 设置直线结束Item
|
|
*
|
|
*
|
|
*/
|
|
*/
|
|
- setLineItem(event: SMouseEvent): void {
|
|
|
|
|
|
+ setLineItem(event: SMouseEvent): void {
|
|
if (this.grabItem instanceof SLineMarkerItem) {
|
|
if (this.grabItem instanceof SLineMarkerItem) {
|
|
const item = this.clickIsItem(event);
|
|
const item = this.clickIsItem(event);
|
|
// 鼠标点是否在某个item内
|
|
// 鼠标点是否在某个item内
|
|
@@ -1003,7 +1007,7 @@ export class EditScence extends SGraphScene {
|
|
if (this.grabItem.status == SItemStatus.Create) {
|
|
if (this.grabItem.status == SItemStatus.Create) {
|
|
// 点击在item内、创建状态且端点列表不为空时将直线结束端点和item绑定
|
|
// 点击在item内、创建状态且端点列表不为空时将直线结束端点和item绑定
|
|
if (this.grabItem.line.length) {
|
|
if (this.grabItem.line.length) {
|
|
- if (this.grabItem.startItem?.id == item.id) {
|
|
|
|
|
|
+ if (this.grabItem.startItem ?.id == item.id) {
|
|
this.grabItem.endItem = null;
|
|
this.grabItem.endItem = null;
|
|
} else {
|
|
} else {
|
|
this.grabItem.endItem = item;
|
|
this.grabItem.endItem = item;
|
|
@@ -1017,7 +1021,7 @@ export class EditScence extends SGraphScene {
|
|
// 点击在item内、编辑状态且点击的为结束端点时
|
|
// 点击在item内、编辑状态且点击的为结束端点时
|
|
if (this.grabItem.curIndex == 1) {
|
|
if (this.grabItem.curIndex == 1) {
|
|
// 直线关联的起始item是直线结束端点所在的item时,不吸附在点击item中心并将直线关联的结束item置为null
|
|
// 直线关联的起始item是直线结束端点所在的item时,不吸附在点击item中心并将直线关联的结束item置为null
|
|
- if (this.grabItem.startItem?.id == item.id) {
|
|
|
|
|
|
+ if (this.grabItem.startItem ?.id == item.id) {
|
|
this.grabItem.endItem = null;
|
|
this.grabItem.endItem = null;
|
|
} else {// 反正吸附,关联
|
|
} else {// 反正吸附,关联
|
|
this.grabItem.endItem = item;
|
|
this.grabItem.endItem = item;
|
|
@@ -1025,7 +1029,7 @@ export class EditScence extends SGraphScene {
|
|
item.connect('onMove', this.grabItem, this.grabItem.changePos);
|
|
item.connect('onMove', this.grabItem, this.grabItem.changePos);
|
|
}
|
|
}
|
|
} else if (this.grabItem.curIndex == 0) {
|
|
} else if (this.grabItem.curIndex == 0) {
|
|
- if (this.grabItem.endItem?.id == item.id) {
|
|
|
|
|
|
+ if (this.grabItem.endItem ?.id == item.id) {
|
|
this.grabItem.startItem = null;
|
|
this.grabItem.startItem = null;
|
|
} else {
|
|
} else {
|
|
this.grabItem.startItem = item;
|
|
this.grabItem.startItem = item;
|