Merge branch 'next' into develop

This commit is contained in:
nocobase[bot] 2025-04-25 07:09:54 +00:00
commit ce02f6e40e
3 changed files with 4 additions and 2 deletions

View File

@ -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 直接返回
}

View File

@ -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',

View File

@ -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<string, any>): Op
value: key,
key,
isLeaf: true,
operators: string,
};
});
};