diff --git a/packages/ui/certd-client/src/components/plugins/common/output-selector/index.vue b/packages/ui/certd-client/src/components/plugins/common/output-selector/index.vue index 76f770c3..0dacf480 100644 --- a/packages/ui/certd-client/src/components/plugins/common/output-selector/index.vue +++ b/packages/ui/certd-client/src/components/plugins/common/output-selector/index.vue @@ -23,6 +23,7 @@ export default { const pipeline = inject("pipeline") as Ref; const currentStageIndex = inject("currentStageIndex") as Ref; + const currentTaskIndex = inject("currentTaskIndex") as Ref; const currentStepIndex = inject("currentStepIndex") as Ref; const currentTask = inject("currentTask") as Ref; @@ -32,6 +33,7 @@ export default { options.value = pluginGroups.getPreStepOutputOptions({ pipeline: pipeline.value, currentStageIndex: currentStageIndex.value, + currentTaskIndex: currentTaskIndex.value, currentStepIndex: currentStepIndex.value, currentTask: currentTask.value }); diff --git a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/index.vue b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/index.vue index 3882c74a..585e769b 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/index.vue +++ b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/index.vue @@ -134,7 +134,7 @@ - 并行任务 + 添加任务 diff --git a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/type.ts b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/type.ts index 15db554d..f17c3167 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/type.ts +++ b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/type.ts @@ -75,10 +75,11 @@ export class PluginGroups { return this.map[name]; } - getPreStepOutputOptions({ pipeline, currentStageIndex, currentStepIndex, currentTask }: any) { + getPreStepOutputOptions({ pipeline, currentStageIndex, currentTaskIndex, currentStepIndex, currentTask }: any) { const steps = this.collectionPreStepOutputs({ pipeline, currentStageIndex, + currentTaskIndex, currentStepIndex, currentTask }); @@ -96,7 +97,7 @@ export class PluginGroups { return options; } - collectionPreStepOutputs({ pipeline, currentStageIndex, currentStepIndex, currentTask }: any) { + collectionPreStepOutputs({ pipeline, currentStageIndex, currentTaskIndex, currentStepIndex, currentTask }: any) { const steps: any[] = []; // 开始放step for (let i = 0; i < currentStageIndex; i++) { @@ -107,6 +108,14 @@ export class PluginGroups { } } } + //当前阶段之前的task + const currentStage = pipeline.stages[currentStageIndex]; + for (let i = 0; i < currentTaskIndex; i++) { + const task = currentStage.tasks[i]; + for (const step of task.steps) { + steps.push(step); + } + } //放当前任务下的step for (let i = 0; i < currentStepIndex; i++) { const step = currentTask.steps[i];