review:【BPM 工作流】流程、任务相关的逻辑

This commit is contained in:
YunaiV
2025-05-14 23:08:31 +08:00
parent 99c848a39d
commit 769cb87035
15 changed files with 18 additions and 52 deletions

View File

@@ -20,7 +20,6 @@ export function useGridFormSchema(): VbenFormSchema[] {
allowClear: true,
},
},
{
fieldName: 'createTime',
label: '抄送时间',
@@ -51,26 +50,22 @@ export function useGridColumns<T = BpmTaskApi.TaskVO>(
default: 'slot-summary',
},
},
{
field: 'startUser.nickname',
title: '流程发起人',
minWidth: 120,
},
{
field: 'processInstanceStartTime',
title: '流程发起时间',
minWidth: 180,
formatter: 'formatDateTime',
},
{
field: 'activityName',
title: '抄送节点',
minWidth: 180,
},
{
field: 'createUser.nickname',
title: '抄送人',
@@ -84,14 +79,12 @@ export function useGridColumns<T = BpmTaskApi.TaskVO>(
title: '抄送意见',
minWidth: 180,
},
{
field: 'createTime',
title: '抄送时间',
minWidth: 180,
formatter: 'formatDateTime',
},
{
field: 'operation',
title: '操作',

View File

@@ -63,11 +63,11 @@ function onActionClick({
/** 办理任务 */
function onDetail(row: BpmProcessInstanceApi.ProcessInstanceVO) {
// TODO @siyerow 的类型是不是不对哈?需要改成 copyvo 么?
const query = {
id: row.processInstanceId,
...(row.activityId && { activityId: row.activityId }),
};
router.push({
name: 'BpmProcessInstanceDetail',
query,
@@ -82,10 +82,12 @@ function onRefresh() {
<template>
<Page auto-content-height>
<!-- TODO @siye应该用 <template #doc>这样高度可以被用进去哈 -->
<DocAlert
title="审批转办、委派、抄送"
url="https://doc.iocoder.cn/bpm/task-delegation-and-cc/"
/>
<FormModal @success="onRefresh" />
<Grid table-title="抄送任务">
<!-- 摘要 -->
@@ -102,7 +104,6 @@ function onRefresh() {
</div>
<div v-else>-</div>
</template>
<!-- 抄送人 -->
<template #slot-createUser="{ row }">
<span class="text-gray-500">

View File

@@ -12,6 +12,7 @@ import {
getRangePickerDefaultProps,
} from '#/utils';
// TODO @siye这个要去掉么没用到
const { hasAccessByCodes } = useAccess();
/** 列表的搜索表单 */
@@ -35,7 +36,6 @@ export function useGridFormSchema(): VbenFormSchema[] {
allowClear: true,
},
},
// 流程分类
{
fieldName: 'category',
label: '流程分类',
@@ -48,7 +48,6 @@ export function useGridFormSchema(): VbenFormSchema[] {
valueField: 'code',
},
},
// 流程状态
{
fieldName: 'status',
label: '流程状态',
@@ -93,7 +92,6 @@ export function useGridColumns<T = BpmTaskApi.TaskVO>(
default: 'slot-summary',
},
},
{
field: 'processInstance.startUser.nickname',
title: '发起人',
@@ -110,21 +108,18 @@ export function useGridColumns<T = BpmTaskApi.TaskVO>(
title: '当前任务',
minWidth: 180,
},
{
field: 'createTime',
title: '任务开始时间',
minWidth: 180,
formatter: 'formatDateTime',
},
{
field: 'endTime',
title: '任务结束时间',
minWidth: 180,
formatter: 'formatDateTime',
},
{
field: 'status',
title: '审批状态',
@@ -134,14 +129,11 @@ export function useGridColumns<T = BpmTaskApi.TaskVO>(
props: { type: DICT_TYPE.BPM_TASK_STATUS },
},
},
{
field: 'reason',
title: '审批建议',
minWidth: 180,
},
// 耗时
{
field: 'durationInMillis',
title: '耗时',
@@ -150,19 +142,16 @@ export function useGridColumns<T = BpmTaskApi.TaskVO>(
return `${formatPast2(row.durationInMillis)}`;
},
},
{
field: 'processInstanceId',
title: '流程编号',
minWidth: 280,
},
{
field: 'id',
title: '任务编号',
minWidth: 280,
},
{
field: 'operation',
title: '操作',

View File

@@ -16,7 +16,6 @@ export function useGridFormSchema(): VbenFormSchema[] {
allowClear: true,
},
},
{
fieldName: 'createTime',
label: '创建时间',
@@ -47,7 +46,6 @@ export function useGridColumns<T = BpmTaskApi.TaskVO>(
default: 'slot-summary',
},
},
{
field: 'processInstance.startUser.nickname',
title: '发起人',
@@ -64,28 +62,23 @@ export function useGridColumns<T = BpmTaskApi.TaskVO>(
title: '当前任务',
minWidth: 180,
},
{
field: 'createTime',
title: '任务开始时间',
minWidth: 180,
formatter: 'formatDateTime',
},
{
field: 'endTime',
title: '任务结束时间',
minWidth: 180,
formatter: 'formatDateTime',
},
// 审批人
{
field: 'assigneeUser.nickname',
title: '审批人',
minWidth: 180,
},
{
field: 'status',
title: '审批状态',
@@ -95,14 +88,11 @@ export function useGridColumns<T = BpmTaskApi.TaskVO>(
props: { type: DICT_TYPE.BPM_TASK_STATUS },
},
},
{
field: 'reason',
title: '审批建议',
minWidth: 180,
},
// 耗时
{
field: 'durationInMillis',
title: '耗时',
@@ -111,19 +101,16 @@ export function useGridColumns<T = BpmTaskApi.TaskVO>(
return `${formatPast2(row.durationInMillis)}`;
},
},
{
field: 'processInstanceId',
title: '流程编号',
minWidth: 280,
},
{
field: 'id',
title: '任务编号',
minWidth: 280,
},
{
field: 'operation',
title: '操作',

View File

@@ -64,6 +64,7 @@ function onHistory(row: BpmTaskApi.TaskVO) {
router.push({
name: 'BpmProcessInstanceDetail',
query: {
// TODO @siye数据类型会爆红哈
id: row.processInstance.id,
},
});
@@ -78,9 +79,11 @@ function onRefresh() {
<template>
<Page auto-content-height>
<DocAlert title="工作流手册" url="https://doc.iocoder.cn/bpm/" />
<FormModal @success="onRefresh" />
<Grid table-title="流程任务">
<!-- 摘要 -->
<!-- TODO siye这个要不要也放到 data.ts 处理掉 -->
<template #slot-summary="{ row }">
<div
class="flex flex-col py-2"

View File

@@ -30,7 +30,6 @@ export function useGridFormSchema(): VbenFormSchema[] {
allowClear: true,
},
},
// 流程分类
{
fieldName: 'category',
label: '流程分类',
@@ -43,7 +42,6 @@ export function useGridFormSchema(): VbenFormSchema[] {
valueField: 'code',
},
},
// 流程状态
{
fieldName: 'status',
label: '流程状态',
@@ -57,7 +55,6 @@ export function useGridFormSchema(): VbenFormSchema[] {
allowClear: true,
},
},
// 发起时间
{
fieldName: 'createTime',
label: '发起时间',
@@ -88,45 +85,38 @@ export function useGridColumns<T = BpmTaskApi.TaskVO>(
default: 'slot-summary',
},
},
{
field: 'processInstance.startUser.nickname',
title: '发起人',
minWidth: 120,
},
{
field: 'createTime',
title: '发起时间',
minWidth: 180,
formatter: 'formatDateTime',
},
{
field: 'name',
title: '当前任务',
minWidth: 180,
},
{
field: 'createTime',
title: '任务时间',
minWidth: 180,
formatter: 'formatDateTime',
},
{
field: 'processInstanceId',
title: '流程编号',
minWidth: 280,
},
{
field: 'id',
title: '任务编号',
minWidth: 280,
},
{
field: 'operation',
title: '操作',

View File

@@ -92,6 +92,7 @@ function onRefresh() {
<FormModal @success="onRefresh" />
<Grid table-title="待办任务">
<!-- 摘要 -->
<!-- TODO siye这个要不要也放到 data.ts 处理掉 -->
<template #slot-summary="{ row }">
<div
class="flex flex-col py-2"