fix: 修复工作流多路召回节点检索问题下拉框中有多个重复节点

This commit is contained in:
shaohuzhang1 2024-10-25 18:27:45 +08:00 committed by shaohuzhang1
parent 8b71e031d3
commit cfbec5c44c

View File

@ -59,18 +59,20 @@ function _getIncomingNode(id: String, startId: String, value: Array<any>) {
if (list.length > 0) { if (list.length > 0) {
list.forEach((item: any) => { list.forEach((item: any) => {
if (!value.some((obj: any) => obj.id === item.id)) { if (!value.some((obj: any) => obj.id === item.id)) {
value.unshift({ if (!value.some((value_item) => value_item.value === item.id)) {
value: item.id, value.unshift({
label: item.properties.stepName, value: item.id,
type: item.type, label: item.properties.stepName,
children: item.properties?.config?.fields || [] type: item.type,
}) children: item.properties?.config?.fields || []
if (item.properties?.globalFields && item.type === 'start-node') { })
firstElement = { if (item.properties?.globalFields && item.type === 'start-node') {
value: 'global', firstElement = {
label: '全局变量', value: 'global',
type: 'global', label: '全局变量',
children: item.properties?.config?.globalFields || [] type: 'global',
children: item.properties?.config?.globalFields || []
}
} }
} }
} }