From 2fc4a393ad9549eb70559630632969e99e64d628 Mon Sep 17 00:00:00 2001 From: zhangzhanwei Date: Mon, 27 Oct 2025 13:43:40 +0800 Subject: [PATCH] feat: Group field dialog --- .../i_variable_aggregation_node.py | 3 +- .../impl/base_variable_aggregation_node.py | 2 +- .../component/GroupFieldDialog.vue | 118 +++++++++++++++ .../nodes/variable-aggregation-node/index.vue | 137 ++++++++---------- 4 files changed, 179 insertions(+), 81 deletions(-) create mode 100644 ui/src/workflow/nodes/variable-aggregation-node/component/GroupFieldDialog.vue diff --git a/apps/application/flow/step_node/variable_aggregation_node/i_variable_aggregation_node.py b/apps/application/flow/step_node/variable_aggregation_node/i_variable_aggregation_node.py index f91030036..d5a2f332a 100644 --- a/apps/application/flow/step_node/variable_aggregation_node/i_variable_aggregation_node.py +++ b/apps/application/flow/step_node/variable_aggregation_node/i_variable_aggregation_node.py @@ -17,7 +17,8 @@ class VariableListSerializer(serializers.Serializer): class VariableGroupSerializer(serializers.Serializer): id = serializers.CharField(required=True, label=_("Group id")) - group_name = serializers.CharField(required=True, label=_("group_name")) + field = serializers.CharField(required=True, label=_("group_name")) + label = serializers.CharField(required=True) variable_list = VariableListSerializer(many=True) diff --git a/apps/application/flow/step_node/variable_aggregation_node/impl/base_variable_aggregation_node.py b/apps/application/flow/step_node/variable_aggregation_node/impl/base_variable_aggregation_node.py index f5665ce06..700f76dc3 100644 --- a/apps/application/flow/step_node/variable_aggregation_node/impl/base_variable_aggregation_node.py +++ b/apps/application/flow/step_node/variable_aggregation_node/impl/base_variable_aggregation_node.py @@ -38,7 +38,7 @@ class BaseVariableAggregationNode(IVariableAggregation): 'variable_to_json': self.set_variable_to_json, } - result = { item.get('group_name'):strategy_map[strategy](item.get('variable_list')) for item in group_list} + result = { item.get('field'):strategy_map[strategy](item.get('variable_list')) for item in group_list} return NodeResult({'result': result,**result},{}) diff --git a/ui/src/workflow/nodes/variable-aggregation-node/component/GroupFieldDialog.vue b/ui/src/workflow/nodes/variable-aggregation-node/component/GroupFieldDialog.vue new file mode 100644 index 000000000..98f3f2fdf --- /dev/null +++ b/ui/src/workflow/nodes/variable-aggregation-node/component/GroupFieldDialog.vue @@ -0,0 +1,118 @@ + + + diff --git a/ui/src/workflow/nodes/variable-aggregation-node/index.vue b/ui/src/workflow/nodes/variable-aggregation-node/index.vue index f36b7d8db..7cf259a6a 100644 --- a/ui/src/workflow/nodes/variable-aggregation-node/index.vue +++ b/ui/src/workflow/nodes/variable-aggregation-node/index.vue @@ -39,11 +39,11 @@ /> -
+
- - - {{ group_list.group_name }} + --> + {{ group.field }}
- + @@ -70,7 +70,7 @@
-
+
@@ -112,36 +112,37 @@
- + {{ $t('views.applicationWorkflow.nodes.variableAggregationNode.add') }} +