feat(web): Workflow

This commit is contained in:
zhaoying
2025-12-22 11:33:08 +08:00
parent 281aec23e3
commit ad0a7ebcb9

View File

@@ -75,7 +75,7 @@ export const useWorkflowGraph = ({
if (nodes.length) {
const nodeList = nodes.map(node => {
const { id, type, name, position, config } = node
const { id, type, name, position, config = {} } = node
let nodeLibraryConfig = [...nodeLibrary]
.flatMap(category => category.nodes)
.find(n => n.type === type)
@@ -84,7 +84,7 @@ export const useWorkflowGraph = ({
if (nodeLibraryConfig?.config) {
Object.keys(nodeLibraryConfig.config).forEach(key => {
if (nodeLibraryConfig.config && nodeLibraryConfig.config[key]) {
nodeLibraryConfig.config[key].defaultValue = config[key]
nodeLibraryConfig.config[key].defaultValue = config[key] || {}
}
})
}