From 295091d99ae1a9a3dece62c8c7188fad8ba894d4 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Tue, 11 Oct 2022 02:02:19 +0700 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20=D0=B2=D1=81=D0=B5=D1=85=20=D0=BA=D0=BD?= =?UTF-8?q?=D0=B8=D0=B3=20=D1=81=D0=B5=D1=80=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Search/BookView/BookView.vue | 3 +- client/components/Search/Search.vue | 41 +++++++++++++++---- 2 files changed, 35 insertions(+), 9 deletions(-) diff --git a/client/components/Search/BookView/BookView.vue b/client/components/Search/BookView/BookView.vue index 4e25e3b..4747371 100644 --- a/client/components/Search/BookView/BookView.vue +++ b/client/components/Search/BookView/BookView.vue @@ -33,7 +33,7 @@
{{ book.serno ? `${book.serno}. ` : '' }} - {{ bookTitle }} + {{ bookTitle }}
@@ -82,6 +82,7 @@ class BookView { book: Object, genreTree: Array, showAuthor: Boolean, + titleColor: { type: String, default: 'text-blue-10'}, }; showRate = true; diff --git a/client/components/Search/Search.vue b/client/components/Search/Search.vue index 35b409a..898e458 100644 --- a/client/components/Search/Search.vue +++ b/client/components/Search/Search.vue @@ -154,6 +154,7 @@
+
@@ -174,22 +175,36 @@
- +
-
-
- Показать только найденные +
+
+ + Показать только найденные книги
-
- Показать все книги серии +
+ + Показать все книги этой серии
+
@@ -206,7 +221,8 @@
-
+
+ Поиск не дал результатов
@@ -605,6 +621,7 @@ class Search { return; const curScrollTop = this.$refs.scroller.scrollTop; + if (!this.lastScrollTop) this.lastScrollTop = 0; if (!this.lastScrollTop2) @@ -613,7 +630,7 @@ class Search { if (curScrollTop - this.lastScrollTop > 0) { this.$refs.toolPanel.style.position = 'relative'; this.$refs.toolPanel.style.top = `${this.lastScrollTop2}px`; - } else if (curScrollTop - this.lastScrollTop <= 0) { + } else { this.$refs.toolPanel.style.position = 'sticky'; this.$refs.toolPanel.style.top = 0; this.lastScrollTop2 = curScrollTop; @@ -775,6 +792,14 @@ class Search { return this.expandedSeries.indexOf(seriesItem.key) >= 0; } + isFoundSeriesBook(book, subbook) { + if (!book.booksSet) { + book.booksSet = new Set(book.books.map(b => b.id)); + } + + return book.booksSet.has(subbook.id); + } + setSetting(name, newValue) { this.commit('setSettings', {[name]: _.cloneDeep(newValue)}); }