Skip to content

Commit fb8d69e

Browse files
shaohuzhang1liuruibin
authored andcommitted
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)
1 parent e158422 commit fb8d69e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

ui/src/workflow/common/shortcut.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { cloneDeep } from 'lodash'
12
import type LogicFlow from '@logicflow/core'
23
import { type GraphModel } from '@logicflow/core'
34
import { MsgSuccess, MsgError, MsgConfirm } from '@/utils/message'
@@ -63,7 +64,7 @@ export function initDefaultShortcut(lf: LogicFlow, graph: GraphModel) {
6364
MsgError(base_nodes[0]?.properties?.stepName + t('views.applicationWorkflow.tip.cannotCopy'))
6465
return
6566
}
66-
selected = elements
67+
selected = cloneDeep(elements)
6768
selected.nodes.forEach((node: any) => translationNodeData(node, TRANSLATION_DISTANCE))
6869
selected.edges.forEach((edge: any) => translationEdgeData(edge, TRANSLATION_DISTANCE))
6970
MsgSuccess(t('views.applicationWorkflow.tip.copyError'))

ui/src/workflow/nodes/search-knowledge-node/index.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ function addKnowledge(val: Array<any>) {
196196
'knowledge_id_list',
197197
val.map((item) => item.id),
198198
)
199+
set(props.nodeModel.properties.node_data, 'knowledge_list', val)
199200
knowledgeList.value = val
200201
}
201202

0 commit comments

Comments
 (0)