diff --git a/src/components/JournalView/JournalOptions.vue b/src/components/JournalView/JournalOptions.vue index 3693277..7d04108 100644 --- a/src/components/JournalView/JournalOptions.vue +++ b/src/components/JournalView/JournalOptions.vue @@ -39,6 +39,12 @@ + +
+ AKTYWNY + PORZUCONY + WYPEŁNIONY +
@@ -109,6 +115,7 @@ export default defineComponent({ .options { &_wrapper { display: flex; + flex-direction: column; } &_content { @@ -124,6 +131,30 @@ export default defineComponent({ padding: 0.25em 0.25em 0 0; } } + + &_filters { + margin: 0.5em 0 0 0; + + .journal-filter { + background-color: #333; + padding: 0.25em 0.3em; + margin: 0 0.25em 0 0; + + cursor: pointer; + + &.abandoned { + color: salmon; + } + + &.fulfilled { + color: lightgreen; + } + + &.active { + color: lightblue; + } + } + } } .search { @@ -162,6 +193,7 @@ export default defineComponent({ .options { &_wrapper { justify-content: center; + align-items: center; } &_content { diff --git a/src/views/JournalView.vue b/src/views/JournalView.vue index 4e7aec2..7314a7f 100644 --- a/src/views/JournalView.vue +++ b/src/views/JournalView.vue @@ -56,12 +56,13 @@ {{ item.route.split('|').slice(-1)[0] }}: {{ $t('history.timetable-abandoned') }} - {{ localeTime(item.fulfilled ? item.endDate : item.scheduledEndDate, $i18n.locale) }} - {{ localeTime(item.fulfilled ? item.scheduledEndDate : item.endDate, $i18n.locale) }} + {{ localeTime(item.fulfilled ? item.scheduledEndDate : item.endDate, $i18n.locale) }} + @@ -267,9 +268,7 @@ export default defineComponent({ }, mounted() { - setTimeout(() => { - this.fetchHistoryData(); - }, 250); + this.fetchHistoryData(); }, methods: { @@ -291,6 +290,9 @@ export default defineComponent({ this.fetchHistoryData({ searchedDriver: this.searchedDriver, searchedTrain: this.searchedTrain, + fulfilled: true, + abandoned: true, + terminated: true }); }, @@ -302,6 +304,9 @@ export default defineComponent({ props: { searchedDriver?: string; searchedTrain?: string; + fulfilled?: boolean; + terminated?: boolean; + abandoned?: boolean; } = {} ) { this.historyDataStatus.status = DataStatus.Loading; @@ -318,7 +323,8 @@ export default defineComponent({ else queries.push('sortBy=timetableId'); queries.push('countLimit=15'); - // queries.push('fulfilled=0', 'terminated=1'); + + // queries.push(`fulfilled=${Number(props.fulfilled) || 1}`, `terminated=${Number(props.terminated) || 1}`, `abandoned=${Number(props.abandoned) || 1}`, `active=1`); try { const responseData: APIResponse | null = await (await axios.get(`${API_URL}?${queries.join('&')}`)).data; @@ -394,7 +400,7 @@ export default defineComponent({ color: #adadad; &.confirmed { - color: rgb(163, 235, 163); + color: #a3eba3; } } }