fix: 修复执行结果列表依赖结果表查询

This commit is contained in:
2026-08-22 09:15:05 +08:00
parent 670fe61033
commit c7091e3702
5 changed files with 125 additions and 111 deletions
+29 -7
View File
@@ -359,13 +359,7 @@ func injectSubFlowFields(global *flowDto.FlowExecutionInput, subFlowContent *ent
}
value := field["value"]
if vs, has := field["valueSource"]; has && vs != nil {
vsMap := gconv.Map(vs)
vsNodeId := gconv.String(vsMap["nodeId"])
vsField := gconv.String(vsMap["fieldName"])
if vsField == "" {
vsField = gconv.String(vsMap["field"])
}
if vsNodeId != "" && vsField != "" {
if vsNodeId, vsField := firstValueSource(vs); vsNodeId != "" && vsField != "" {
if v, _, ok := resolveValueSource(global, vsNodeId, vsField); ok {
value = v
}
@@ -380,6 +374,34 @@ func injectSubFlowFields(global *flowDto.FlowExecutionInput, subFlowContent *ent
}
}
// firstValueSource 从 valueSource 提取第一个引用源 (nodeId, field)。
// 前端统一发送数组 [{nodeId, field}](见 serializeSubFlowConfig),旧 DSL 可能是单对象
// {nodeId, fieldName},两种形态都兼容;子流程字段与引用源一一对应,只取第一个。
func firstValueSource(vs any) (nodeId, field string) {
if vs == nil {
return
}
switch v := vs.(type) {
case []any:
if len(v) > 0 {
return firstValueSource(v[0])
}
return
case []map[string]any:
if len(v) > 0 {
return firstValueSource(v[0])
}
return
}
m := gconv.Map(vs)
nodeId = gconv.String(m["nodeId"])
field = gconv.String(m["fieldName"])
if field == "" {
field = gconv.String(m["field"])
}
return
}
// subFlowStartNode 返回工作流开始节点
func subFlowStartNode(content *entity.FlowInfo) *entity.FlowNode {
if content == nil {