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':