diff --git a/packages/core/client/src/schema-component/antd/linkageFilter/useValues.ts b/packages/core/client/src/schema-component/antd/linkageFilter/useValues.ts index 2f365fbadb..57fbd07501 100644 --- a/packages/core/client/src/schema-component/antd/linkageFilter/useValues.ts +++ b/packages/core/client/src/schema-component/antd/linkageFilter/useValues.ts @@ -44,7 +44,7 @@ const findOption = (str, options) => { // 进入下一层 children 查找 if (Array.isArray(option.children) || option.isLeaf === false) { - currentOptions = option.children || option.field.children; + currentOptions = option.children || option?.field?.children || []; } else { return option; // 没有 children 直接返回 } diff --git a/packages/core/client/src/schema-settings/VariableInput/__tests__/hooks/useURLSearchParamsVariable.test.ts b/packages/core/client/src/schema-settings/VariableInput/__tests__/hooks/useURLSearchParamsVariable.test.ts index 6635777047..3579de9a40 100644 --- a/packages/core/client/src/schema-settings/VariableInput/__tests__/hooks/useURLSearchParamsVariable.test.ts +++ b/packages/core/client/src/schema-settings/VariableInput/__tests__/hooks/useURLSearchParamsVariable.test.ts @@ -24,7 +24,7 @@ test('getURLSearchParamsChildren should return an array of options with expected const result = getURLSearchParamsChildren(queryParams); - expect(result).toEqual([ + expect(result).toMatchObject([ { label: 'param1', value: 'param1', diff --git a/packages/core/client/src/schema-settings/VariableInput/hooks/useURLSearchParamsVariable.ts b/packages/core/client/src/schema-settings/VariableInput/hooks/useURLSearchParamsVariable.ts index 966e55f687..e0c87a2e35 100644 --- a/packages/core/client/src/schema-settings/VariableInput/hooks/useURLSearchParamsVariable.ts +++ b/packages/core/client/src/schema-settings/VariableInput/hooks/useURLSearchParamsVariable.ts @@ -16,6 +16,7 @@ import { useLocationSearch } from '../../../application/CustomRouterContextProvi import { useFlag } from '../../../flag-provider/hooks/useFlag'; import { Option } from '../type'; import { getLabelWithTooltip } from './useBaseVariable'; +import { string } from '../../../collection-manager/interfaces/properties/operators'; export const getURLSearchParams = (search: string) => { if (search.startsWith('?')) { @@ -32,6 +33,7 @@ export const getURLSearchParamsChildren = (queryParams: Record): Op value: key, key, isLeaf: true, + operators: string, }; }); };