diff --git a/src/app/core/drivers/drag-drop-driver.ts b/src/app/core/drivers/drag-drop-driver.ts new file mode 100644 index 0000000..a8ce06b --- /dev/null +++ b/src/app/core/drivers/drag-drop-driver.ts @@ -0,0 +1,8 @@ +import { EventDriver } from '../../shared/event'; +import { Engine } from '../models'; + +export class DragDropDriver extends EventDriver { + mouseDownTimer = null; + + startEvent: MouseEvent; +} diff --git a/src/app/core/externals.ts b/src/app/core/externals.ts index 98a2c17..8e7fbf7 100644 --- a/src/app/core/externals.ts +++ b/src/app/core/externals.ts @@ -26,5 +26,5 @@ export const isBehaviorHost = (val: any): val is IBehaviorHost => val?.Behavior export const isBehaviorList = (val: any): val is IBehavior[] => Array.isArray(val) && val.every(isBehavior); export const createDesigner = () => { - return new Engine(); + // return new Engine(); }; diff --git a/src/app/core/models/engine.ts b/src/app/core/models/engine.ts index 5bd8221..7e8e3ee 100644 --- a/src/app/core/models/engine.ts +++ b/src/app/core/models/engine.ts @@ -6,6 +6,9 @@ import { uid } from '@/app/shared/uid'; import { TreeNode } from '@/app/core/models/tree-node'; import { Event } from '@/app/shared/event'; +/** + * 设计器引擎 + */ export class Engine extends Event { id: string; @@ -36,6 +39,10 @@ export class Engine extends Event { // this.keyboard = new Keyboard(this) } + findNodeById(id: string) { + return TreeNode.findById(id); + } + findMovingNodes(): TreeNode[] { const results = []; this.workbench.eachWorkspace(workspace => {