From 7318fda0614b500113bb0c23e940344715f4c4da Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Fri, 10 Oct 2025 14:37:35 +0800 Subject: [PATCH] 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) --- ui/src/workflow/common/shortcut.ts | 3 ++- ui/src/workflow/nodes/search-knowledge-node/index.vue | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/src/workflow/common/shortcut.ts b/ui/src/workflow/common/shortcut.ts index 66babfc17..874a825c9 100644 --- a/ui/src/workflow/common/shortcut.ts +++ b/ui/src/workflow/common/shortcut.ts @@ -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')) diff --git a/ui/src/workflow/nodes/search-knowledge-node/index.vue b/ui/src/workflow/nodes/search-knowledge-node/index.vue index 39c21c1ef..81d7aef5a 100644 --- a/ui/src/workflow/nodes/search-knowledge-node/index.vue +++ b/ui/src/workflow/nodes/search-knowledge-node/index.vue @@ -196,6 +196,7 @@ function addKnowledge(val: Array) { 'knowledge_id_list', val.map((item) => item.id), ) + set(props.nodeModel.properties.node_data, 'knowledge_list', val) knowledgeList.value = val }