mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 23:06:06 +08:00
日志搜索忽略大小写
This commit is contained in:
parent
b6042c7e46
commit
8df18342c0
|
@ -11,13 +11,13 @@ function getFilterData(keyword: string, data: any) {
|
|||
if (keyword) {
|
||||
const tree: any = [];
|
||||
data.forEach((item: any) => {
|
||||
if (item.title.includes(keyword)) {
|
||||
if (item.title.toLocaleLowerCase().includes(keyword)) {
|
||||
tree.push(item);
|
||||
expandedKeys.push(...item.children.map((x: any) => x.key));
|
||||
} else {
|
||||
const children: any[] = [];
|
||||
(item.children || []).forEach((subItem: any) => {
|
||||
if (subItem.title.includes(keyword)) {
|
||||
if (subItem.title.toLocaleLowerCase().includes(keyword)) {
|
||||
children.push(subItem);
|
||||
}
|
||||
});
|
||||
|
@ -95,7 +95,7 @@ const Log = () => {
|
|||
const onSearch = useCallback(
|
||||
(e) => {
|
||||
const keyword = e.target.value;
|
||||
const { tree } = getFilterData(keyword, data);
|
||||
const { tree } = getFilterData(keyword.toLocaleLowerCase(), data);
|
||||
setFilterData(tree);
|
||||
},
|
||||
[data, setFilterData],
|
||||
|
|
Loading…
Reference in New Issue
Block a user