From 2d8dc8c04b0017928e29202c423730a67552b03f Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Thu, 20 Oct 2022 16:47:21 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=BB=D1=83=D1=87=D1=88=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=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=20BookView?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Search/BookView/BookView.vue | 23 ++++++++++++------- client/components/Search/Search.vue | 9 +++++++- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/client/components/Search/BookView/BookView.vue b/client/components/Search/BookView/BookView.vue index 89e4a32..0492a1d 100644 --- a/client/components/Search/BookView/BookView.vue +++ b/client/components/Search/BookView/BookView.vue @@ -31,9 +31,14 @@ -
+
{{ book.serno ? `${book.serno}. ` : '' }} - {{ bookTitle }} +
+ {{ bookAuthor }} +  -  + {{ book.title }} +
+ {{ book.title }}
@@ -106,15 +111,13 @@ class BookView { return this.$store.state.settings; } - get bookTitle() { + get bookAuthor() { if (this.showAuthor && this.book.author) { let a = this.book.author.split(','); - const author = a.slice(0, 2).join(', ') + (a.length > 2 ? ' и др.' : ''); - - return `${author} - ${this.book.title}`; - } else { - return this.book.title; + return a.slice(0, 2).join(', ') + (a.length > 2 ? ' и др.' : ''); } + + return ''; } get bookSize() { @@ -148,6 +151,10 @@ class BookView { return `(${result.join(' / ')})`; } + selectAuthor() { + this.$emit('bookEvent', {action: 'authorClick', book: this.book}); + } + selectTitle() { this.$emit('bookEvent', {action: 'titleClick', book: this.book}); } diff --git a/client/components/Search/Search.vue b/client/components/Search/Search.vue index abf8fbe..ea3ebe0 100644 --- a/client/components/Search/Search.vue +++ b/client/components/Search/Search.vue @@ -814,6 +814,10 @@ class Search { this.search.series = `=${series}`; } + selectTitle(title) { + this.search.title = `=${title}`; + } + async download(book, action) { if (this.downloadFlag) return; @@ -893,8 +897,11 @@ class Search { bookEvent(event) { switch (event.action) { + case 'authorClick': + this.selectAuthor(event.book.author); + break; case 'titleClick': - this.search.title = `=${event.book.title}`; + this.selectTitle(event.book.title); break; case 'download': case 'copyLink':