diff --git a/client/components/Search/AuthorList/AuthorList.vue b/client/components/Search/AuthorList/AuthorList.vue new file mode 100644 index 0000000..f8be95c --- /dev/null +++ b/client/components/Search/AuthorList/AuthorList.vue @@ -0,0 +1,911 @@ + + + + + + + + + + + + + + + + + + + + + + + {{ item.name }} + + + + {{ getBookCount(item) }} + + + + + + + Обработка... + + + + + + + + + + + + + + + + + + + + + Серия: {{ book.series }} + + + + + + + + + + + + + + + + Показать еще (~{{ showMoreCount }}) + + + Показать все ({{ (book.allBooksLoaded && book.allBooksLoaded.length) || '?' }}) + + + + + + Только найденные книги + + + + Все книги серии + + + + + + + + + + + По каждому из заданных критериев у этого автора были найдены разные книги, но нет полного совпадения + + + + + + + Показать еще (~{{ showMoreCount }}) + + + Показать все ({{ (item.booksLoaded && item.booksLoaded.length) || '?' }}) + + + + + + + + Поиск не дал результатов + + + + + {{ hiddenResultsMessage }} + + + + + + + + diff --git a/client/components/Search/BaseList.js b/client/components/Search/BaseList.js new file mode 100644 index 0000000..4053afe --- /dev/null +++ b/client/components/Search/BaseList.js @@ -0,0 +1,2 @@ +export default class BaseList { +} \ No newline at end of file diff --git a/client/components/Search/BookView/BookView.vue b/client/components/Search/BookView/BookView.vue index 0492a1d..300cad5 100644 --- a/client/components/Search/BookView/BookView.vue +++ b/client/components/Search/BookView/BookView.vue @@ -85,7 +85,7 @@ class BookView { _options = componentOptions; _props = { book: Object, - genreTree: Array, + genreMap: Object, showAuthor: Boolean, showReadLink: Boolean, titleColor: { type: String, default: 'text-blue-10'}, @@ -140,12 +140,12 @@ class BookView { get bookGenre() { let result = []; - const genre = new Set(this.book.genre.split(',')); + const genre = this.book.genre.split(','); - for (const section of this.genreTree) { - for (const g of section.value) - if (genre.has(g.value)) - result.push(g.name); + for (const g of genre) { + const name = this.genreMap.get(g); + if (name) + result.push(name); } return `(${result.join(' / ')})`; diff --git a/client/components/Search/LoadingMessage/LoadingMessage.vue b/client/components/Search/LoadingMessage/LoadingMessage.vue new file mode 100644 index 0000000..cc5d3ee --- /dev/null +++ b/client/components/Search/LoadingMessage/LoadingMessage.vue @@ -0,0 +1,33 @@ + + + + + + {{ message }} + + + + + + + + diff --git a/client/components/Search/Search.vue b/client/components/Search/Search.vue index 50561ef..582b646 100644 --- a/client/components/Search/Search.vue +++ b/client/components/Search/Search.vue @@ -1,23 +1,5 @@ - - - - - - {{ loadingMessage }} - - - - - - - - {{ loadingMessage2 }} - - - - @@ -114,10 +96,10 @@ - + {{ foundAuthorsMessage }} - + Ничего не найдено @@ -129,133 +111,9 @@ - - - - - - - - - - - - - - - {{ item.name }} - - - - {{ getBookCount(item) }} - - - - - - - Обработка... - - - - - - - - - - - - - - - - - - - - - Серия: {{ book.series }} - - - - - - - - - - - - - - - - Показать еще (~{{ showMoreCount }}) - - - Показать все ({{ (book.allBooksLoaded && book.allBooksLoaded.length) || '?' }}) - - - - - - Только найденные книги - - - - Все книги серии - - - - - - - - - - - По каждому из заданных критериев у этого автора были найдены разные книги, но нет полного совпадения - - - - - - - Показать еще (~{{ showMoreCount }}) - - - Показать все ({{ (item.booksLoaded && item.booksLoaded.length) || '?' }}) - - - + - - - Поиск не дал результатов - - - - - {{ hiddenResultsMessage }} - - - @@ -304,12 +162,12 @@