feat:【antd】bpm task 的部分迁移

This commit is contained in:
YunaiV
2025-10-20 23:33:52 +08:00
parent 002ac223f0
commit 3b4c01cedf
8 changed files with 61 additions and 25 deletions

View File

@@ -6,6 +6,8 @@ import { DocAlert, Page } from '@vben/common-ui';
import { message } from 'ant-design-vue';
import { $t } from '#/locales';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
import { getTaskDonePage, withdrawTask } from '#/api/bpm/task';
import { router } from '#/router';
@@ -27,10 +29,17 @@ function handleHistory(row: BpmTaskApi.TaskManager) {
/** 撤回任务 */
async function handleWithdraw(row: BpmTaskApi.TaskManager) {
await withdrawTask(row.id);
message.success('撤回成功');
// 刷新表格数据
await gridApi.query();
const hideLoading = message.loading({
content: '正在撤回中...',
duration: 0,
});
try {
await withdrawTask(row.id);
message.success('撤回成功');
await gridApi.query();
} finally {
hideLoading();
}
}
const [Grid, gridApi] = useVbenVxeGrid({
@@ -54,14 +63,12 @@ const [Grid, gridApi] = useVbenVxeGrid({
},
rowConfig: {
keyField: 'id',
isHover: true,
},
toolbarConfig: {
refresh: true,
search: true,
},
cellConfig: {
height: 64,
},
} as VxeTableGridOptions<BpmTaskApi.TaskManager>,
});
</script>
@@ -90,7 +97,10 @@ const [Grid, gridApi] = useVbenVxeGrid({
type: 'link',
icon: ACTION_ICON.EDIT,
color: 'warning',
onClick: handleWithdraw.bind(null, row),
popConfirm: {
title: '确定要撤回该任务吗?',
confirm: handleWithdraw.bind(null, row),
},
},
{
label: '历史',