mirror of
https://gitee.com/JavaLionLi/plus-ui.git
synced 2026-11-04 14:19:45 +08:00
update warm-flow 2.1.1
This commit is contained in:
parent
1d237b3297
commit
8b19e5d2b8
@ -38,6 +38,14 @@ export const getEventWait = (id: string | number): AxiosPromise<EventWaitVO> =>
|
||||
});
|
||||
};
|
||||
|
||||
/** 恢复已死的事件等待记录,定时启动任务除外 */
|
||||
export const reviveEventWait = (id: string | number): AxiosPromise<void> => {
|
||||
return request({
|
||||
url: `/workflow/eventWait/${id}/revive`,
|
||||
method: 'post'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 手动补发一次定时启动任务,返回新建实例主键;不影响该任务的下次触发时间
|
||||
* @param data
|
||||
|
||||
@ -145,9 +145,26 @@
|
||||
<span>{{ scope.row.businessId || (scope.row.instanceId ? scope.row.instanceId : '定义级') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="190" fixed="right">
|
||||
<el-table-column label="操作" align="center" width="250" fixed="right">
|
||||
<template #default="scope">
|
||||
<div class="timer-action-group">
|
||||
<el-tooltip
|
||||
v-if="scope.row.status === 'DEAD'"
|
||||
:disabled="!isTimerStart(scope.row)"
|
||||
content="定时启动任务请通过重新发布或挂起后激活恢复"
|
||||
>
|
||||
<el-button
|
||||
v-hasPermi="['workflow:eventWait:trigger']"
|
||||
link
|
||||
type="warning"
|
||||
icon="Refresh"
|
||||
:disabled="isTimerStart(scope.row) || restoringId !== undefined"
|
||||
:loading="restoringId === scope.row.id"
|
||||
@click="handleRevive(scope.row)"
|
||||
>
|
||||
手动恢复
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<el-button link type="primary" icon="View" @click="handleDetail(scope.row)">详情</el-button>
|
||||
<el-button
|
||||
v-if="isTimerStart(scope.row)"
|
||||
@ -222,7 +239,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Timer" lang="ts">
|
||||
import { listEventWait, getEventWait, summaryEventWait, triggerTimerStart } from '@/api/workflow/timer';
|
||||
import { listEventWait, getEventWait, summaryEventWait, triggerTimerStart, reviveEventWait } from '@/api/workflow/timer';
|
||||
import type { EventWaitQuery, EventWaitSummary, EventWaitVO } from '@/api/workflow/timer/types';
|
||||
import { useLoading } from '@/hooks/async/useLoading';
|
||||
import { useSearchToggle } from '@/hooks/form/useSearchToggle';
|
||||
@ -327,6 +344,7 @@ const triggerVisible = ref(false);
|
||||
const triggerRow = ref<EventWaitVO | null>(null);
|
||||
const triggerForm = reactive({ businessId: '' });
|
||||
const submitting = ref(false);
|
||||
const restoringId = ref<string | number>();
|
||||
|
||||
const buildQuery = (): EventWaitQuery => {
|
||||
return {
|
||||
@ -396,6 +414,25 @@ const handleTrigger = (row: EventWaitVO | Record<string, any>) => {
|
||||
triggerVisible.value = true;
|
||||
};
|
||||
|
||||
const handleRevive = async (row: EventWaitVO | Record<string, any>) => {
|
||||
if (restoringId.value !== undefined || row.status !== 'DEAD' || isTimerStart(row)) return;
|
||||
restoringId.value = row.id;
|
||||
try {
|
||||
const confirmed = await modal
|
||||
.confirm('确认恢复该事件等待记录?恢复后重试次数归零,定时事件将从当前时间重新排期。')
|
||||
.then(() => true, () => false);
|
||||
if (!confirmed) return;
|
||||
await reviveEventWait(row.id);
|
||||
modal.msgSuccess('已恢复');
|
||||
await getList();
|
||||
if (detailVisible.value && detail.value.id === row.id) {
|
||||
await handleDetail(row);
|
||||
}
|
||||
} finally {
|
||||
restoringId.value = undefined;
|
||||
}
|
||||
};
|
||||
|
||||
const submitTrigger = async () => {
|
||||
const row = triggerRow.value;
|
||||
if (!row) return;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user