From 4182140f13849aae1f81d3f89566f70401cd8808 Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Sun, 4 Feb 2024 14:13:38 +0800 Subject: [PATCH] fix: remoteSelect support data-source --- .../src/schema-component/antd/remote-select/RemoteSelect.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/core/client/src/schema-component/antd/remote-select/RemoteSelect.tsx b/packages/core/client/src/schema-component/antd/remote-select/RemoteSelect.tsx index f519ebb6c0..f7f6058ecd 100644 --- a/packages/core/client/src/schema-component/antd/remote-select/RemoteSelect.tsx +++ b/packages/core/client/src/schema-component/antd/remote-select/RemoteSelect.tsx @@ -7,6 +7,8 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { ResourceActionOptions, useRequest } from '../../../api-client'; import { useCollection, useCollectionManager } from '../../../collection-manager'; import { mergeFilter } from '../../../filter-provider/utils'; +import { useDataSourceHeaders } from '../../../'; +import { useCollectionDataSourceName } from '../../../application/collection/CollectionDataSourceProvider'; import { useCompile } from '../../hooks'; import { Select, defaultFieldNames } from '../select'; import { ReadPretty } from './ReadPretty'; @@ -41,6 +43,8 @@ const InternalRemoteSelect = connect( optionFilter, ...others } = props; + const dataSource = useCollectionDataSourceName(); + const headers = useDataSourceHeaders(dataSource); const [open, setOpen] = useState(false); const firstRun = useRef(false); const fieldSchema = useFieldSchema(); @@ -130,6 +134,7 @@ const InternalRemoteSelect = connect( { action: 'list', ...service, + headers, params: { pageSize: 200, ...service?.params,