diff --git a/packages/core/pipeline/src/core/executor.ts b/packages/core/pipeline/src/core/executor.ts index 7c01dd48..c99474e7 100644 --- a/packages/core/pipeline/src/core/executor.ts +++ b/packages/core/pipeline/src/core/executor.ts @@ -489,7 +489,15 @@ export class Executor { } } + /** + * + * @param stepId 如果==ALL 清除所有 + */ clearLastStatus(stepId: string) { + if (stepId === "ALL") { + this.lastStatusMap.clear(); + return; + } this.lastStatusMap.clearById(stepId); } } diff --git a/packages/ui/certd-client/src/views/certd/pipeline/api.ts b/packages/ui/certd-client/src/views/certd/pipeline/api.ts index fd6b2753..daeb6bb1 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/api.ts +++ b/packages/ui/certd-client/src/views/certd/pipeline/api.ts @@ -76,7 +76,7 @@ export async function Cancel(historyId: any) { }); } -export async function BatchUpdateGroup(pipelineIds: number[], groupId: number): Promise { +export async function BatchUpdateGroup(pipelineIds: number[], groupId: number): Promise { return await request({ url: apiPrefix + "/batchUpdateGroup", method: "post", @@ -84,13 +84,20 @@ export async function BatchUpdateGroup(pipelineIds: number[], groupId: number): }); } -export async function BatchDelete(pipelineIds: number[]): Promise { +export async function BatchDelete(pipelineIds: number[]): Promise { return await request({ url: apiPrefix + "/batchDelete", method: "post", data: { ids: pipelineIds }, }); } +export async function BatchRerun(pipelineIds: number[]): Promise { + return await request({ + url: apiPrefix + "/batchRerun", + method: "post", + data: { ids: pipelineIds }, + }); +} export async function GetFiles(pipelineId: number) { return await request({ diff --git a/packages/ui/certd-client/src/views/certd/pipeline/index.vue b/packages/ui/certd-client/src/views/certd/pipeline/index.vue index e1cc401a..f4e76516 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/index.vue +++ b/packages/ui/certd-client/src/views/certd/pipeline/index.vue @@ -9,6 +9,7 @@ 已选择 {{ selectedRowKeys.length }} 项 + @@ -70,6 +71,19 @@ function batchDelete() { }, }); } + +function batchRerun() { + Modal.confirm({ + title: "确认强制重新运行吗", + content: "确定要强制重新运行选中流水线吗?(20条一批执行)", + async onOk() { + await api.BatchRerun(selectedRowKeys.value); + notification.success({ message: "任务已提交" }); + await crudExpose.doRefresh(); + selectedRowKeys.value = []; + }, + }); +}