save & save all

This commit is contained in:
zhandouxiaojiji committed 2020-11-04 10:32:39 +08:00
1 parent 3392630e6b
commit c4eb53ac68
5 files changed
+66 -5

No files matched your search

+18
View File
@@ -59,6 +59,24 @@ export const createTreeData = (bNode: BehaviorNodeModel, settings: Settings) =>
return treeData;
}
export const createFileData = (gNode: GraphNodeModel) => {
const nodeData: BehaviorNodeModel = {
id: Number(gNode.id),
name: gNode.name,
desc: gNode.desc || undefined,
args: gNode.args || undefined,
input: gNode.input || undefined,
output: gNode.output || undefined,
}
if (gNode.children) {
nodeData.children = [];
gNode.children.forEach(child => {
nodeData.children.push(createFileData(child));
})
}
return nodeData;
}
export const findParent = (node: TreeGraphData, id: string): TreeGraphData | null => {
if (node.children) {
for (let child of node.children) {