update batch example
This commit is contained in:
1 parent
32d994d732
commit
b4021e487c
1 file changed
+31
-1
+31
-1
@@ -2,6 +2,32 @@
|
||||
/*
|
||||
如果有processTree,则先运行prcessTree,如果有返回,则进行后面的针对每个节点运行processNode
|
||||
如果没有定义processTree,则直接针对每个节点运行processNode
|
||||
|
||||
export interface TreeModel {
|
||||
name: string;
|
||||
desc?: string;
|
||||
export?: boolean;
|
||||
root: NodeModel;
|
||||
}
|
||||
|
||||
export interface NodeModel {
|
||||
id: number;
|
||||
name: string;
|
||||
desc?: string;
|
||||
args?: { [key: string]: any };
|
||||
input?: string[];
|
||||
output?: string[];
|
||||
children?: NodeModel[];
|
||||
debug?: boolean;
|
||||
disabled?: boolean;
|
||||
path?: string;
|
||||
}
|
||||
|
||||
interface BatchScript {
|
||||
processTree?(tree: TreeModel, path: string): TreeModel;
|
||||
|
||||
processNode?(node: NodeModel, tree: TreeModel): NodeModel;
|
||||
}
|
||||
*/
|
||||
({
|
||||
processTree: (tree) => {
|
||||
@@ -12,5 +38,9 @@
|
||||
},
|
||||
processNode: (node, tree) => {
|
||||
console.log(`processNode ${tree.name}.${node.id}`);
|
||||
if (node.name == "GetPos") {
|
||||
return null;
|
||||
}
|
||||
})
|
||||
return node;
|
||||
},
|
||||
});
|
||||
Reference in new issue
Block a user