From 514c13735eaf0fca90a5edfb3f045513336a4ae5 Mon Sep 17 00:00:00 2001 From: xlsea Date: Fri, 21 Jun 2024 14:59:07 +0800 Subject: [PATCH] =?UTF-8?q?feat(sj=5Fmap=5Freduce):=20=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81=E4=BB=BB=E5=8A=A1=E6=89=B9=E6=AC=A1=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=8A=B6=E6=80=81=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflow/modules/common/detail-card.vue | 83 ++++++++++--------- src/typings/api.d.ts | 3 +- 2 files changed, 47 insertions(+), 39 deletions(-) diff --git a/src/components/workflow/modules/common/detail-card.vue b/src/components/workflow/modules/common/detail-card.vue index 5aec0c2..50034b7 100644 --- a/src/components/workflow/modules/common/detail-card.vue +++ b/src/components/workflow/modules/common/detail-card.vue @@ -2,22 +2,18 @@ import { nextTick, ref, useSlots, watch } from 'vue'; import type { DataTableColumn } from 'naive-ui'; import { NButton, NTag } from 'naive-ui'; +import { isNotNull, translateOptions } from '@/utils/common'; import { jobExecutorEnum, jobOperationReasonEnum, jobStatusEnum, taskBatchStatusEnum, - taskBatchStatusRecord + taskBatchStatusRecord, + taskStatusRecordOptions } from '@/constants/business'; import { useWorkflowStore } from '@/store/modules/workflow'; import { $t } from '@/locales'; -import { isNotNull } from '@/utils/common'; -import { - fetchGetJobBatchDetail, - fetchGetJobDetail, - fetchGetJobTaskList - // fetchWorkflowNodeRetry -} from '@/service/api'; +import { fetchGetJobBatchDetail, fetchGetJobDetail, fetchGetJobTaskList, fetchWorkflowNodeRetry } from '@/service/api'; defineOptions({ name: 'DetailCard' @@ -49,6 +45,7 @@ const logOpen = ref(false); const spinning = ref(false); const loading = ref(false); const currentIndex = ref(1); +const taskStatusSearch = ref(); const jobData = ref({}); const dataSource = ref([]); @@ -110,6 +107,7 @@ async function getRows(id: string, page: number = 1) { const { data, error } = await fetchGetJobTaskList({ groupName: store.groupName!, taskBatchId: id ?? '0', + taskStatus: taskStatusSearch.value, page, size: pagination.value.pageSize }); @@ -120,6 +118,11 @@ async function getRows(id: string, page: number = 1) { } } +async function flushed(id: string) { + taskStatusSearch.value = null; + await getRows(id); +} + const idList = ref([]); function onLoad() { @@ -144,16 +147,16 @@ const getLogRows = (task: Workflow.JobTaskType) => { logOpen.value = true; }; -// const retry = async (item: Workflow.JobTaskType) => { -// const { error } = await fetchWorkflowNodeRetry(store.id!, item.workflowNodeId!); -// if (!error) { -// window.$message?.success('执行重试成功'); -// } -// }; +const retry = async (item: Workflow.JobTaskType) => { + const { error } = await fetchWorkflowNodeRetry(store.id!, item.workflowNodeId!); + if (!error) { + window.$message?.success('执行重试成功'); + } +}; -// const isRetry = (taskBatchStatus: number) => { -// return taskBatchStatus === 4 || taskBatchStatus === 5 || taskBatchStatus === 6; -// }; +const isRetry = (taskBatchStatus: number) => { + return taskBatchStatus === 4 || taskBatchStatus === 5 || taskBatchStatus === 6; +}; type ThemeColor = 'default' | 'error' | 'primary' | 'info' | 'success' | 'warning'; @@ -323,26 +326,6 @@ const onUpdatePage = (page: number) => { { :content-style="{ padding: 0 }" :header-style="{ padding: 0 }" > + + { remote :row-key="row => row.id" :pagination="pagination" - class="sm:h-full" + class="pt-16px sm:h-full" /> diff --git a/src/typings/api.d.ts b/src/typings/api.d.ts index 5eb4cff..55c982f 100644 --- a/src/typings/api.d.ts +++ b/src/typings/api.d.ts @@ -1047,7 +1047,8 @@ declare namespace Api { /** jobTask search params */ type jobTaskSearchParams = CommonType.RecordNullable< - Pick & CommonSearchParams & { startId: number; fromIndex: number } + Pick & + CommonSearchParams & { startId: number; fromIndex: number } >; /** jobTask list */