From 0d55576fffc6707e2b5873f150267fcda924be2e Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Sun, 4 Feb 2024 20:13:54 +0800 Subject: [PATCH] refactor: collectionFieldInterfaceSelect --- .../components/CollectionFieldInterfaceSelect.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/plugins/@nocobase/plugin-data-source-manager/src/client/component/CollectionsManager/components/CollectionFieldInterfaceSelect.tsx b/packages/plugins/@nocobase/plugin-data-source-manager/src/client/component/CollectionsManager/components/CollectionFieldInterfaceSelect.tsx index 1498f457d9..a0f937ac43 100644 --- a/packages/plugins/@nocobase/plugin-data-source-manager/src/client/component/CollectionsManager/components/CollectionFieldInterfaceSelect.tsx +++ b/packages/plugins/@nocobase/plugin-data-source-manager/src/client/component/CollectionsManager/components/CollectionFieldInterfaceSelect.tsx @@ -1,5 +1,5 @@ import { observer, useForm, useField } from '@formily/react'; -import { Select } from 'antd'; +import { Select, Tag } from 'antd'; import React, { useState } from 'react'; import { useCompile, useCollectionManager, useRecord, useFieldInterfaceOptions } from '@nocobase/client'; @@ -27,9 +27,10 @@ export const CollectionFieldInterfaceSelect = observer( const form = useForm(); const field = useField(); const [options, setOptions] = useState(data); - return ( + return ['oho', 'obo', 'o2m', 'm2o', 'm2m'].includes(record.interface) ? ( + {options.find((v) => v.value === value)['label']} + ) : (