Skip to content

Commit

Permalink
perf: 更新node节点
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBeard30 committed Mar 6, 2024
1 parent a80ae88 commit 3709e36
Show file tree
Hide file tree
Showing 13 changed files with 490 additions and 331 deletions.
6 changes: 6 additions & 0 deletions src/app/core/events/mutation/AppendNodeEvent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { AbstractMutationNodeEvent } from './AbstractMutationNodeEvent';
import { ICustomEvent } from '@/app/shared/event';

export class AppendNodeEvent extends AbstractMutationNodeEvent implements ICustomEvent {
type = 'append:node';
}
6 changes: 6 additions & 0 deletions src/app/core/events/mutation/CloneNodeEvent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { ICustomEvent } from '@/app/shared/event';
import { AbstractMutationNodeEvent } from './AbstractMutationNodeEvent';

export class CloneNodeEvent extends AbstractMutationNodeEvent implements ICustomEvent {
type = 'clone:node';
}
19 changes: 19 additions & 0 deletions src/app/core/events/mutation/FromNodeEvent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { ITreeNode, TreeNode } from '../../models';
import { IEngineContext } from '../../types';
import { ICustomEvent } from '@/app/shared/event';

export interface IFromNodeEventData {
//事件发生的数据源
source: ITreeNode;
//事件发生的目标对象
target: TreeNode;
}

export class FromNodeEvent implements ICustomEvent {
type = 'from:node';
data: IFromNodeEventData;
context: IEngineContext;
constructor(data: IFromNodeEventData) {
this.data = data;
}
}
6 changes: 6 additions & 0 deletions src/app/core/events/mutation/InsertAfterEvent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { AbstractMutationNodeEvent } from './AbstractMutationNodeEvent';
import { ICustomEvent } from '@/app/shared/event';

export class InsertAfterEvent extends AbstractMutationNodeEvent implements ICustomEvent {
type = 'insert:after';
}
6 changes: 6 additions & 0 deletions src/app/core/events/mutation/InsertBeforeEvent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { ICustomEvent } from '@/app/shared/event';
import { AbstractMutationNodeEvent } from './AbstractMutationNodeEvent';

export class InsertBeforeEvent extends AbstractMutationNodeEvent implements ICustomEvent {
type = 'insert:before';
}
6 changes: 6 additions & 0 deletions src/app/core/events/mutation/InsertChildrenEvent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { ICustomEvent } from '@/app/shared/event';
import { AbstractMutationNodeEvent } from './AbstractMutationNodeEvent';

export class InsertChildrenEvent extends AbstractMutationNodeEvent implements ICustomEvent {
type = 'insert:children';
}
6 changes: 6 additions & 0 deletions src/app/core/events/mutation/PrependNodeEvent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { ICustomEvent } from '@/app/shared/event';
import { AbstractMutationNodeEvent } from './AbstractMutationNodeEvent';

export class PrependNodeEvent extends AbstractMutationNodeEvent implements ICustomEvent {
type = 'prepend:node';
}
6 changes: 6 additions & 0 deletions src/app/core/events/mutation/RemoveNodeEvent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { ICustomEvent } from '@/app/shared/event';
import { AbstractMutationNodeEvent } from './AbstractMutationNodeEvent';

export class RemoveNodeEvent extends AbstractMutationNodeEvent implements ICustomEvent {
type = 'remove:node';
}
6 changes: 6 additions & 0 deletions src/app/core/events/mutation/UpdateChildrenEvent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { ICustomEvent } from '@/app/shared/event';
import { AbstractMutationNodeEvent } from './AbstractMutationNodeEvent';

export class UpdateChildrenEvent extends AbstractMutationNodeEvent implements ICustomEvent {
type = 'update:children';
}
6 changes: 6 additions & 0 deletions src/app/core/events/mutation/UpdateNodePropsEvent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { AbstractMutationNodeEvent } from './AbstractMutationNodeEvent';
import { ICustomEvent } from '@/app/shared/event';

export class UpdateNodePropsEvent extends AbstractMutationNodeEvent implements ICustomEvent {
type = 'update:node:props';
}
6 changes: 6 additions & 0 deletions src/app/core/events/mutation/WrapNodeEvent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { AbstractMutationNodeEvent } from './AbstractMutationNodeEvent';
import { ICustomEvent } from '@/app/shared/event';

export class WrapNodeEvent extends AbstractMutationNodeEvent implements ICustomEvent {
type = 'wrap:node';
}
11 changes: 11 additions & 0 deletions src/app/core/events/mutation/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
export * from './DragNodeEvent';
export * from './UpdateNodePropsEvent';
export * from './PrependNodeEvent';
export * from './AppendNodeEvent';
export * from './WrapNodeEvent';
export * from './InsertAfterEvent';
export * from './InsertBeforeEvent';
export * from './InsertChildrenEvent';
export * from './UpdateChildrenEvent';
export * from './RemoveNodeEvent';
export * from './CloneNodeEvent';
export * from './FromNodeEvent';
Loading

0 comments on commit 3709e36

Please sign in to comment.