From 885bb4c136db47479509f7c1f3aef0868a6d46d8 Mon Sep 17 00:00:00 2001 From: tangjiawei Date: Tue, 10 Dec 2024 16:31:41 +0800 Subject: [PATCH] =?UTF-8?q?#2469=20=E7=A9=BA=E7=BB=93=E7=82=B9=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=AF=95=E7=AE=97,=E6=8C=89=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E9=A1=BA=E5=BA=8F=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platform-core/api/v1/process/manage.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/platform-core/api/v1/process/manage.go b/platform-core/api/v1/process/manage.go index 35b2b74c5a..81eac2dbe5 100644 --- a/platform-core/api/v1/process/manage.go +++ b/platform-core/api/v1/process/manage.go @@ -1753,10 +1753,16 @@ func QueryEmptyNodes(c *gin.Context) { middleware.ReturnError(c, err) return } + sort.Sort(models.ProcDefSortNodes(procDefNodes)) + orderIndex := 1 for _, node := range procDefNodes { + if node.NodeType == string(models.ProcDefNodeTypeHuman) || node.NodeType == string(models.ProcDefNodeTypeAutomatic) || node.NodeType == string(models.ProcDefNodeTypeData) || node.NodeType == models.JobSubProcType { + node.OrderedNo = orderIndex + orderIndex += 1 + } if node.NodeType == string(models.ProcDefNodeTypeAutomatic) || node.NodeType == string(models.ProcDefNodeSubProcess) || node.NodeType == string(models.ProcDefNodeTypeData) { if !tools.Contains(nodeIds, node.Id) { - result = append(result, node.Name) + result = append(result, fmt.Sprintf("%d %s", node.OrderedNo, node.Name)) } } }