Работа над расширенным поиском

This commit is contained in:
Book Pauk
2022-12-07 18:16:09 +07:00
parent 0867e4020f
commit 3a26a12807
4 changed files with 18 additions and 6 deletions

View File

@@ -33,7 +33,7 @@
</div> </div>
<div class="q-ml-sm column"> <div class="q-ml-sm column">
<div v-if="(mode == 'series' || mode == 'title') && bookAuthor" class="row"> <div v-if="(mode == 'series' || mode == 'title' || mode == 'extended') && bookAuthor" class="row">
<div class="clickable2 text-green-10" @click.stop.prevent="emit('authorClick')"> <div class="clickable2 text-green-10" @click.stop.prevent="emit('authorClick')">
{{ bookAuthor }} {{ bookAuthor }}
</div> </div>
@@ -46,7 +46,7 @@
<div class="clickable2" :class="titleColor" @click.stop.prevent="emit('titleClick')"> <div class="clickable2" :class="titleColor" @click.stop.prevent="emit('titleClick')">
{{ book.title }} {{ book.title }}
</div> </div>
<div v-if="mode == 'title' && bookSeries" class="q-ml-xs clickable2" @click.stop.prevent="emit('seriesClick')"> <div v-if="(mode == 'title' || mode == 'extended') && bookSeries" class="q-ml-xs clickable2" @click.stop.prevent="emit('seriesClick')">
{{ bookSeries }} {{ bookSeries }}
</div> </div>
@@ -79,10 +79,10 @@
{{ bookDate }} {{ bookDate }}
</div> </div>
</div> </div>
</div>
<div v-show="false"> <div v-show="showJson && mode == 'extended'">
{{ book }} <pre style="font-size: 80%">{{ book }}</pre>
</div>
</div> </div>
</div> </div>
</template> </template>
@@ -117,6 +117,7 @@ class BookView {
showGenres = true; showGenres = true;
showDeleted = false; showDeleted = false;
showDates = false; showDates = false;
showJson = false;
created() { created() {
this.loadSettings(); this.loadSettings();
@@ -130,6 +131,7 @@ class BookView {
this.showGenres = settings.showGenres; this.showGenres = settings.showGenres;
this.showDates = settings.showDates; this.showDates = settings.showDates;
this.showDeleted = settings.showDeleted; this.showDeleted = settings.showDeleted;
this.showJson = settings.showJson;
} }
get settings() { get settings() {

View File

@@ -9,7 +9,7 @@
<div v-for="item in tableData" :key="item.key" class="column" :class="{'odd-item': item.num % 2}" style="font-size: 120%"> <div v-for="item in tableData" :key="item.key" class="column" :class="{'odd-item': item.num % 2}" style="font-size: 120%">
<BookView <BookView
class="q-ml-md" class="q-ml-md"
:book="item.book" mode="title" :genre-map="genreMap" :show-read-link="showReadLink" @book-event="bookEvent" :book="item.book" mode="extended" :genre-map="genreMap" :show-read-link="showReadLink" @book-event="bookEvent"
/> />
</div> </div>
<!-- Формирование списка конец ------------------------------------------------------------------> <!-- Формирование списка конец ------------------------------------------------------------------>

View File

@@ -227,6 +227,10 @@
<div v-show="list.totalFound > 0" class="text-bold" style="font-size: 120%; padding-bottom: 2px"> <div v-show="list.totalFound > 0" class="text-bold" style="font-size: 120%; padding-bottom: 2px">
{{ foundCountMessage }} {{ foundCountMessage }}
</div> </div>
<div v-show="list.totalFound > 0 && isExtendedSearch" class="q-ml-md">
<q-checkbox v-model="showJson" size="36px" label="Показывать JSON" />
</div>
</div> </div>
<!-- Формирование списка ------------------------------------------------------------------------> <!-- Формирование списка ------------------------------------------------------------------------>
@@ -361,6 +365,9 @@ const componentOptions = {
langDefault() { langDefault() {
this.updateSearchFromRouteQuery(this.$route); this.updateSearchFromRouteQuery(this.$route);
}, },
showJson(newValue) {
this.setSetting('showJson', newValue);
},
list: { list: {
handler(newValue) { handler(newValue) {
this.updateGenreTreeIfNeeded(); this.updateGenreTreeIfNeeded();
@@ -433,6 +440,7 @@ class Search {
langDefault = ''; langDefault = '';
limit = 20; limit = 20;
extendedParams = false; extendedParams = false;
showJson = false;
//stuff //stuff
prevList = {}; prevList = {};
@@ -525,6 +533,7 @@ class Search {
this.expandedSeries = _.cloneDeep(settings.expandedSeries); this.expandedSeries = _.cloneDeep(settings.expandedSeries);
this.abCacheEnabled = settings.abCacheEnabled; this.abCacheEnabled = settings.abCacheEnabled;
this.langDefault = settings.langDefault; this.langDefault = settings.langDefault;
this.showJson = settings.showJson;
} }
recvMessage(d) { recvMessage(d) {

View File

@@ -16,6 +16,7 @@ const state = {
showDeleted: false, showDeleted: false,
abCacheEnabled: true, abCacheEnabled: true,
langDefault: '', langDefault: '',
showJson: false,
}, },
}; };