|
|
@@ -29,6 +29,7 @@ import variableAggregatorImg from '@/assets/images/workflow/icon-switch.png'
|
|
|
import variableAggregatorNodeDefault from '@/views/workflow/instance/variable-aggregator/default'
|
|
|
|
|
|
import { defineAsyncComponent } from 'vue'
|
|
|
+import { useWorkflowStore } from '@/stores'
|
|
|
|
|
|
export const lineStyle = {
|
|
|
stroke: '#bcbcbc',
|
|
|
@@ -203,8 +204,19 @@ export const nodeSources = {
|
|
|
},
|
|
|
}
|
|
|
export const getNodeDefault = (type: NodeType) => {
|
|
|
+ const WorkflowStore = useWorkflowStore()
|
|
|
+ const StartNode = WorkflowStore.graph
|
|
|
+ .getRootNodes()
|
|
|
+ .filter((v) => v.data.workflowData.type === NodeType.Start)[0]
|
|
|
const node = nodeSources[type].defaultValue()
|
|
|
node.id = node.data.id
|
|
|
node.data.type = type
|
|
|
+ if (StartNode) {
|
|
|
+ if (StartNode.data.workflowData[`__${type}Index`]) {
|
|
|
+ node.data.title += ++StartNode.data.workflowData[`__${type}Index`]
|
|
|
+ } else {
|
|
|
+ StartNode.data.workflowData[`__${type}Index`] = 1
|
|
|
+ }
|
|
|
+ }
|
|
|
return node
|
|
|
}
|