From 07af1b655309adf18ef015e7719abc9deab21ee6 Mon Sep 17 00:00:00 2001 From: opensnail <598092184@qq.com> Date: Tue, 9 Jul 2024 23:50:25 +0800 Subject: [PATCH] =?UTF-8?q?feat(sj=5F1.1.0-beta3):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/service/api/group.ts | 4 ++-- src/service/api/job.ts | 8 -------- src/service/api/namespace.ts | 4 ++-- src/service/api/workflow.ts | 7 ------- src/views/group/index.vue | 6 +++--- src/views/job/task/index.vue | 10 ++-------- src/views/namespace/index.vue | 6 +++--- src/views/retry/log/index.vue | 2 +- src/views/retry/task/index.vue | 3 ++- src/views/workflow/task/index.vue | 3 +-- 10 files changed, 16 insertions(+), 37 deletions(-) diff --git a/src/service/api/group.ts b/src/service/api/group.ts index 8b9a587..c78940f 100644 --- a/src/service/api/group.ts +++ b/src/service/api/group.ts @@ -61,9 +61,9 @@ export function fetchGetAllGroupConfigList(data: string[]) { } /** delete group by id */ -export function fetchDeleteGroup(id: string) { +export function fetchDeleteGroup(groupName: string) { return request({ - url: `/group/${id}`, + url: `/group/${groupName}`, method: 'delete' }); } diff --git a/src/service/api/job.ts b/src/service/api/job.ts index d79a793..6c7be6a 100644 --- a/src/service/api/job.ts +++ b/src/service/api/job.ts @@ -71,14 +71,6 @@ export function fetchUpdateJobStatus(data: Api.Job.JobUpdateJobStatusRequestVO) }); } -/** delete Job by id */ -export function fetchDeleteJob(id: string) { - return request({ - url: `/job/${id}`, - method: 'delete' - }); -} - /** batch delete Job by id */ export function fetchBatchDeleteJob(data: string[]) { return request({ diff --git a/src/service/api/namespace.ts b/src/service/api/namespace.ts index c927689..ad3217b 100644 --- a/src/service/api/namespace.ts +++ b/src/service/api/namespace.ts @@ -28,9 +28,9 @@ export function fetchEditNamespace(data: Api.Namespace.Namespace) { } /** delete namespace by id */ -export function fetchDeleteNamespace(id: string) { +export function fetchDeleteNamespace(uniqueId: string) { return request({ - url: `/namespace/${id}`, + url: `/namespace/${uniqueId}`, method: 'delete' }); } diff --git a/src/service/api/workflow.ts b/src/service/api/workflow.ts index 5d86a24..12c4263 100644 --- a/src/service/api/workflow.ts +++ b/src/service/api/workflow.ts @@ -43,13 +43,6 @@ export function fetchUpdateWorkflowStatus(id: string) { }); } -export function fetchDelWorkflow(id: string) { - return request({ - url: `/workflow/${id}`, - method: 'delete' - }); -} - export function fetchBatchDeleteWorkflow(data: string[]) { return request({ url: '/workflow/ids', diff --git a/src/views/group/index.vue b/src/views/group/index.vue index f8c5d45..e0a16cd 100644 --- a/src/views/group/index.vue +++ b/src/views/group/index.vue @@ -138,7 +138,7 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP {$t('common.edit')} - handleDelete(row.id!)}> + handleDelete(row.groupName!)}> {{ default: () => $t('common.confirmDelete'), trigger: () => ( @@ -170,8 +170,8 @@ function edit(id: string) { handleEdit(id); } -async function handleDelete(id: string) { - const { error } = await fetchDeleteGroup(id); +async function handleDelete(groupName: string) { + const { error } = await fetchDeleteGroup(groupName); if (error) return; onDeleted(); } diff --git a/src/views/job/task/index.vue b/src/views/job/task/index.vue index 0c17dfa..8ff0fc7 100644 --- a/src/views/job/task/index.vue +++ b/src/views/job/task/index.vue @@ -2,13 +2,7 @@ import { NButton, NPopconfirm, NTag } from 'naive-ui'; import { useBoolean } from '@sa/hooks'; import { ref } from 'vue'; -import { - fetchBatchDeleteJob, - fetchDeleteJob, - fetchGetJobPage, - fetchTriggerJob, - fetchUpdateJobStatus -} from '@/service/api'; +import { fetchBatchDeleteJob, fetchGetJobPage, fetchTriggerJob, fetchUpdateJobStatus } from '@/service/api'; import { $t } from '@/locales'; import { useAppStore } from '@/store/modules/app'; import { useTable, useTableOperate } from '@/hooks/common/table'; @@ -241,7 +235,7 @@ const { } = useTableOperate(data, getData); async function handleDelete(id: string) { - const { error } = await fetchDeleteJob(id); + const { error } = await fetchBatchDeleteJob([id]); if (error) return; onDeleted(); } diff --git a/src/views/namespace/index.vue b/src/views/namespace/index.vue index 190c2aa..08d351c 100644 --- a/src/views/namespace/index.vue +++ b/src/views/namespace/index.vue @@ -90,7 +90,7 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP {$t('common.switch')} - handleDelete(row.id!)}> + handleDelete(row.uniqueId!)}> {{ default: () => $t('common.confirmDelete'), trigger: () => ( @@ -125,8 +125,8 @@ function edit(id: string) { handleEdit(id); } -async function handleDelete(id: string) { - const { error } = await fetchDeleteNamespace(id); +async function handleDelete(uniqueId: string) { + const { error } = await fetchDeleteNamespace(uniqueId); if (error) return; onDeleted(); } diff --git a/src/views/retry/log/index.vue b/src/views/retry/log/index.vue index 59c6405..4e73c0b 100644 --- a/src/views/retry/log/index.vue +++ b/src/views/retry/log/index.vue @@ -42,7 +42,7 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP type: 'selection', align: 'center', width: 48, - disabled: row => row.retryStatus !== 1 + disabled: row => row.retryStatus === 0 }, { key: 'id', diff --git a/src/views/retry/task/index.vue b/src/views/retry/task/index.vue index 48141d4..7114fc1 100644 --- a/src/views/retry/task/index.vue +++ b/src/views/retry/task/index.vue @@ -43,7 +43,8 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP { type: 'selection', align: 'center', - width: 48 + width: 48, + disabled: row => row.retryStatus === 0 }, { key: 'id', diff --git a/src/views/workflow/task/index.vue b/src/views/workflow/task/index.vue index a9a8331..4ba301f 100644 --- a/src/views/workflow/task/index.vue +++ b/src/views/workflow/task/index.vue @@ -3,7 +3,6 @@ import { NButton, NDropdown, NPopconfirm, NTag } from 'naive-ui'; import { useRouter } from 'vue-router'; import { fetchBatchDeleteWorkflow, - fetchDelWorkflow, fetchGetWorkflowPageList, fetchTriggerWorkflow, fetchUpdateWorkflowStatus @@ -230,7 +229,7 @@ async function handleBatchDelete() { async function handleDelete(id: string) { // request - const { error } = await fetchDelWorkflow(id!); + const { error } = await fetchBatchDeleteWorkflow([id!]); if (error) return; onDeleted(); }