Добавлена настройка "Показывать жанры"

This commit is contained in:
Book Pauk
2022-09-25 13:44:58 +07:00
parent 5e3fe21c25
commit 1cfa787e5a
3 changed files with 24 additions and 1 deletions

View File

@@ -17,7 +17,7 @@
<q-icon name="la la-copy" size="20px" /> <q-icon name="la la-copy" size="20px" />
</div> </div>
<div class="q-ml-sm"> <div v-if="showGenres" class="q-ml-sm">
{{ bookGenre }} {{ bookGenre }}
</div> </div>
@@ -33,6 +33,9 @@ const componentOptions = {
components: { components: {
}, },
watch: { watch: {
settings() {
this.loadSettings();
},
} }
}; };
class BookView { class BookView {
@@ -42,7 +45,20 @@ class BookView {
genreTree: Array, genreTree: Array,
}; };
showGenres = true;
created() { created() {
this.loadSettings();
}
loadSettings() {
const settings = this.settings;
this.showGenres = settings.showGenres;
}
get settings() {
return this.$store.state.settings;
} }
get bookSize() { get bookSize() {

View File

@@ -208,6 +208,7 @@
</div> </div>
<q-checkbox v-model="showCounts" size="36px" label="Показывать количество" /> <q-checkbox v-model="showCounts" size="36px" label="Показывать количество" />
<q-checkbox v-model="showGenres" size="36px" label="Показывать жанры" />
<q-checkbox v-model="showDeleted" size="36px" label="Показывать удаленные" /> <q-checkbox v-model="showDeleted" size="36px" label="Показывать удаленные" />
<q-checkbox v-model="abCacheEnabled" size="36px" label="Кешировать запросы" /> <q-checkbox v-model="abCacheEnabled" size="36px" label="Кешировать запросы" />
</div> </div>
@@ -276,6 +277,9 @@ const componentOptions = {
showCounts(newValue) { showCounts(newValue) {
this.setSetting('showCounts', newValue); this.setSetting('showCounts', newValue);
}, },
showGenres(newValue) {
this.setSetting('showGenres', newValue);
},
showDeleted(newValue) { showDeleted(newValue) {
this.setSetting('showDeleted', newValue); this.setSetting('showDeleted', newValue);
this.updateTableData(); this.updateTableData();
@@ -326,6 +330,7 @@ class Search {
expanded = []; expanded = [];
expandedSeries = []; expandedSeries = [];
showCounts = true; showCounts = true;
showGenres = true;
showDeleted = false; showDeleted = false;
abCacheEnabled = true; abCacheEnabled = true;
langDefault = ''; langDefault = '';
@@ -389,6 +394,7 @@ class Search {
this.expanded = _.cloneDeep(settings.expanded); this.expanded = _.cloneDeep(settings.expanded);
this.expandedSeries = _.cloneDeep(settings.expandedSeries); this.expandedSeries = _.cloneDeep(settings.expandedSeries);
this.showCounts = settings.showCounts; this.showCounts = settings.showCounts;
this.showGenres = settings.showGenres;
this.showDeleted = settings.showDeleted; this.showDeleted = settings.showDeleted;
this.abCacheEnabled = settings.abCacheEnabled; this.abCacheEnabled = settings.abCacheEnabled;
this.langDefault = settings.langDefault; this.langDefault = settings.langDefault;

View File

@@ -6,6 +6,7 @@ const state = {
expanded: [], expanded: [],
expandedSeries: [], expandedSeries: [],
showCounts: true, showCounts: true,
showGenres: true,
showDeleted: false, showDeleted: false,
abCacheEnabled: true, abCacheEnabled: true,
langDefault: '', langDefault: '',