From ef8fd1dd3965cd5e6a4c3d74cbbd92ca4d961ea4 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Thu, 22 Sep 2022 19:16:23 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B5=D0=B1=D0=BE=D0=BB=D1=8C=D1=88?= =?UTF-8?q?=D0=B8=D0=B5=20=D1=83=D0=BB=D1=83=D1=87=D1=88=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Search/Search.vue | 32 +++++++++++++++++++---------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/client/components/Search/Search.vue b/client/components/Search/Search.vue index da6aeb6..f5c6546 100644 --- a/client/components/Search/Search.vue +++ b/client/components/Search/Search.vue @@ -150,6 +150,9 @@ +
+ +{{ hiddenCount }} результатов скрыты +
@@ -304,6 +307,7 @@ class Search { langList = []; genreTreeInpxHash = ''; cachedAuthors = {}; + hiddenCount = 0; limitOptions = [ {label: '10', value: 10}, @@ -396,6 +400,12 @@ class Search { `, 'Подсказка', {iconName: 'la la-info-circle'}); } + showHiddenHelp() { + this.$root.stdDialog.alert(` + Книги этих авторов помечены как удаленные. Для того, чтобы их увидеть, необходимо установить опцию "Показывать удаленные" в настройках. + `, 'Пояснение', {iconName: 'la la-info-circle'}); + } + showCollectionInfo() { this.$root.stdDialog.alert(`

@@ -508,19 +518,13 @@ class Search { getBookCount(item) { let result = ''; - if (!this.showCounts || item.bookCount === undefined) + if (!this.showCounts || item.count === undefined) return result; - if (this.showDeleted) { - result = item.bookCount + item.bookDelCount; - } else { - result = item.bookCount; - } - if (item.books) - result = `${item.books.length}/${result}`; + result = `${item.books.length}/${item.count}`; else - result = `#/${result}`; + result = `#/${item.count}`; return `(${result})`; } @@ -713,16 +717,22 @@ class Search { return; let num = 0; + this.hiddenCount = 0; for (const rec of authors) { this.cachedAuthors[rec.author] = rec; + const count = (this.showDeleted ? rec.bookCount + rec.bookDelCount : rec.bookCount); + if (!count) { + this.hiddenCount++; + continue; + } + const item = reactive({ key: rec.id, num, author: rec.author, name: rec.author.replace(/,/g, ', '), - bookCount: rec.bookCount, - bookDelCount: rec.bookDelCount, + count, book: false, }); num++;