From 039c62b09b37cdda35d33c6ee9adecad62dee75c Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Mon, 29 Dec 2025 15:31:33 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=89=B9=E9=87=8F=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=8C=E6=94=AF=E6=8C=81=E6=99=AE=E9=80=9A?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=E5=92=8C=E5=BC=BA=E5=88=B6=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E8=BF=90=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/locales/langs/en-US/certd.ts | 1 + .../src/locales/langs/zh-CN/certd.ts | 1 + .../src/views/certd/pipeline/api.ts | 4 +- .../certd/pipeline/components/batch-rerun.vue | 86 +++++++++++++++++++ .../src/views/certd/pipeline/index.vue | 17 +--- .../user/pipeline/pipeline-controller.ts | 4 +- .../pipeline/service/pipeline-service.ts | 22 ++--- 7 files changed, 106 insertions(+), 29 deletions(-) create mode 100644 packages/ui/certd-client/src/views/certd/pipeline/components/batch-rerun.vue diff --git a/packages/ui/certd-client/src/locales/langs/en-US/certd.ts b/packages/ui/certd-client/src/locales/langs/en-US/certd.ts index 6823f0e1e..50b5112b2 100644 --- a/packages/ui/certd-client/src/locales/langs/en-US/certd.ts +++ b/packages/ui/certd-client/src/locales/langs/en-US/certd.ts @@ -159,6 +159,7 @@ export default { selectedCount: "Selected {count} items", batchDelete: "Batch Delete", batchForceRerun: "Force Rerun", + batchRerun: "Rerun", applyCertificate: "Apply for Certificate", pipelineExecutionRecords: "Pipeline Execution Records", confirm: "Confirm", diff --git a/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts b/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts index 62528178c..53cf254df 100644 --- a/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts +++ b/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts @@ -165,6 +165,7 @@ export default { selectedCount: "已选择 {count} 项", batchDelete: "批量删除", batchForceRerun: "强制重新运行", + batchRerun: "重新运行", applyCertificate: "申请证书", pipelineExecutionRecords: "流水线执行记录", confirm: "确认", 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 1d2d7f669..babc39ec2 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/api.ts +++ b/packages/ui/certd-client/src/views/certd/pipeline/api.ts @@ -117,11 +117,11 @@ export async function BatchDelete(pipelineIds: number[]): Promise { data: { ids: pipelineIds }, }); } -export async function BatchRerun(pipelineIds: number[]): Promise { +export async function BatchRerun(pipelineIds: number[], force: boolean): Promise { return await request({ url: apiPrefix + "/batchRerun", method: "post", - data: { ids: pipelineIds }, + data: { ids: pipelineIds, force }, }); } diff --git a/packages/ui/certd-client/src/views/certd/pipeline/components/batch-rerun.vue b/packages/ui/certd-client/src/views/certd/pipeline/components/batch-rerun.vue new file mode 100644 index 000000000..32ee21e11 --- /dev/null +++ b/packages/ui/certd-client/src/views/certd/pipeline/components/batch-rerun.vue @@ -0,0 +1,86 @@ + + + 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 927180507..c916650cf 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/index.vue +++ b/packages/ui/certd-client/src/views/certd/pipeline/index.vue @@ -8,7 +8,7 @@
{{ t("certd.selectedCount", { count: selectedRowKeys.length }) }} - + @@ -28,6 +28,7 @@ import { dict, useFs } from "@fast-crud/fast-crud"; import createCrudOptions from "./crud"; import ChangeGroup from "./components/change-group.vue"; import ChangeTrigger from "./components/change-trigger.vue"; +import BatchRerun from "./components/batch-rerun.vue"; import { Modal, notification } from "ant-design-vue"; import * as api from "./api"; import { useI18n } from "/src/locales"; @@ -75,20 +76,6 @@ function batchDelete() { }, }); } - -function batchRerun() { - settingStore.checkPlus(); - Modal.confirm({ - title: "确认强制重新运行吗", - content: "确定要强制重新运行选中流水线吗?(20条一批执行)", - async onOk() { - await api.BatchRerun(selectedRowKeys.value); - notification.success({ message: "任务已提交" }); - await crudExpose.doRefresh(); - selectedRowKeys.value = []; - }, - }); -}