From 9aad5f77dcfdd13045b8d044e8603851f9951770 Mon Sep 17 00:00:00 2001 From: Spythere Date: Wed, 25 May 2022 14:14:50 +0200 Subject: [PATCH] Przekierowanie do historii dr --- src/App.vue | 4 +- .../JournalView/JournalDispatchers.vue | 26 ++++++++--- .../JournalView/JournalTimetables.vue | 6 ++- src/router/index.ts | 2 +- src/views/JournalView.vue | 43 +++++++++++-------- 5 files changed, 54 insertions(+), 27 deletions(-) diff --git a/src/App.vue b/src/App.vue index 5f865a9..87f3c30 100644 --- a/src/App.vue +++ b/src/App.vue @@ -70,7 +70,7 @@ / {{ $t('app.trains') }} / - {{ $t('app.journal') }} @@ -79,7 +79,7 @@
- + diff --git a/src/components/JournalView/JournalDispatchers.vue b/src/components/JournalView/JournalDispatchers.vue index a479803..c4ab55e 100644 --- a/src/components/JournalView/JournalDispatchers.vue +++ b/src/components/JournalView/JournalDispatchers.vue @@ -133,7 +133,12 @@ export default defineComponent({ mixins: [dateMixin], props: { - searchedSceneryName: { + sceneryName: { + type: String, + required: false, + }, + + dispatcherName: { type: String, required: false, }, @@ -202,16 +207,25 @@ export default defineComponent({ }, mounted() { + const query = this.$route.query; + + console.log("Mounted"); + + + if (query.sceneryName || query.dispatcherName) { + this.searchersValues[1].value = query.sceneryName?.toString() || ""; + this.searchersValues[0].value = query.dispatcherName?.toString() || ""; + + this.search(); + + return; + } + this.fetchHistoryData(); }, activated() { window.addEventListener('scroll', this.handleScroll); - - if (this.searchedSceneryName) { - this.searchersValues[1].value = this.searchedSceneryName; - this.search(); - } }, deactivated() { diff --git a/src/components/JournalView/JournalTimetables.vue b/src/components/JournalView/JournalTimetables.vue index 5876136..84498fe 100644 --- a/src/components/JournalView/JournalTimetables.vue +++ b/src/components/JournalView/JournalTimetables.vue @@ -112,7 +112,7 @@
{{ $t('journal.dispatcher-name') }}  - {{ item.authorName }} + {{ item.authorName }}
@@ -437,4 +437,8 @@ export default defineComponent({ } } } + +.dispatcher-link { + font-weight: bold; +} diff --git a/src/router/index.ts b/src/router/index.ts index 9aec819..835c356 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -21,7 +21,7 @@ const routes: Array = [ { path: "/journal", name: "JournalView", - component: () => import("@/views/JournalView.vue"), + component: () => import("@/views/JournalView.vue") }, { path: '/:catchAll(.*)', diff --git a/src/views/JournalView.vue b/src/views/JournalView.vue index d0341bd..5180ae2 100644 --- a/src/views/JournalView.vue +++ b/src/views/JournalView.vue @@ -1,27 +1,30 @@