From c5e58770d1c5edc19c6f9ea1618f44b68e091f35 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Thu, 10 Oct 2024 13:28:41 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=B9=B6=E8=A1=8C=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E6=94=B9=E6=88=90=E6=B7=BB=E5=8A=A0=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=EF=BC=8C=E5=8F=96=E6=B6=88=E5=B9=B6=E8=A1=8C=EF=BC=8C?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E5=9C=A8=E5=90=8C=E4=B8=80=E4=B8=AA=E9=98=B6?= =?UTF-8?q?=E6=AE=B5=E8=8E=B7=E5=8F=96=E4=B8=8A=E4=B8=80=E4=B8=AAtask?= =?UTF-8?q?=E7=9A=84=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/common/output-selector/index.vue | 2 ++ .../src/views/certd/pipeline/pipeline/index.vue | 2 +- .../src/views/certd/pipeline/pipeline/type.ts | 13 +++++++++++-- 3 files changed, 14 insertions(+), 3 deletions(-) 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 76f770c37..0dacf4807 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 3882c74ac..585e769b9 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 15db554d4..f17c3167f 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];