mirror of
https://github.com/sysadminsmedia/homebox.git
synced 2025-12-21 21:33:02 +01:00
Merge pull request #261
* Supplementary search, Resolve the issue of language not being supported
This commit is contained in:
@@ -156,11 +156,26 @@
|
||||
|
||||
const matches = index.value.search("*" + search.value + "*");
|
||||
|
||||
let resultIDs = []
|
||||
for (let i = 0; i < matches.length; i++) {
|
||||
const match = matches[i];
|
||||
const item = props.items[parseInt(match.ref)];
|
||||
const display = extractDisplay(item);
|
||||
list.push({ id: i, display, value: item });
|
||||
resultIDs.push(item.id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Supplementary search,
|
||||
* Resolve the issue of language not being supported
|
||||
*/
|
||||
for (let i = 0; i < props.items.length; i++) {
|
||||
const item = props.items[i]
|
||||
if(resultIDs.find(item_ => item_ === item.id) != undefined){continue}
|
||||
if(item.treeString.indexOf(search.value) > -1){
|
||||
const display = extractDisplay(item);
|
||||
list.push({ id: i, display, value: item });
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
|
||||
Reference in New Issue
Block a user