From 8f8f9e4af2de5d47c89370f630d09e4582470001 Mon Sep 17 00:00:00 2001 From: Katherine Date: Thu, 12 Dec 2024 16:34:51 +0800 Subject: [PATCH] fix: issue where file table selector is not display in non-configuration mode when using file select (#5874) --- .../antd/association-field/FileManager.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/association-field/FileManager.tsx b/packages/core/client/src/schema-component/antd/association-field/FileManager.tsx index 05c778d18b..1e46b28daa 100644 --- a/packages/core/client/src/schema-component/antd/association-field/FileManager.tsx +++ b/packages/core/client/src/schema-component/antd/association-field/FileManager.tsx @@ -171,12 +171,19 @@ const InternalFileManager = (props) => { if (designable) { insertSelector(schema.Selector); } else { - fieldSchema.addProperty('selector', schema.Selector); + const selectSchema = fieldSchema.reduceProperties((buf, s) => { + if (s['x-component'] === 'AssociationField.Selector') { + return s; + } + return buf; + }, null); + if (!selectSchema) { + fieldSchema.addProperty('selector', schema.Selector); + } } setVisibleSelector(true); setSelectedRows([]); }; - useEffect(() => { if (value && Object.keys(value).length > 0) { const opts = (Array.isArray(value) ? value : value ? [value] : []).filter(Boolean).map((option) => {