From 4cacecc13b28ebe617ae8f7e0f1346e246e89641 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Wed, 26 Oct 2022 21:32:08 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20=D0=BD?= =?UTF-8?q?=D0=B0=D0=B4=20TitleList?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Search/AuthorList/AuthorList.vue | 6 +- client/components/Search/BaseList.js | 3 + .../components/Search/BookView/BookView.vue | 31 +++- .../Search/LoadingMessage/LoadingMessage.vue | 2 +- client/components/Search/Search.vue | 5 +- .../Search/SeriesList/SeriesList.vue | 6 +- .../components/Search/TitleList/TitleList.vue | 158 ++++++++++++++++++ client/share/utils.js | 2 + 8 files changed, 203 insertions(+), 10 deletions(-) create mode 100644 client/components/Search/TitleList/TitleList.vue diff --git a/client/components/Search/AuthorList/AuthorList.vue b/client/components/Search/AuthorList/AuthorList.vue index edd37fd..227b2e5 100644 --- a/client/components/Search/AuthorList/AuthorList.vue +++ b/client/components/Search/AuthorList/AuthorList.vue @@ -6,7 +6,7 @@ -
+
@@ -106,7 +106,7 @@
- По каждому из заданных критериев у этого автора были найдены разные книги, но нет полного совпадения + По каждому из заданных критериев у этого автора были найдены разные книги, но нет полного совпадения
@@ -456,7 +456,7 @@ export default vueComponent(AuthorList); cursor: pointer; } -.odd-author { +.odd-item { background-color: #e8e8e8; } diff --git a/client/components/Search/BaseList.js b/client/components/Search/BaseList.js index ced73a1..707286e 100644 --- a/client/components/Search/BaseList.js +++ b/client/components/Search/BaseList.js @@ -198,6 +198,9 @@ export default class BaseList { case 'authorClick': this.selectAuthor(event.book.author); break; + case 'seriesClick': + this.selectSeries(event.book.series); + break; case 'titleClick': this.selectTitle(event.book.title); break; diff --git a/client/components/Search/BookView/BookView.vue b/client/components/Search/BookView/BookView.vue index 300cad5..be013a3 100644 --- a/client/components/Search/BookView/BookView.vue +++ b/client/components/Search/BookView/BookView.vue @@ -31,7 +31,7 @@
-
+
{{ book.serno ? `${book.serno}. ` : '' }}
{{ bookAuthor }} @@ -40,6 +40,20 @@
{{ book.title }}
+
+ {{ book.title }} + +
+  -  +
+ {{ bookAuthor }} +   +
+
+ {{ bookSeries }} +
+
+
@@ -88,6 +102,7 @@ class BookView { genreMap: Object, showAuthor: Boolean, showReadLink: Boolean, + titleList: Boolean, titleColor: { type: String, default: 'text-blue-10'}, }; @@ -112,7 +127,7 @@ class BookView { } get bookAuthor() { - if (this.showAuthor && this.book.author) { + if ((this.showAuthor || this.titleList) && this.book.author) { let a = this.book.author.split(','); return a.slice(0, 2).join(', ') + (a.length > 2 ? ' и др.' : ''); } @@ -120,6 +135,14 @@ class BookView { return ''; } + get bookSeries() { + if (this.book.series) { + return `(${this.book.series})`; + } + + return ''; + } + get bookSize() { let size = this.book.size/1024; let unit = 'KB'; @@ -155,6 +178,10 @@ class BookView { this.$emit('bookEvent', {action: 'authorClick', book: this.book}); } + selectSeries() { + this.$emit('bookEvent', {action: 'seriesClick', book: this.book}); + } + selectTitle() { this.$emit('bookEvent', {action: 'titleClick', book: this.book}); } diff --git a/client/components/Search/LoadingMessage/LoadingMessage.vue b/client/components/Search/LoadingMessage/LoadingMessage.vue index cc5d3ee..e6d20f9 100644 --- a/client/components/Search/LoadingMessage/LoadingMessage.vue +++ b/client/components/Search/LoadingMessage/LoadingMessage.vue @@ -1,5 +1,5 @@ + + + + diff --git a/client/share/utils.js b/client/share/utils.js index 0b497d9..0cfc4b3 100644 --- a/client/share/utils.js +++ b/client/share/utils.js @@ -40,6 +40,8 @@ export function wordEnding(num, type = 0) { ['о', '', 'о', 'о', 'о', 'о', 'о', 'о', 'о', 'о'], ['ий', 'ие', 'ия', 'ия', 'ия', 'ий', 'ий', 'ий', 'ий', 'ий'], ['о', 'а', 'о', 'о', 'о', 'о', 'о', 'о', 'о', 'о'], + ['ок', 'ка', 'ки', 'ки', 'ки', 'ок', 'ок', 'ок', 'ок', 'ок'], + ['ых', 'ое', 'ых', 'ых', 'ых', 'ых', 'ых', 'ых', 'ых', 'ых'], ]; const deci = num % 100; if (deci > 10 && deci < 20) {