feat(sj_1.1.0-beta3): 优化删除

This commit is contained in:
opensnail 2024-07-13 08:34:39 +08:00
parent 8dc50bb21e
commit 3317040c0c
3 changed files with 21 additions and 4 deletions

View File

@ -62,6 +62,15 @@ export function fetchExecuteRetryTask(data: Api.RetryTask.ManualTriggerTaskReque
});
}
/** manual execute callbackTask */
export function fetchExecuteCallbackTask(data: Api.RetryTask.ManualTriggerTaskRequestVO) {
return request<boolean>({
url: '/retry-task/manual/trigger/callback/task',
method: 'post',
data
});
}
/** batch delete retryTask */
export function fetchBatchDeleteRetryTask(data: Api.RetryTask.BatchDeleteRetryTaskVO) {
return request<number>({

View File

@ -133,7 +133,7 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP
width: 80,
render: row => (
<div class="flex-center gap-8px">
{row.retryStatus === 1 ? (
{row.retryStatus === 1 || row.retryStatus === 2 ? (
<NPopconfirm onPositiveClick={() => handleDelete(row.id)}>
{{
default: () => $t('common.confirmDelete'),

View File

@ -4,6 +4,7 @@ import { useBoolean } from '@sa/hooks';
import { onMounted, ref } from 'vue';
import {
fetchBatchDeleteRetryTask,
fetchExecuteCallbackTask,
fetchExecuteRetryTask,
fetchGetAllGroupNameList,
fetchGetRetryTaskById,
@ -158,7 +159,7 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP
{/* 非[完成,最大次数], 显示[执行]按钮 */}
{row.retryStatus !== 1 && row.retryStatus !== 2 ? (
<>
<NPopconfirm onPositiveClick={() => handleExecute(row.groupName!, row.uniqueId!)}>
<NPopconfirm onPositiveClick={() => handleExecute(row.groupName!, row.uniqueId!, row.taskType!)}>
{{
default: () => $t('common.confirmExecute'),
trigger: () => (
@ -281,8 +282,15 @@ function handleBatchAdd() {
openBatchAddDrawer();
}
function handleExecute(groupName: string, uniqueId: string) {
fetchExecuteRetryTask({ groupName, uniqueIds: [uniqueId] });
function handleExecute(groupName: string, uniqueId: string, type: Api.RetryTask.TaskType) {
if (type === 1) {
fetchExecuteRetryTask({ groupName, uniqueIds: [uniqueId] });
return;
}
if (type === 2) {
fetchExecuteCallbackTask({ groupName, uniqueIds: [uniqueId] });
}
}
function handleResume(id: number, groupName: string) {