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)
parent
3a267ac074
commit
7318fda061
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { cloneDeep } from 'lodash'
|
||||||
import type LogicFlow from '@logicflow/core'
|
import type LogicFlow from '@logicflow/core'
|
||||||
import { type GraphModel } from '@logicflow/core'
|
import { type GraphModel } from '@logicflow/core'
|
||||||
import { MsgSuccess, MsgError, MsgConfirm } from '@/utils/message'
|
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'))
|
MsgError(base_nodes[0]?.properties?.stepName + t('views.applicationWorkflow.tip.cannotCopy'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
selected = elements
|
selected = cloneDeep(elements)
|
||||||
selected.nodes.forEach((node: any) => translationNodeData(node, TRANSLATION_DISTANCE))
|
selected.nodes.forEach((node: any) => translationNodeData(node, TRANSLATION_DISTANCE))
|
||||||
selected.edges.forEach((edge: any) => translationEdgeData(edge, TRANSLATION_DISTANCE))
|
selected.edges.forEach((edge: any) => translationEdgeData(edge, TRANSLATION_DISTANCE))
|
||||||
MsgSuccess(t('views.applicationWorkflow.tip.copyError'))
|
MsgSuccess(t('views.applicationWorkflow.tip.copyError'))
|
||||||
|
|
|
||||||
|
|
@ -196,6 +196,7 @@ function addKnowledge(val: Array<any>) {
|
||||||
'knowledge_id_list',
|
'knowledge_id_list',
|
||||||
val.map((item) => item.id),
|
val.map((item) => item.id),
|
||||||
)
|
)
|
||||||
|
set(props.nodeModel.properties.node_data, 'knowledge_list', val)
|
||||||
knowledgeList.value = val
|
knowledgeList.value = val
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue