From 818998259ddc75e722196ac5c365038818539b9b Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Tue, 27 May 2025 11:08:08 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=94=AF=E6=8C=81=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E9=87=8D=E6=96=B0=E8=BF=90=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/pipeline/src/core/executor.ts | 8 ++++ .../src/views/certd/pipeline/api.ts | 11 ++++- .../src/views/certd/pipeline/index.vue | 14 ++++++ .../user/pipeline/pipeline-controller.ts | 6 +++ .../pipeline/service/pipeline-service.ts | 44 ++++++++++++++++++- 5 files changed, 80 insertions(+), 3 deletions(-) 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 = []; + }, + }); +}