From 2eab58e1ba7ec8c1a0b40b4962bb80fc9b0463f5 Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Wed, 10 May 2023 21:08:46 +0800 Subject: [PATCH] fix: enable link style --- .../antd/association-field/InternalViewer.tsx | 5 ++++- .../schema-component/antd/association-field/ReadPretty.tsx | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/association-field/InternalViewer.tsx b/packages/core/client/src/schema-component/antd/association-field/InternalViewer.tsx index b125c82594..1c1a1a8641 100644 --- a/packages/core/client/src/schema-component/antd/association-field/InternalViewer.tsx +++ b/packages/core/client/src/schema-component/antd/association-field/InternalViewer.tsx @@ -25,6 +25,7 @@ const toValue = (value, placeholder) => { export const ReadPrettyInternalViewer: React.FC = observer((props: any) => { const fieldSchema = useFieldSchema(); const recordCtx = useRecord(); + const { enableLink } = fieldSchema['x-component-props']; const { getCollectionJoinField } = useCollectionManager(); // value 做了转换,但 props.value 和原来 useField().value 的值不一致 const field = useField(); @@ -50,7 +51,7 @@ export const ReadPrettyInternalViewer: React.FC = observer((props: any) => { {snapshot || isTagsMode ? ( text - ) : ( + ) : enableLink!==false ? ( { e.stopPropagation(); @@ -63,6 +64,8 @@ export const ReadPrettyInternalViewer: React.FC = observer((props: any) => { > {text} + ) : ( + text )} {index < arr.length - 1 ? , : null} diff --git a/packages/core/client/src/schema-component/antd/association-field/ReadPretty.tsx b/packages/core/client/src/schema-component/antd/association-field/ReadPretty.tsx index 247ec58674..935e757017 100644 --- a/packages/core/client/src/schema-component/antd/association-field/ReadPretty.tsx +++ b/packages/core/client/src/schema-component/antd/association-field/ReadPretty.tsx @@ -33,9 +33,8 @@ export const ReadPretty = observer((props: any) => { } return ( - {['Select', 'Picker'].includes(currentMode) && enableLink !== false && } + {['Select', 'Picker'].includes(currentMode) && } {currentMode === 'Nester' && } - {['Select', 'Picker'].includes(currentMode) && enableLink === false && } {currentMode === 'SubTable' && } {currentMode === 'FileManager' && }