From f3353379cec8ace1d684b937008efde2c7934a55 Mon Sep 17 00:00:00 2001 From: wjh Date: Fri, 24 May 2024 14:54:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AE=8C=E5=96=84=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E6=91=98=E8=A6=81=E5=86=85=E5=AE=B9=20(#1051)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: sealday Reviewed-on: https://git.daoyoucloud.com/daoyoucloud/tachybase/pulls/1051 Co-authored-by: wjh Co-committed-by: wjh --- .../approval/todos/component/TabApprovalItem.tsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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 e10bd549d..0ffffdbec 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 @@ -1,13 +1,13 @@ import React, { useEffect, useState } from 'react'; -import { mergeFilter, useAPIClient, useCollectionManager, useCompile, useRequest } from '@tachybase/client'; -import { connect, observer, useFieldSchema } from '@tachybase/schema'; +import { useAPIClient, useCollectionManager, useCompile } from '@tachybase/client'; +import { observer } from '@tachybase/schema'; import { useAsyncEffect } from 'ahooks'; -import { Badge, Empty, List, Space, Tag } from 'antd-mobile'; +import { Empty, List, Space, Tag } from 'antd-mobile'; import { useNavigate } from 'react-router-dom'; import { APPROVAL_STATUS, ApprovalPriorityType, approvalStatusOptions } from '../../constants'; -import { tval, useTranslation } from '../../locale'; +import { useTranslation } from '../../locale'; export const TabApprovalItem = observer((props) => { const { filter, params, input } = props as any; @@ -17,6 +17,7 @@ export const TabApprovalItem = observer((props) => { const { t } = useTranslation(); const compile = useCompile(); const navigate = useNavigate(); + const cm = useCollectionManager(); useEffect(() => { if (input && defData.length) { const filterData = defData.filter((value) => value.title.includes(input)); @@ -44,10 +45,12 @@ export const TabApprovalItem = observer((props) => { ); const statusType = approvalTodoListStatus(item, t); const categoryTitle = item.workflow.title.replace('审批流:', ''); + 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}`); return { - label: compile(key), - value: value?.['name'] || value || '', + label: compile(field?.uiSchema?.title || key), + value: (Object.prototype.toString.call(value) === '[object Object]' ? value?.['name'] : value) || '', }; }); return {