Работа над расширенным поиском

This commit is contained in:
Book Pauk
2022-12-06 19:03:49 +07:00
parent 51b325d63c
commit 5faa6a1e8f
5 changed files with 37 additions and 1 deletions

View File

@@ -235,6 +235,10 @@ class Api {
return await this.request({action: 'search', from, query}, 30);
}
async bookSearch(query) {
return await this.request({action: 'bookSearch', query}, 30);
}
async getAuthorBookList(authorId) {
return await this.request({action: 'get-author-book-list', authorId});
}

View File

@@ -256,6 +256,7 @@ const route2component = {
'author': {component: 'AuthorList', label: 'Авторы'},
'series': {component: 'SeriesList', label: 'Серии'},
'title': {component: 'TitleList', label: 'Книги'},
'extended': {component: 'TitleList', label: 'Расширенный поиск'},
};
const componentOptions = {
@@ -529,7 +530,13 @@ class Search {
get listOptions() {
const result = [];
for (const [route, rec] of Object.entries(route2component))
result.push({label: rec.label, value: route});
if (route == 'extended') {
if (this.config.extendedSearch) {
result.push({value: route, icon: 'la la-code', size: '10px'});
}
} else {
result.push({label: rec.label, value: route, icon: rec.icon});
}
return result;
}

View File

@@ -8,6 +8,7 @@ const myRoutes = [
['/author', Search],
['/series', Search],
['/title', Search],
['/extended', Search],
['/:pathMatch(.*)*', null, null, '/'],
];