diff --git a/packages/core/client/src/schema-component/antd/record-picker/ReadPrettyRecordPicker.tsx b/packages/core/client/src/schema-component/antd/record-picker/ReadPrettyRecordPicker.tsx index b1972cd3d..3b37efddb 100644 --- a/packages/core/client/src/schema-component/antd/record-picker/ReadPrettyRecordPicker.tsx +++ b/packages/core/client/src/schema-component/antd/record-picker/ReadPrettyRecordPicker.tsx @@ -47,18 +47,21 @@ export const ReadPrettyRecordPicker: React.FC = observer((props: any) => { return ( - { - if (snapshot) return; - e.stopPropagation(); - e.preventDefault(); - setVisible(true); - setRecord(record); - ellipsisWithTooltipRef?.current?.setPopoverVisible(false); - }} - > - {getLabelFormatValue(labelUiSchema, val)} - + {snapshot ? ( + getLabelFormatValue(labelUiSchema, val) + ) : ( + { + e.stopPropagation(); + e.preventDefault(); + setVisible(true); + setRecord(record); + ellipsisWithTooltipRef?.current?.setPopoverVisible(false); + }} + > + {getLabelFormatValue(labelUiSchema, val)} + + )} {index < arr.length - 1 ? , : null} diff --git a/packages/core/client/src/schema-component/antd/select/ReadPretty.tsx b/packages/core/client/src/schema-component/antd/select/ReadPretty.tsx index 95fb7ac51..150a02724 100644 --- a/packages/core/client/src/schema-component/antd/select/ReadPretty.tsx +++ b/packages/core/client/src/schema-component/antd/select/ReadPretty.tsx @@ -3,6 +3,7 @@ import { observer, useField } from '@formily/react'; import { isValid } from '@formily/shared'; import { Tag } from 'antd'; import React from 'react'; +import { useCompile } from '../../hooks'; import { defaultFieldNames, getCurrentOptions } from './shared'; type Composed = { @@ -13,6 +14,8 @@ type Composed = { export const ReadPretty = observer((props: any) => { const fieldNames = { ...defaultFieldNames, ...props.fieldNames }; const field = useField(); + const compile = useCompile(); + if (!isValid(props.value)) { return
; } @@ -25,7 +28,7 @@ export const ReadPretty = observer((props: any) => {
{options.map((option, key) => ( - {option[fieldNames.label]} + {compile(option[fieldNames.label])} ))}