|
@@ -613,6 +613,7 @@ export class EditScence extends SGraphScene {
|
|
|
*/
|
|
|
deleiteItem(): void {
|
|
|
if (this.focusItem) {
|
|
|
+ debugger
|
|
|
this.removeItem(this.focusItem);
|
|
|
let a = -1
|
|
|
this.Nodes.forEach((item: any, index: number) => {
|
|
@@ -620,21 +621,27 @@ export class EditScence extends SGraphScene {
|
|
|
a = index
|
|
|
}
|
|
|
});
|
|
|
- this.Nodes.splice(a, 1);
|
|
|
+ if(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
|
|
|
}
|
|
|
});
|
|
|
- this.Markers.splice(b, 1);
|
|
|
+ if (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
|
|
|
}
|
|
|
});
|
|
|
- this.Relations.splice(c, 1);
|
|
|
+ if (c > -1) {
|
|
|
+ this.Relations.splice(c, 1);
|
|
|
+ }
|
|
|
this.focusItem = null;
|
|
|
}
|
|
|
if (this.view) {
|