From 7786f0ad48e153c0aee0895aafe3752c1dfd16e7 Mon Sep 17 00:00:00 2001 From: chenos Date: Fri, 26 Mar 2021 16:11:34 +0800 Subject: [PATCH] field tooltip for view details --- .../src/components/pages/AdminLoader/View/Descriptions.tsx | 6 +++++- .../app/src/components/pages/AdminLoader/View/style.less | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/app/src/components/pages/AdminLoader/View/Descriptions.tsx b/packages/app/src/components/pages/AdminLoader/View/Descriptions.tsx index a254024e2..f40d32fc4 100644 --- a/packages/app/src/components/pages/AdminLoader/View/Descriptions.tsx +++ b/packages/app/src/components/pages/AdminLoader/View/Descriptions.tsx @@ -16,6 +16,7 @@ import Field from '@/components/views/Field'; import { Form } from './Form'; import { configResponsive, useResponsive } from 'ahooks'; import { InfoCircleOutlined } from '@ant-design/icons'; +import scopes from '@/components/views/Form/scopes'; configResponsive({ small: 0, @@ -102,8 +103,11 @@ export function Descriptions(props) { title={group.title && {group.title} {group.tooltip && }} column={1}> {group.children.map((field: any) => { + const label = field.tooltip ? ( + <> {field.title||field.name} + ) : (field.title||field.name); return ( - + ) diff --git a/packages/app/src/components/pages/AdminLoader/View/style.less b/packages/app/src/components/pages/AdminLoader/View/style.less index 4d8facaab..4132056df 100644 --- a/packages/app/src/components/pages/AdminLoader/View/style.less +++ b/packages/app/src/components/pages/AdminLoader/View/style.less @@ -13,6 +13,9 @@ .ant-drawer-footer { text-align: right; } +.ant-descriptions-view .ant-descriptions-item-container .ant-descriptions-item-label { + align-items: center; +} .page-tabs { .ant-tabs { margin: -24px -24px 8px;