fix: cascader filter (#940)

Co-authored-by: sealday <sealday@gmail.com>
Reviewed-on: daoyoucloud/tachybase#940
This commit is contained in:
sealday 2024-05-09 01:56:16 +08:00
parent 2880203b99
commit be802543a4
3 changed files with 5 additions and 2 deletions

View File

@ -791,6 +791,7 @@
"Restart": "Restart",
"Restart application": "Restart application",
"Cascade Select": "Cascade Select",
"Cascader": "Cascader",
"Execute": "Execute",
"Please use a valid SELECT or WITH AS statement": "Please use a valid SELECT or WITH AS statement",
"Please confirm the SQL statement first": "Please confirm the SQL statement first",

View File

@ -850,6 +850,7 @@
"UnSelect all": "取消全选",
"Determine whether a record exists by the following fields": "通过以下字段判断记录是否存在",
"Cascade Select": "级联选择",
"Cascader": "级联选择",
"Execute": "执行",
"Please use a valid SELECT or WITH AS statement": "请使用有效的 SELECT 或 WITH AS 语句",
"Please confirm the SQL statement first": "请先确认 SQL 语句",

View File

@ -125,8 +125,9 @@ const Cascade = connect((props) => {
}
};
const filter = (inputValue: string, path) =>
path.some((option) => fuzzysearch(inputValue, (option.label as string) ?? ''));
const filter = (inputValue: string, path) => {
return fuzzysearch(inputValue, path.map((option) => option.label || '').join(''));
};
return (
<Space
wrap