Skip to content

Commit

Permalink
Merge pull request #261
Browse files Browse the repository at this point in the history
* Supplementary search, Resolve the issue of language not being supported
  • Loading branch information
Jackxwb authored Oct 12, 2024
1 parent 65b2475 commit 888973e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions frontend/components/Form/Autocomplete2.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 888973e

Please sign in to comment.