perf: 并行任务名称改成添加任务,取消并行,可以在同一个阶段获取上一个task的输出

pull/213/head
xiaojunnuo 2024-10-10 13:28:41 +08:00
parent 77cc3c4a5c
commit c5e58770d1
3 changed files with 14 additions and 3 deletions

View File

@ -23,6 +23,7 @@ export default {
const pipeline = inject("pipeline") as Ref<any>; const pipeline = inject("pipeline") as Ref<any>;
const currentStageIndex = inject("currentStageIndex") as Ref<number>; const currentStageIndex = inject("currentStageIndex") as Ref<number>;
const currentTaskIndex = inject("currentTaskIndex") as Ref<number>;
const currentStepIndex = inject("currentStepIndex") as Ref<number>; const currentStepIndex = inject("currentStepIndex") as Ref<number>;
const currentTask = inject("currentTask") as Ref<any>; const currentTask = inject("currentTask") as Ref<any>;
@ -32,6 +33,7 @@ export default {
options.value = pluginGroups.getPreStepOutputOptions({ options.value = pluginGroups.getPreStepOutputOptions({
pipeline: pipeline.value, pipeline: pipeline.value,
currentStageIndex: currentStageIndex.value, currentStageIndex: currentStageIndex.value,
currentTaskIndex: currentTaskIndex.value,
currentStepIndex: currentStepIndex.value, currentStepIndex: currentStepIndex.value,
currentTask: currentTask.value currentTask: currentTask.value
}); });

View File

@ -134,7 +134,7 @@
<a-tooltip> <a-tooltip>
<a-button type="dashed" shape="round" @click="taskAdd(stage, index)"> <a-button type="dashed" shape="round" @click="taskAdd(stage, index)">
<fs-icon class="font-20" icon="ion:add-circle-outline"></fs-icon> <fs-icon class="font-20" icon="ion:add-circle-outline"></fs-icon>
并行任务 添加任务
</a-button> </a-button>
</a-tooltip> </a-tooltip>
</div> </div>

View File

@ -75,10 +75,11 @@ export class PluginGroups {
return this.map[name]; return this.map[name];
} }
getPreStepOutputOptions({ pipeline, currentStageIndex, currentStepIndex, currentTask }: any) { getPreStepOutputOptions({ pipeline, currentStageIndex, currentTaskIndex, currentStepIndex, currentTask }: any) {
const steps = this.collectionPreStepOutputs({ const steps = this.collectionPreStepOutputs({
pipeline, pipeline,
currentStageIndex, currentStageIndex,
currentTaskIndex,
currentStepIndex, currentStepIndex,
currentTask currentTask
}); });
@ -96,7 +97,7 @@ export class PluginGroups {
return options; return options;
} }
collectionPreStepOutputs({ pipeline, currentStageIndex, currentStepIndex, currentTask }: any) { collectionPreStepOutputs({ pipeline, currentStageIndex, currentTaskIndex, currentStepIndex, currentTask }: any) {
const steps: any[] = []; const steps: any[] = [];
// 开始放step // 开始放step
for (let i = 0; i < currentStageIndex; i++) { 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 //放当前任务下的step
for (let i = 0; i < currentStepIndex; i++) { for (let i = 0; i < currentStepIndex; i++) {
const step = currentTask.steps[i]; const step = currentTask.steps[i];