diff --git a/src/components/common/job-task-list-table.vue b/src/components/common/job-task-list-table.vue index e84ea34..fa1c8a8 100644 --- a/src/components/common/job-task-list-table.vue +++ b/src/components/common/job-task-list-table.vue @@ -4,9 +4,9 @@ import { NButton, NCode, NTag } from 'naive-ui'; import hljs from 'highlight.js/lib/core'; import json from 'highlight.js/lib/languages/json'; import { ref, render } from 'vue'; -import { taskStatusRecord } from '@/constants/business'; +import { taskStatusRecord, taskStatusRecordOptions } from '@/constants/business'; import { $t } from '@/locales'; -import { parseArgsJson } from '@/utils/common'; +import { parseArgsJson, translateOptions } from '@/utils/common'; import { useTable } from '@/hooks/common/table'; import { fetchGetJobTaskList, fetchGetJobTaskTree } from '@/service/api'; @@ -19,11 +19,15 @@ hljs.registerLanguage('json', json); interface Props { /** row data */ rowData?: Api.JobBatch.JobBatch | null; + isRetry?: boolean; } -const props = defineProps(); +const props = withDefaults(defineProps(), { + rowData: null +}); interface Emits { + (e: 'retry'): void; (e: 'showLog', rowData: Api.Job.JobTask): void; } @@ -33,7 +37,7 @@ const expandedRowKeys = ref([]); const argsDomMap = ref>(new Map()); -const { columns, columnChecks, data, loading, mobilePagination } = useTable({ +const { columns, searchParams, columnChecks, data, getData, loading, mobilePagination } = useTable({ apiFn: fetchGetJobTaskList, apiParams: { page: 1, @@ -41,7 +45,8 @@ const { columns, columnChecks, data, loading, mobilePagination } = useTable({ groupName: props.rowData?.groupName, taskBatchId: props.rowData?.id, startId: 0, - fromIndex: 0 + fromIndex: 0, + taskStatus: undefined // if you want to use the searchParams in Form, you need to define the following properties, and the value is null // the value can not be undefined, otherwise the property in Form will not be reactive }, @@ -217,6 +222,21 @@ const onUpdatePage = (_: number) => { expandedRowKeys.value = []; }; +async function flushed() { + searchParams.taskStatus = undefined; + await getData(); +} + +const retry = async () => { + emit('retry'); +}; + +const isRetry = () => { + return ( + props.rowData?.taskBatchStatus === 4 || props.rowData?.taskBatchStatus === 5 || props.rowData?.taskBatchStatus === 6 + ); +}; + const init = () => { columnChecks.value = columnChecks.value.filter(column => { if (!['4', '5'].includes(String(props.rowData?.taskType) || '-1')) { @@ -231,24 +251,56 @@ init(); diff --git a/src/components/workflow/modules/common/detail-card.vue b/src/components/workflow/modules/common/detail-card.vue index 9148d3f..06ba969 100644 --- a/src/components/workflow/modules/common/detail-card.vue +++ b/src/components/workflow/modules/common/detail-card.vue @@ -1,19 +1,13 @@ @@ -240,39 +201,7 @@ const onUpdatePage = (page: number) => { - - - - - + diff --git a/src/service/api/group.ts b/src/service/api/group.ts index 3750b7e..e152b3c 100644 --- a/src/service/api/group.ts +++ b/src/service/api/group.ts @@ -59,3 +59,11 @@ export function fetchGetAllGroupConfigList(data: string[]) { data }); } + +/** delete Group by id */ +export function fetchDeleteGroup(id: string) { + return request({ + url: `/group/${id}`, + method: 'delete' + }); +} diff --git a/src/service/api/namespace.ts b/src/service/api/namespace.ts index 80d15b6..c927689 100644 --- a/src/service/api/namespace.ts +++ b/src/service/api/namespace.ts @@ -26,3 +26,11 @@ export function fetchEditNamespace(data: Api.Namespace.Namespace) { data }); } + +/** delete namespace by id */ +export function fetchDeleteNamespace(id: string) { + return request({ + url: `/namespace/${id}`, + method: 'delete' + }); +} diff --git a/src/service/api/workflow.ts b/src/service/api/workflow.ts index d91a191..eb575e6 100644 --- a/src/service/api/workflow.ts +++ b/src/service/api/workflow.ts @@ -60,7 +60,7 @@ export function fetchStopWorkflowBatch(id: string) { export function fetchWorkflowNodeRetry(id: string, workflowNodeId: string) { return request({ url: `/workflow/node/retry/${workflowNodeId}/${id}`, - method: 'get' + method: 'post' }); } diff --git a/src/store/modules/theme/index.ts b/src/store/modules/theme/index.ts index e0f4125..43499a4 100644 --- a/src/store/modules/theme/index.ts +++ b/src/store/modules/theme/index.ts @@ -59,7 +59,7 @@ export const useThemeStore = defineStore(SetupStoreId.Theme, () => { const { setWatermark, clearWatermark } = useWatermark({ id: 'global_watermark_id' }); /** 开启水印 */ - function toggleWatermark(visible: boolean) { + function toggleWatermark(visible: boolean = false) { visible ? setWatermark(settings.value.watermark.text) : clearWatermark(); } diff --git a/src/views/group/index.vue b/src/views/group/index.vue index 48437cb..1464c11 100644 --- a/src/views/group/index.vue +++ b/src/views/group/index.vue @@ -2,7 +2,7 @@ import { NButton, NPopconfirm, NTag } from 'naive-ui'; import { ref } from 'vue'; import { useBoolean } from '@sa/hooks'; -import { fetchGetGroupConfigList, fetchUpdateGroupStatus } from '@/service/api'; +import { fetchDeleteGroup, fetchGetGroupConfigList, fetchUpdateGroupStatus } from '@/service/api'; import { $t } from '@/locales'; import { useAppStore } from '@/store/modules/app'; import { useTable, useTableOperate } from '@/hooks/common/table'; @@ -142,6 +142,17 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP edit(row.id!)}> {$t('common.edit')} + + handleDelete(row.id!)}> + {{ + default: () => $t('common.confirmDelete'), + trigger: () => ( + + {$t('common.delete')} + + ) + }} + ); } @@ -155,7 +166,8 @@ const { editingData, handleAdd, handleEdit, - checkedRowKeys + checkedRowKeys, + onDeleted // closeDrawer } = useTableOperate(data, getData); @@ -163,6 +175,12 @@ function edit(id: string) { handleEdit(id); } +async function handleDelete(id: string) { + const { error } = await fetchDeleteGroup(id); + if (error) return; + onDeleted(); +} + function body(): Api.GroupConfig.ExportGroupConfig { return { groupName: searchParams.groupName, diff --git a/src/views/job/batch/modules/job-batch-detail-drawer.vue b/src/views/job/batch/modules/job-batch-detail-drawer.vue index 82e0b50..9a5fe81 100644 --- a/src/views/job/batch/modules/job-batch-detail-drawer.vue +++ b/src/views/job/batch/modules/job-batch-detail-drawer.vue @@ -36,7 +36,7 @@ async function openLog(row: Api.Job.JobTask) { - + {{ rowData?.groupName }} {{ rowData?.jobName }} @@ -69,4 +69,8 @@ async function openLog(row: Api.Job.JobTask) { - + diff --git a/src/views/job/task/modules/job-task-detail-drawer.vue b/src/views/job/task/modules/job-task-detail-drawer.vue index 7af4837..829f996 100644 --- a/src/views/job/task/modules/job-task-detail-drawer.vue +++ b/src/views/job/task/modules/job-task-detail-drawer.vue @@ -26,7 +26,7 @@ const visible = defineModel('visible', { diff --git a/src/views/namespace/index.vue b/src/views/namespace/index.vue index 5f5faab..d5a0987 100644 --- a/src/views/namespace/index.vue +++ b/src/views/namespace/index.vue @@ -1,7 +1,7 @@