bugfix: workflow bugfix

This commit is contained in:
zhaoying
2026-01-10 17:44:06 +08:00
parent 177d514d13
commit 24ace52e27
15 changed files with 242 additions and 176 deletions

View File

@@ -63,7 +63,17 @@ export const useWorkflowGraph = ({
if (!id) return
getWorkflowConfig(id)
.then(res => {
setConfig(res as WorkflowConfig)
const { variables, ...rest } = res as WorkflowConfig
setConfig({
...rest,
variables: variables.map(v => {
const { default: _, ...cleanV } = v
return {
...cleanV,
defaultValue: v.default ?? ''
}
})
})
})
}
@@ -332,6 +342,7 @@ export const useWorkflowGraph = ({
},
},
},
zIndex: 0
}
return edgeConfig
@@ -906,6 +917,13 @@ export const useWorkflowGraph = ({
const params = {
...config,
variables: config.variables.map(v => {
const { defaultValue, ...cleanV } = v
return {
...cleanV,
default: defaultValue ?? ''
}
}),
nodes: nodes.map((node: Node) => {
const data = node.getData();
const position = node.getPosition();