Nawigacja

This commit is contained in:
2022-12-20 21:51:40 +01:00
parent e478c510b2
commit 50100eb2f9
2 changed files with 11 additions and 9 deletions
+9 -6
View File
@@ -21,12 +21,14 @@
<i18n-t keypath="journal.timetable-stats-longest" tag="p"> <i18n-t keypath="journal.timetable-stats-longest" tag="p">
<template #id> <template #id>
<router-link :to="`/journal/timetables?timetableId=${data.stats.timetableId}`">{{ <router-link :to="`/journal/timetables?timetableId=${data.stats.timetableId}`">
data.stats.timetableId <b>{{ data.stats.timetableId }}</b>
}}</router-link> </router-link>
</template> </template>
<template #author> <template #author>
<b>{{ data.stats.timetableAuthor }}</b> <router-link :to="`/journal/dispatchers?dispatcherName=${data.stats.timetableAuthor}`">
<b>{{ data.stats.timetableAuthor }}</b>
</router-link>
</template> </template>
<template #driver> <template #driver>
<b>{{ data.stats.timetableDriver }}</b> <b>{{ data.stats.timetableDriver }}</b>
@@ -38,7 +40,9 @@
<i18n-t keypath="journal.timetable-stats-most-active" tag="p"> <i18n-t keypath="journal.timetable-stats-most-active" tag="p">
<template #dispatcher> <template #dispatcher>
<b>{{ data.stats.dispatcherName }}</b> <router-link :to="`/journal/dispatchers?dispatcherName=${data.stats.dispatcherName}`">
<b>{{ data.stats.dispatcherName }}</b>
</router-link>
</template> </template>
<template #count> <template #count>
<b class="text--primary"> <b class="text--primary">
@@ -55,7 +59,6 @@
<script setup lang="ts"> <script setup lang="ts">
import axios from 'axios'; import axios from 'axios';
import { reactive, ref } from 'vue'; import { reactive, ref } from 'vue';
import { onBeforeRouteUpdate, useRouter } from 'vue-router';
import { DataStatus } from '../../scripts/enums/DataStatus'; import { DataStatus } from '../../scripts/enums/DataStatus';
import { ITimetablesDailyStats, ITimetablesDailyStatsResponse } from '../../scripts/interfaces/api/StatsAPIData'; import { ITimetablesDailyStats, ITimetablesDailyStatsResponse } from '../../scripts/interfaces/api/StatsAPIData';
import { URLs } from '../../scripts/utils/apiURLs'; import { URLs } from '../../scripts/utils/apiURLs';
+2 -3
View File
@@ -136,11 +136,10 @@ export default defineComponent({
// Handle route updates for route-links // Handle route updates for route-links
beforeRouteUpdate(to, from) { beforeRouteUpdate(to, from) {
const timetableId = to.query['timetableId']?.toString(); const { timetableId, driverName } = to.query;
if (!timetableId) return; if (timetableId) this.searchersValues['search-train'] = `#${timetableId}`;
this.searchersValues['search-train'] = `#${timetableId}`;
this.searchHistory(); this.searchHistory();
}, },