fix: After selecting the knowledge base for the knowledge base retrieval node, copy the node, but the new node does not have the control for selecting the knowledge base (#4170)

This commit is contained in:
shaohuzhang1 2025-10-10 14:37:35 +08:00 committed by GitHub
parent 3a267ac074
commit 7318fda061
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -1,3 +1,4 @@
import { cloneDeep } from 'lodash'
import type LogicFlow from '@logicflow/core'
import { type GraphModel } from '@logicflow/core'
import { MsgSuccess, MsgError, MsgConfirm } from '@/utils/message'
@ -63,7 +64,7 @@ export function initDefaultShortcut(lf: LogicFlow, graph: GraphModel) {
MsgError(base_nodes[0]?.properties?.stepName + t('views.applicationWorkflow.tip.cannotCopy'))
return
}
selected = elements
selected = cloneDeep(elements)
selected.nodes.forEach((node: any) => translationNodeData(node, TRANSLATION_DISTANCE))
selected.edges.forEach((edge: any) => translationEdgeData(edge, TRANSLATION_DISTANCE))
MsgSuccess(t('views.applicationWorkflow.tip.copyError'))

View File

@ -196,6 +196,7 @@ function addKnowledge(val: Array<any>) {
'knowledge_id_list',
val.map((item) => item.id),
)
set(props.nodeModel.properties.node_data, 'knowledge_list', val)
knowledgeList.value = val
}