mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:48:13 +08:00
fix: 修复 filterTree 深层级过滤失效的问题 (#3211)
* fix: 修复 filterTree 深层级过滤失效的问题 * 深度优先也要改一下
This commit is contained in:
parent
73a1e5f246
commit
ecc544e692
@ -891,11 +891,7 @@ export function filterTree<T extends TreeItem>(
|
||||
? filterTree(item.children, iterator, level + 1, depthFirst)
|
||||
: undefined;
|
||||
|
||||
if (
|
||||
Array.isArray(children) &&
|
||||
Array.isArray(item.children) &&
|
||||
children.length !== item.children.length
|
||||
) {
|
||||
if (Array.isArray(children) && Array.isArray(item.children)) {
|
||||
item = {...item, children: children};
|
||||
}
|
||||
|
||||
@ -915,11 +911,7 @@ export function filterTree<T extends TreeItem>(
|
||||
depthFirst
|
||||
);
|
||||
|
||||
if (
|
||||
Array.isArray(children) &&
|
||||
Array.isArray(item.children) &&
|
||||
children.length !== item.children.length
|
||||
) {
|
||||
if (Array.isArray(children) && Array.isArray(item.children)) {
|
||||
item = {...item, children: children};
|
||||
}
|
||||
}
|
||||
@ -1593,13 +1585,12 @@ export function JSONTraverse(
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
export function convertDateArrayToDate(
|
||||
value: number[],
|
||||
types: string[],
|
||||
date: moment.Moment
|
||||
): moment.Moment | null {
|
||||
if (value.length === 0) return date
|
||||
if (value.length === 0) return date;
|
||||
for (let i = 0; i < types.length; i++) {
|
||||
const type = types[i];
|
||||
// @ts-ignore
|
||||
@ -1625,4 +1616,4 @@ export function getRange(min: number, max: number, step: number = 1) {
|
||||
arr.push(i);
|
||||
}
|
||||
return arr;
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user