|
@@ -30,6 +30,16 @@
|
|
</q-tooltip>
|
|
</q-tooltip>
|
|
</DivBtn>
|
|
</DivBtn>
|
|
|
|
|
|
|
|
+ <q-btn-toggle
|
|
|
|
+ v-model="selectedList"
|
|
|
|
+ class="q-ml-md"
|
|
|
|
+ toggle-color="primary"
|
|
|
|
+ :options="listOptions"
|
|
|
|
+ push
|
|
|
|
+ no-caps
|
|
|
|
+ rounded
|
|
|
|
+ />
|
|
|
|
+
|
|
<div class="col"></div>
|
|
<div class="col"></div>
|
|
<div class="q-px-sm q-py-xs bg-green-12 clickable2" style="border: 1px solid #aaaaaa; border-radius: 6px" @click="openReleasePage">
|
|
<div class="q-px-sm q-py-xs bg-green-12 clickable2" style="border: 1px solid #aaaaaa; border-radius: 6px" @click="openReleasePage">
|
|
{{ projectName }}
|
|
{{ projectName }}
|
|
@@ -111,7 +121,7 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- Формирование списка ------------------------------------------------------------------------>
|
|
<!-- Формирование списка ------------------------------------------------------------------------>
|
|
- <AuthorList :ready="ready" :list="list" :search="search" :genre-map="genreMap" @list-event="listEvent" />
|
|
|
|
|
|
+ <component :is="selectedListComponent" v-if="selectedListComponent" :list="list" :search="search" :genre-map="genreMap" @list-event="listEvent" />
|
|
<!-- Формирование списка конец ------------------------------------------------------------------>
|
|
<!-- Формирование списка конец ------------------------------------------------------------------>
|
|
|
|
|
|
<div class="row justify-center">
|
|
<div class="row justify-center">
|
|
@@ -164,6 +174,7 @@
|
|
import vueComponent from '../vueComponent.js';
|
|
import vueComponent from '../vueComponent.js';
|
|
|
|
|
|
import AuthorList from './AuthorList/AuthorList.vue';
|
|
import AuthorList from './AuthorList/AuthorList.vue';
|
|
|
|
+import SeriesList from './SeriesList/SeriesList.vue';
|
|
|
|
|
|
import PageScroller from './PageScroller/PageScroller.vue';
|
|
import PageScroller from './PageScroller/PageScroller.vue';
|
|
import SelectGenreDialog from './SelectGenreDialog/SelectGenreDialog.vue';
|
|
import SelectGenreDialog from './SelectGenreDialog/SelectGenreDialog.vue';
|
|
@@ -178,9 +189,16 @@ import diffUtils from '../../share/diffUtils';
|
|
|
|
|
|
import _ from 'lodash';
|
|
import _ from 'lodash';
|
|
|
|
|
|
|
|
+const route2component = {
|
|
|
|
+ 'author': {component: 'AuthorList', label: 'Авторы'},
|
|
|
|
+ 'series': {component: 'SeriesList', label: 'Серии'},
|
|
|
|
+ //'book': 'BookList',
|
|
|
|
+};
|
|
|
|
+
|
|
const componentOptions = {
|
|
const componentOptions = {
|
|
components: {
|
|
components: {
|
|
AuthorList,
|
|
AuthorList,
|
|
|
|
+ SeriesList,
|
|
PageScroller,
|
|
PageScroller,
|
|
SelectGenreDialog,
|
|
SelectGenreDialog,
|
|
SelectLangDialog,
|
|
SelectLangDialog,
|
|
@@ -229,6 +247,7 @@ const componentOptions = {
|
|
this.setSetting('abCacheEnabled', newValue);
|
|
this.setSetting('abCacheEnabled', newValue);
|
|
},
|
|
},
|
|
$route(to) {
|
|
$route(to) {
|
|
|
|
+ this.updateListFromRoute(to);
|
|
this.updateSearchFromRouteQuery(to);
|
|
this.updateSearchFromRouteQuery(to);
|
|
},
|
|
},
|
|
langDefault() {
|
|
langDefault() {
|
|
@@ -245,6 +264,13 @@ const componentOptions = {
|
|
},
|
|
},
|
|
deep: true,
|
|
deep: true,
|
|
},
|
|
},
|
|
|
|
+ selectedList(newValue) {
|
|
|
|
+ this.selectedListComponent = (route2component[newValue] ? route2component[newValue].component : null);
|
|
|
|
+
|
|
|
|
+ if (this.getListRoute() != newValue) {
|
|
|
|
+ this.updateRouteQueryFromSearch();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
},
|
|
},
|
|
};
|
|
};
|
|
class Search {
|
|
class Search {
|
|
@@ -252,6 +278,9 @@ class Search {
|
|
|
|
|
|
ready = false;
|
|
ready = false;
|
|
|
|
|
|
|
|
+ selectedList = '';
|
|
|
|
+ selectedListComponent = '';
|
|
|
|
+
|
|
collection = '';
|
|
collection = '';
|
|
projectName = '';
|
|
projectName = '';
|
|
|
|
|
|
@@ -339,6 +368,7 @@ class Search {
|
|
this.$refs.authorInput.focus();
|
|
this.$refs.authorInput.focus();
|
|
|
|
|
|
this.setDefaults();
|
|
this.setDefaults();
|
|
|
|
+ this.updateListFromRoute(this.$route);
|
|
this.updateSearchFromRouteQuery(this.$route);
|
|
this.updateSearchFromRouteQuery(this.$route);
|
|
|
|
|
|
this.sendMessage({type: 'mes', data: 'hello-from-inpx-web'});
|
|
this.sendMessage({type: 'mes', data: 'hello-from-inpx-web'});
|
|
@@ -403,6 +433,27 @@ class Search {
|
|
return result.join(', ');
|
|
return result.join(', ');
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ get listOptions() {
|
|
|
|
+ const result = [];
|
|
|
|
+ for (const [route, rec] of Object.entries(route2component))
|
|
|
|
+ result.push({label: rec.label, value: route});
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ async updateListFromRoute(to) {
|
|
|
|
+ const newPath = to.path;
|
|
|
|
+ let newList = this.getListRoute(newPath);
|
|
|
|
+ newList = (newList ? newList : 'author');
|
|
|
|
+ if (this.selectedList != newList)
|
|
|
|
+ this.selectedList = newList;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ getListRoute(newPath) {
|
|
|
|
+ newPath = (newPath ? newPath : this.$route.path);
|
|
|
|
+ const m = newPath.match(/^\/([^/]*).*$/i);
|
|
|
|
+ return (m ? m[1] : newPath);
|
|
|
|
+ }
|
|
|
|
+
|
|
openReleasePage() {
|
|
openReleasePage() {
|
|
window.open('https://github.com/bookpauk/inpx-web/releases', '_blank');
|
|
window.open('https://github.com/bookpauk/inpx-web/releases', '_blank');
|
|
}
|
|
}
|
|
@@ -672,7 +723,7 @@ class Search {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- async updateSearchFromRouteQuery(to) {
|
|
|
|
|
|
+ updateSearchFromRouteQuery(to) {
|
|
if (this.list.liberamaReady)
|
|
if (this.list.liberamaReady)
|
|
this.sendCurrentUrl();
|
|
this.sendCurrentUrl();
|
|
|
|
|
|
@@ -709,7 +760,7 @@ class Search {
|
|
|
|
|
|
const diff = diffUtils.getObjDiff(oldQuery, query);
|
|
const diff = diffUtils.getObjDiff(oldQuery, query);
|
|
if (!diffUtils.isEmptyObjDiff(diff)) {
|
|
if (!diffUtils.isEmptyObjDiff(diff)) {
|
|
- this.$router.replace({query});
|
|
|
|
|
|
+ this.$router.replace({path: this.selectedList, query});
|
|
}
|
|
}
|
|
} finally {
|
|
} finally {
|
|
(async() => {
|
|
(async() => {
|
|
@@ -722,7 +773,7 @@ class Search {
|
|
async updateGenreTreeIfNeeded() {
|
|
async updateGenreTreeIfNeeded() {
|
|
if (this.genreTreeUpdating)
|
|
if (this.genreTreeUpdating)
|
|
return;
|
|
return;
|
|
-
|
|
|
|
|
|
+
|
|
this.genreTreeUpdating = true;
|
|
this.genreTreeUpdating = true;
|
|
try {
|
|
try {
|
|
if (this.genreTreeInpxHash !== this.list.inpxHash) {
|
|
if (this.genreTreeInpxHash !== this.list.inpxHash) {
|