From ad5b23654f72ca7ea9ba8a5f2536a3f0c49be91d Mon Sep 17 00:00:00 2001 From: "bai.zixv" Date: Thu, 19 Sep 2024 22:23:04 +0800 Subject: [PATCH] =?UTF-8?q?fix(approval):=20=E5=AE=A1=E6=89=B9-=E5=8F=91?= =?UTF-8?q?=E8=B5=B7,=20=E5=8E=BB=E9=99=A4=E7=A1=AC=E7=BC=96=E7=A0=81=20&?= =?UTF-8?q?=20=E7=BB=99=E5=AE=A1=E6=89=B9-=E5=8F=91=E8=B5=B7,=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=BB=98=E8=AE=A4=E7=9A=84=E7=AD=9B=E9=80=89=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=20(#1544)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-on: https://git.daoyoucloud.com/daoyoucloud/tachybase/pulls/1544 Reviewed-by: sealday Co-authored-by: bai.zixv Co-committed-by: bai.zixv --- .../component/ApprovalTemplateType.tsx | 2 +- .../initiations/component/ApprovalItem.tsx | 2 +- .../initiations/component/InitiationsItem.tsx | 4 ++-- .../todos/component/TabApprovalItem.tsx | 6 ++--- .../VC.ApprovalBlockLaunchApplication.tsx | 23 ++++++++++++++++--- 5 files changed, 27 insertions(+), 10 deletions(-) diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/component/ApprovalTemplateType.tsx b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/component/ApprovalTemplateType.tsx index b9e07f75c..522f31a1c 100644 --- a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/component/ApprovalTemplateType.tsx +++ b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/component/ApprovalTemplateType.tsx @@ -21,7 +21,7 @@ export const ApprovalTemplateType = observer((props) => { }) .then((res) => { const columnsData = res.data.data.map((value) => { - return { label: value.title?.replace('审批流:', '') || '', value: value.id }; + return { label: value.title || '', value: value.id }; }); columnsData.unshift({ value: 'all', diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/initiations/component/ApprovalItem.tsx b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/initiations/component/ApprovalItem.tsx index d6c82d2d1..41e389a98 100644 --- a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/initiations/component/ApprovalItem.tsx +++ b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/initiations/component/ApprovalItem.tsx @@ -93,7 +93,7 @@ const changService = (api, setData, user, filter, t, setDefaultData, cm, compile const result = res.data?.data.map((item) => { const priorityType = ApprovalPriorityType.find((priorityItem) => priorityItem.value === item.data.priority); const statusType = approvalTodoListStatus(item, t); - const categoryTitle = item.workflow.title.replace('审批流:', ''); + const categoryTitle = item.workflow.title; const collectionName = item.workflow?.config?.collection || item.execution?.context?.collectionName; const summary = Object.entries(item.summary)?.map(([key, value]) => { const field = cm.getCollectionField(`${collectionName}.${key}`); diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/initiations/component/InitiationsItem.tsx b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/initiations/component/InitiationsItem.tsx index a699f34dd..bc5798649 100644 --- a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/initiations/component/InitiationsItem.tsx +++ b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/initiations/component/InitiationsItem.tsx @@ -37,13 +37,13 @@ export const InitiationsItem = observer((props) => {
{ - navigate(`/mobile/${value.title?.replace('审批流:', '') || ''}/approval/${value.id}/page`); + navigate(`/mobile/${value.title || ''}/approval/${value.id}/page`); }} >
- {value.title?.replace('审批流:', '') || ''} + {value.title || ''}
), }; diff --git a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/TabApprovalItem.tsx b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/TabApprovalItem.tsx index ba617a85e..634b67e88 100644 --- a/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/TabApprovalItem.tsx +++ b/packages/plugins/@hera/plugin-approval-mobile/src/client/approval/todos/component/TabApprovalItem.tsx @@ -106,7 +106,7 @@ const changeApprovalRecordsService = (api, params, filter, cm, compile, t, setDa const result = res.data?.data.map((item) => { const priorityType = ApprovalPriorityType.find((priorityItem) => priorityItem.value === item.snapshot.priority); const statusType = approvalTodoListStatus(item, t); - const categoryTitle = item.workflow.title.replace('审批流:', ''); + const categoryTitle = item.workflow.title; const collectionName = item.workflow?.config?.collection || item.execution?.context?.collectionName; const summary = Object.entries(item.summary)?.map(([key, value]) => { @@ -165,7 +165,7 @@ const changeUsersJobsService = (api, t, cm, compile, input, setData, params, fil (priorityItem) => priorityItem.value === item.execution.context?.data?.priority, ); const statusType = ExecutionStatusOptions.find((value) => value.value === item.status); - const categoryTitle = item.workflow.title.replace('审批流:', ''); + const categoryTitle = item.workflow.title; const nickName = item.execution?.context?.data?.createdBy?.nickname; return { ...item, @@ -225,7 +225,7 @@ export const changeWorkflowNoticeService = (api, t, cm, compile, input, setData, const priorityType = ApprovalPriorityType.find( (priorityItem) => priorityItem.value === item.snapshot?.priority, ); - const categoryTitle = item.workflow.title.replace('审批流:', ''); + const categoryTitle = item.workflow.title; const collectionName = item.collectionName; const summary = Object.entries(item.summary).map(([key, value]) => { const field = cm.getCollectionField(`${collectionName}.${key}`); diff --git a/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/usage/approval-block/launch/VC.ApprovalBlockLaunchApplication.tsx b/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/usage/approval-block/launch/VC.ApprovalBlockLaunchApplication.tsx index 96ed2c5d1..8db10c0f1 100644 --- a/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/usage/approval-block/launch/VC.ApprovalBlockLaunchApplication.tsx +++ b/packages/plugins/@tachybase/plugin-workflow/src/client/features/approval/usage/approval-block/launch/VC.ApprovalBlockLaunchApplication.tsx @@ -34,9 +34,26 @@ export const ApprovalBlockLaunchApplication = (props) => { resource: decorator?.collection, action: decorator?.action, params: { - pageSize: 99999, - filter: { ...decorator?.params?.filter }, + pagination: false, sort: 'createdAt', + filter: { + $and: [ + // NOTE: 将审批类型的且处于启用状态的筛选出来 + { + type: { + $eq: 'approval', + }, + }, + { + enabled: { + $eq: true, + }, + }, + { + ...decorator?.params?.filter, + }, + ], + }, }, }, { @@ -133,7 +150,7 @@ export const ApprovalBlockLaunchApplication = (props) => { onClick(item); }} > - {item.title.replace('审批流:', '')} + {item.title} );