|
@@ -43,7 +43,7 @@ func ParseFlowFromJson(flowName, flowType, frontJson, argObj string) (string, er
|
|
|
})
|
|
|
root.Children.NodeLevel = 1
|
|
|
root.Children.NamePrefix = "1-"
|
|
|
- err = traverseTree(flow, root.Children, nil)
|
|
|
+ err = traverseTree(flow, root.Children)
|
|
|
if err != nil {
|
|
|
return "", err
|
|
|
}
|
|
@@ -56,7 +56,7 @@ func ParseFlowFromJson(flowName, flowType, frontJson, argObj string) (string, er
|
|
|
return tmpStr, nil
|
|
|
}
|
|
|
|
|
|
-func traverseTree(flow *Flow, node *Node, parentNode *Node) error {
|
|
|
+func traverseTree(flow *Flow, node *Node) error {
|
|
|
if node == nil {
|
|
|
return nil
|
|
|
}
|
|
@@ -65,7 +65,7 @@ func traverseTree(flow *Flow, node *Node, parentNode *Node) error {
|
|
|
// 生成模板逻辑
|
|
|
switch node.Type {
|
|
|
case NodeTypeApproval:
|
|
|
- err := buildApprovalFlow(flow, node, parentNode)
|
|
|
+ err := buildApprovalFlow(flow, node)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
@@ -77,7 +77,7 @@ func traverseTree(flow *Flow, node *Node, parentNode *Node) error {
|
|
|
for index, branch := range node.Branchs {
|
|
|
branch.Children.NodeLevel = node.NodeLevel + 1
|
|
|
branch.Children.NamePrefix = fmt.Sprintf("%d-%d-", branch.Children.NodeLevel, index)
|
|
|
- err := traverseTree(flow, branch.Children, node)
|
|
|
+ err := traverseTree(flow, branch.Children)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
@@ -87,7 +87,7 @@ func traverseTree(flow *Flow, node *Node, parentNode *Node) error {
|
|
|
if node.Children != nil {
|
|
|
node.Children.NodeLevel = node.NodeLevel + 1
|
|
|
node.Children.NamePrefix = fmt.Sprintf("%d-", node.Children.NodeLevel)
|
|
|
- err := traverseTree(flow, node.Children, node)
|
|
|
+ err := traverseTree(flow, node.Children)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
@@ -96,7 +96,7 @@ func traverseTree(flow *Flow, node *Node, parentNode *Node) error {
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
-func buildApprovalFlow(flow *Flow, node *Node, parentNode *Node) error {
|
|
|
+func buildApprovalFlow(flow *Flow, node *Node) error {
|
|
|
if node == nil {
|
|
|
return nil
|
|
|
}
|