feat(sj_1.1.0-beta3): 优化删除
This commit is contained in:
parent
863f8cf5ce
commit
07af1b6553
@ -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<boolean>({
|
||||
url: `/group/${id}`,
|
||||
url: `/group/${groupName}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
@ -71,14 +71,6 @@ export function fetchUpdateJobStatus(data: Api.Job.JobUpdateJobStatusRequestVO)
|
||||
});
|
||||
}
|
||||
|
||||
/** delete Job by id */
|
||||
export function fetchDeleteJob(id: string) {
|
||||
return request<boolean>({
|
||||
url: `/job/${id}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
/** batch delete Job by id */
|
||||
export function fetchBatchDeleteJob(data: string[]) {
|
||||
return request<boolean>({
|
||||
|
@ -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<boolean>({
|
||||
url: `/namespace/${id}`,
|
||||
url: `/namespace/${uniqueId}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
@ -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',
|
||||
|
@ -138,7 +138,7 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP
|
||||
{$t('common.edit')}
|
||||
</NButton>
|
||||
<n-divider vertical />
|
||||
<NPopconfirm onPositiveClick={() => handleDelete(row.id!)}>
|
||||
<NPopconfirm onPositiveClick={() => 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();
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP
|
||||
{$t('common.switch')}
|
||||
</NButton>
|
||||
<n-divider vertical />
|
||||
<NPopconfirm onPositiveClick={() => handleDelete(row.id!)}>
|
||||
<NPopconfirm onPositiveClick={() => 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();
|
||||
}
|
||||
|
@ -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',
|
||||
|
@ -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',
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user