feat:【antd】bpm task 的部分迁移
This commit is contained in:
@@ -6,6 +6,7 @@ export namespace BpmProcessDefinitionApi {
|
|||||||
/** 流程定义 */
|
/** 流程定义 */
|
||||||
export interface ProcessDefinition {
|
export interface ProcessDefinition {
|
||||||
id: string;
|
id: string;
|
||||||
|
key?: string;
|
||||||
version: number;
|
version: number;
|
||||||
name: string;
|
name: string;
|
||||||
description: string;
|
description: string;
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ export namespace BpmTaskApi {
|
|||||||
status: number; // 监听器状态
|
status: number; // 监听器状态
|
||||||
event: string; // 监听事件
|
event: string; // 监听事件
|
||||||
valueType: string; // 监听器值类型
|
valueType: string; // 监听器值类型
|
||||||
|
processInstance?: BpmProcessInstanceApi.ProcessInstance; // 流程实例
|
||||||
}
|
}
|
||||||
|
|
||||||
// 流程任务
|
// 流程任务
|
||||||
|
|||||||
@@ -46,14 +46,12 @@ const [Grid] = useVbenVxeGrid({
|
|||||||
},
|
},
|
||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
|
isHover: true,
|
||||||
},
|
},
|
||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
refresh: true,
|
refresh: true,
|
||||||
search: true,
|
search: true,
|
||||||
},
|
},
|
||||||
cellConfig: {
|
|
||||||
height: 64,
|
|
||||||
},
|
|
||||||
} as VxeTableGridOptions<BpmProcessInstanceApi.Copy>,
|
} as VxeTableGridOptions<BpmProcessInstanceApi.Copy>,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -19,13 +19,22 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
|||||||
allowClear: true,
|
allowClear: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
// TODO @AI:是不是直接 import 下,不要动态;
|
||||||
{
|
{
|
||||||
fieldName: 'processDefinitionId',
|
fieldName: 'processDefinitionKey',
|
||||||
label: '所属流程',
|
label: '所属流程',
|
||||||
component: 'Input',
|
component: 'ApiSelect',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
placeholder: '请输入流程定义的编号',
|
placeholder: '请选择流程定义',
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
|
api: async () => {
|
||||||
|
const { getSimpleProcessDefinitionList } = await import(
|
||||||
|
'#/api/bpm/definition'
|
||||||
|
);
|
||||||
|
return await getSimpleProcessDefinitionList();
|
||||||
|
},
|
||||||
|
labelField: 'name',
|
||||||
|
valueField: 'key',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -88,6 +97,12 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
|
|||||||
title: '发起人',
|
title: '发起人',
|
||||||
minWidth: 120,
|
minWidth: 120,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'processInstance.createTime',
|
||||||
|
title: '发起时间',
|
||||||
|
minWidth: 180,
|
||||||
|
formatter: 'formatDateTime',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'name',
|
field: 'name',
|
||||||
title: '当前任务',
|
title: '当前任务',
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import { DocAlert, Page } from '@vben/common-ui';
|
|||||||
|
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
|
import { $t } from '#/locales';
|
||||||
|
|
||||||
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import { getTaskDonePage, withdrawTask } from '#/api/bpm/task';
|
import { getTaskDonePage, withdrawTask } from '#/api/bpm/task';
|
||||||
import { router } from '#/router';
|
import { router } from '#/router';
|
||||||
@@ -27,10 +29,17 @@ function handleHistory(row: BpmTaskApi.TaskManager) {
|
|||||||
|
|
||||||
/** 撤回任务 */
|
/** 撤回任务 */
|
||||||
async function handleWithdraw(row: BpmTaskApi.TaskManager) {
|
async function handleWithdraw(row: BpmTaskApi.TaskManager) {
|
||||||
await withdrawTask(row.id);
|
const hideLoading = message.loading({
|
||||||
message.success('撤回成功');
|
content: '正在撤回中...',
|
||||||
// 刷新表格数据
|
duration: 0,
|
||||||
await gridApi.query();
|
});
|
||||||
|
try {
|
||||||
|
await withdrawTask(row.id);
|
||||||
|
message.success('撤回成功');
|
||||||
|
await gridApi.query();
|
||||||
|
} finally {
|
||||||
|
hideLoading();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
@@ -54,14 +63,12 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
},
|
},
|
||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
|
isHover: true,
|
||||||
},
|
},
|
||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
refresh: true,
|
refresh: true,
|
||||||
search: true,
|
search: true,
|
||||||
},
|
},
|
||||||
cellConfig: {
|
|
||||||
height: 64,
|
|
||||||
},
|
|
||||||
} as VxeTableGridOptions<BpmTaskApi.TaskManager>,
|
} as VxeTableGridOptions<BpmTaskApi.TaskManager>,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@@ -90,7 +97,10 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
type: 'link',
|
type: 'link',
|
||||||
icon: ACTION_ICON.EDIT,
|
icon: ACTION_ICON.EDIT,
|
||||||
color: 'warning',
|
color: 'warning',
|
||||||
onClick: handleWithdraw.bind(null, row),
|
popConfirm: {
|
||||||
|
title: '确定要撤回该任务吗?',
|
||||||
|
confirm: handleWithdraw.bind(null, row),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '历史',
|
label: '历史',
|
||||||
|
|||||||
@@ -43,14 +43,12 @@ const [Grid] = useVbenVxeGrid({
|
|||||||
},
|
},
|
||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
|
isHover: true,
|
||||||
},
|
},
|
||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
refresh: true,
|
refresh: true,
|
||||||
search: true,
|
search: true,
|
||||||
},
|
},
|
||||||
cellConfig: {
|
|
||||||
height: 64,
|
|
||||||
},
|
|
||||||
} as VxeTableGridOptions<BpmTaskApi.TaskManager>,
|
} as VxeTableGridOptions<BpmTaskApi.TaskManager>,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@@ -60,6 +58,7 @@ const [Grid] = useVbenVxeGrid({
|
|||||||
<template #doc>
|
<template #doc>
|
||||||
<DocAlert title="工作流手册" url="https://doc.iocoder.cn/bpm/" />
|
<DocAlert title="工作流手册" url="https://doc.iocoder.cn/bpm/" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<Grid table-title="流程任务">
|
<Grid table-title="流程任务">
|
||||||
<template #actions="{ row }">
|
<template #actions="{ row }">
|
||||||
<TableAction
|
<TableAction
|
||||||
|
|||||||
@@ -19,13 +19,22 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
|||||||
allowClear: true,
|
allowClear: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
// TODO @AI:是不是直接 import 下,不要动态;
|
||||||
{
|
{
|
||||||
fieldName: 'processDefinitionId',
|
fieldName: 'processDefinitionKey',
|
||||||
label: '所属流程',
|
label: '所属流程',
|
||||||
component: 'Input',
|
component: 'ApiSelect',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
placeholder: '请输入流程定义的编号',
|
placeholder: '请选择流程定义',
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
|
api: async () => {
|
||||||
|
const { getSimpleProcessDefinitionList } = await import(
|
||||||
|
'#/api/bpm/definition'
|
||||||
|
);
|
||||||
|
return await getSimpleProcessDefinitionList();
|
||||||
|
},
|
||||||
|
labelField: 'name',
|
||||||
|
valueField: 'key',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -91,6 +100,12 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
|
|||||||
title: '发起人',
|
title: '发起人',
|
||||||
minWidth: 120,
|
minWidth: 120,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'processInstance.createTime',
|
||||||
|
title: '发起时间',
|
||||||
|
minWidth: 180,
|
||||||
|
formatter: 'formatDateTime',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'name',
|
field: 'name',
|
||||||
title: '当前任务',
|
title: '当前任务',
|
||||||
|
|||||||
@@ -14,11 +14,10 @@ defineOptions({ name: 'BpmTodoTask' });
|
|||||||
|
|
||||||
/** 办理任务 */
|
/** 办理任务 */
|
||||||
function handleAudit(row: BpmTaskApi.Task) {
|
function handleAudit(row: BpmTaskApi.Task) {
|
||||||
console.warn(row);
|
|
||||||
router.push({
|
router.push({
|
||||||
name: 'BpmProcessInstanceDetail',
|
name: 'BpmProcessInstanceDetail',
|
||||||
query: {
|
query: {
|
||||||
id: row.processInstance.id,
|
id: row.processInstance!.id,
|
||||||
taskId: row.id,
|
taskId: row.id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -45,14 +44,12 @@ const [Grid] = useVbenVxeGrid({
|
|||||||
},
|
},
|
||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
|
isHover: true,
|
||||||
},
|
},
|
||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
refresh: true,
|
refresh: true,
|
||||||
search: true,
|
search: true,
|
||||||
},
|
},
|
||||||
cellConfig: {
|
|
||||||
height: 64,
|
|
||||||
},
|
|
||||||
} as VxeTableGridOptions<BpmTaskApi.Task>,
|
} as VxeTableGridOptions<BpmTaskApi.Task>,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user