field tooltip for view details

This commit is contained in:
chenos 2021-03-26 16:11:34 +08:00
parent 8fafdf077d
commit 7786f0ad48
2 changed files with 8 additions and 1 deletions

View File

@ -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 && <span>{group.title} {group.tooltip && <Tooltip title={group.tooltip}><InfoCircleOutlined /></Tooltip>}</span>}
column={1}>
{group.children.map((field: any) => {
const label = field.tooltip ? (
<><Tooltip title={field.tooltip}><InfoCircleOutlined /></Tooltip>&nbsp;{field.title||field.name}</>
) : (field.title||field.name);
return (
<AntdDescriptions.Item label={field.title||field.name}>
<AntdDescriptions.Item label={label}>
<Field data={data} viewType={'descriptions'} schema={field} value={get(data, field.name)}/>
</AntdDescriptions.Item>
)

View File

@ -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;