feat(sj_map_reduce): 工作流任务批次详情新增状态查询
This commit is contained in:
parent
3f94657e8e
commit
514c13735e
@ -2,22 +2,18 @@
|
|||||||
import { nextTick, ref, useSlots, watch } from 'vue';
|
import { nextTick, ref, useSlots, watch } from 'vue';
|
||||||
import type { DataTableColumn } from 'naive-ui';
|
import type { DataTableColumn } from 'naive-ui';
|
||||||
import { NButton, NTag } from 'naive-ui';
|
import { NButton, NTag } from 'naive-ui';
|
||||||
|
import { isNotNull, translateOptions } from '@/utils/common';
|
||||||
import {
|
import {
|
||||||
jobExecutorEnum,
|
jobExecutorEnum,
|
||||||
jobOperationReasonEnum,
|
jobOperationReasonEnum,
|
||||||
jobStatusEnum,
|
jobStatusEnum,
|
||||||
taskBatchStatusEnum,
|
taskBatchStatusEnum,
|
||||||
taskBatchStatusRecord
|
taskBatchStatusRecord,
|
||||||
|
taskStatusRecordOptions
|
||||||
} from '@/constants/business';
|
} from '@/constants/business';
|
||||||
import { useWorkflowStore } from '@/store/modules/workflow';
|
import { useWorkflowStore } from '@/store/modules/workflow';
|
||||||
import { $t } from '@/locales';
|
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({
|
defineOptions({
|
||||||
name: 'DetailCard'
|
name: 'DetailCard'
|
||||||
@ -49,6 +45,7 @@ const logOpen = ref(false);
|
|||||||
const spinning = ref(false);
|
const spinning = ref(false);
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const currentIndex = ref(1);
|
const currentIndex = ref(1);
|
||||||
|
const taskStatusSearch = ref();
|
||||||
const jobData = ref<Workflow.JobTaskType>({});
|
const jobData = ref<Workflow.JobTaskType>({});
|
||||||
const dataSource = ref<Workflow.JobBatchType[]>([]);
|
const dataSource = ref<Workflow.JobBatchType[]>([]);
|
||||||
|
|
||||||
@ -110,6 +107,7 @@ async function getRows(id: string, page: number = 1) {
|
|||||||
const { data, error } = await fetchGetJobTaskList({
|
const { data, error } = await fetchGetJobTaskList({
|
||||||
groupName: store.groupName!,
|
groupName: store.groupName!,
|
||||||
taskBatchId: id ?? '0',
|
taskBatchId: id ?? '0',
|
||||||
|
taskStatus: taskStatusSearch.value,
|
||||||
page,
|
page,
|
||||||
size: pagination.value.pageSize
|
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<string[]>([]);
|
const idList = ref<string[]>([]);
|
||||||
|
|
||||||
function onLoad() {
|
function onLoad() {
|
||||||
@ -144,16 +147,16 @@ const getLogRows = (task: Workflow.JobTaskType) => {
|
|||||||
logOpen.value = true;
|
logOpen.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
// const retry = async (item: Workflow.JobTaskType) => {
|
const retry = async (item: Workflow.JobTaskType) => {
|
||||||
// const { error } = await fetchWorkflowNodeRetry(store.id!, item.workflowNodeId!);
|
const { error } = await fetchWorkflowNodeRetry(store.id!, item.workflowNodeId!);
|
||||||
// if (!error) {
|
if (!error) {
|
||||||
// window.$message?.success('执行重试成功');
|
window.$message?.success('执行重试成功');
|
||||||
// }
|
}
|
||||||
// };
|
};
|
||||||
|
|
||||||
// const isRetry = (taskBatchStatus: number) => {
|
const isRetry = (taskBatchStatus: number) => {
|
||||||
// return taskBatchStatus === 4 || taskBatchStatus === 5 || taskBatchStatus === 6;
|
return taskBatchStatus === 4 || taskBatchStatus === 5 || taskBatchStatus === 6;
|
||||||
// };
|
};
|
||||||
|
|
||||||
type ThemeColor = 'default' | 'error' | 'primary' | 'info' | 'success' | 'warning';
|
type ThemeColor = 'default' | 'error' | 'primary' | 'info' | 'success' | 'warning';
|
||||||
|
|
||||||
@ -323,26 +326,6 @@ const onUpdatePage = (page: number) => {
|
|||||||
<NTabPane name="task">
|
<NTabPane name="task">
|
||||||
<template #tab>
|
<template #tab>
|
||||||
<span>任务项列表</span>
|
<span>任务项列表</span>
|
||||||
<!--
|
|
||||||
<div class="absolute right-16px top-9px">
|
|
||||||
<NTooltip trigger="hover">
|
|
||||||
<template #trigger>
|
|
||||||
<NButton text @click="getRows(item)">
|
|
||||||
<icon-ant-design:sync-outlined class="mr-8px text-20px font-bold" />
|
|
||||||
</NButton>
|
|
||||||
</template>
|
|
||||||
刷新
|
|
||||||
</NTooltip>
|
|
||||||
<NTooltip v-if="isRetry(jobData.taskBatchStatus!)" trigger="hover">
|
|
||||||
<template #trigger>
|
|
||||||
<NButton text>
|
|
||||||
<icon-ant-design:redo-outlined class="text-20px font-bold" @click="retry(jobData)" />
|
|
||||||
</NButton>
|
|
||||||
</template>
|
|
||||||
重试
|
|
||||||
</NTooltip>
|
|
||||||
</div>
|
|
||||||
-->
|
|
||||||
</template>
|
</template>
|
||||||
<NCard
|
<NCard
|
||||||
:bordered="false"
|
:bordered="false"
|
||||||
@ -351,6 +334,30 @@ const onUpdatePage = (page: number) => {
|
|||||||
:content-style="{ padding: 0 }"
|
:content-style="{ padding: 0 }"
|
||||||
:header-style="{ padding: 0 }"
|
:header-style="{ padding: 0 }"
|
||||||
>
|
>
|
||||||
|
<template #header>
|
||||||
|
<NSelect
|
||||||
|
v-model:value="taskStatusSearch"
|
||||||
|
clearable
|
||||||
|
class="max-w-180px"
|
||||||
|
:options="translateOptions(taskStatusRecordOptions)"
|
||||||
|
placeholder="请选择状态"
|
||||||
|
@update:value="getRows(item)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #header-extra>
|
||||||
|
<NButton class="mr-16px" @click="flushed(item)">
|
||||||
|
<template #icon>
|
||||||
|
<icon-ant-design:sync-outlined class="text-icon" />
|
||||||
|
</template>
|
||||||
|
刷新
|
||||||
|
</NButton>
|
||||||
|
<NButton v-if="isRetry(jobData.taskBatchStatus!)" @click="retry(jobData)">
|
||||||
|
<template #icon>
|
||||||
|
<icon-ant-design:redo-outlined class="text-icon" />
|
||||||
|
</template>
|
||||||
|
重试
|
||||||
|
</NButton>
|
||||||
|
</template>
|
||||||
<NDataTable
|
<NDataTable
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data="dataSource"
|
:data="dataSource"
|
||||||
@ -359,7 +366,7 @@ const onUpdatePage = (page: number) => {
|
|||||||
remote
|
remote
|
||||||
:row-key="row => row.id"
|
:row-key="row => row.id"
|
||||||
:pagination="pagination"
|
:pagination="pagination"
|
||||||
class="sm:h-full"
|
class="pt-16px sm:h-full"
|
||||||
/>
|
/>
|
||||||
</NCard>
|
</NCard>
|
||||||
</NTabPane>
|
</NTabPane>
|
||||||
|
3
src/typings/api.d.ts
vendored
3
src/typings/api.d.ts
vendored
@ -1047,7 +1047,8 @@ declare namespace Api {
|
|||||||
|
|
||||||
/** jobTask search params */
|
/** jobTask search params */
|
||||||
type jobTaskSearchParams = CommonType.RecordNullable<
|
type jobTaskSearchParams = CommonType.RecordNullable<
|
||||||
Pick<Api.Job.JobTask, 'groupName' | 'taskBatchId'> & CommonSearchParams & { startId: number; fromIndex: number }
|
Pick<Api.Job.JobTask, 'groupName' | 'taskBatchId' | 'taskStatus'> &
|
||||||
|
CommonSearchParams & { startId: number; fromIndex: number }
|
||||||
>;
|
>;
|
||||||
|
|
||||||
/** jobTask list */
|
/** jobTask list */
|
||||||
|
Loading…
Reference in New Issue
Block a user