Skip to content

Commit

Permalink
Merge pull request #28 from beclab/feat/search
Browse files Browse the repository at this point in the history
fix: Optimize search function
  • Loading branch information
wushuangs authored Aug 9, 2024
2 parents c5747a3 + 7879789 commit b0ae473
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
18 changes: 2 additions & 16 deletions packages/frontend/src/pages/Search/IndexPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
<text-search
v-else-if="searchType === SearchType.TextSearch"
:item="filesItem"
:handSearchFiles="handSearchFiles"
:commandList="commandList"
@goBack="goBack"
@openCommand="openCommand"
/>

<files-component
Expand Down Expand Up @@ -99,24 +99,10 @@ const openCommand = (item?: any) => {
if (item && item.type === 'Command') {
searchType.value = SearchType.TextSearch;
filesItem.value = item;
handSearchFiles.value = item.searchFiles;
} else {
openWindow(item);
}
// if (
// item &&
// (item.name === SearchType.AshiaPage ||
// item.name === SearchType.FilesPage ||
// item.name === SearchType.AshiaDocPage)
// ) {
// searchType.value = item.name;
// filesItem.value = null;
// if (item.name === 'Files Search' && item.searchFiles) {
// handSearchFiles.value = item.searchFiles;
// }
// } else {
// openWindow(item);
// }
};
const openWindow = async (item: any) => {
Expand Down
1 change: 1 addition & 0 deletions packages/frontend/src/pages/Search/TextSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ const handleClear = () => {
onMounted(async () => {
filesRef.value && filesRef.value.focus();
if (props.handSearchFiles) searchFiles.value = props.handSearchFiles;
window.addEventListener('keydown', keydownEnter);
});
Expand Down

0 comments on commit b0ae473

Please sign in to comment.