Poprawiono kolorystykę w widoku historii rozkładów

This commit is contained in:
2022-01-26 15:40:35 +01:00
parent 3d3fdebe37
commit 95fe9d1072
+26 -6
View File
@@ -30,8 +30,14 @@
<b>{{ item.route.replace('|', ' - ') }}</b> <b>{{ item.route.replace('|', ' - ') }}</b>
</div> </div>
<div class="text--grayed"> <div class="scenery-list">
{{ item.sceneriesString.replaceAll('%', ' - ') }} <span
v-for="(scenery, i) in sceneryList(item)"
:key="scenery.name"
:class="{ confirmed: scenery.confirmed }"
>
{{ i > 0 ? ' - ' : '' }} {{ scenery.name }}
</span>
</div> </div>
</span> </span>
@@ -46,7 +52,7 @@
{{ {{
!item.terminated !item.terminated
? $t('history.timetable-active') ? $t('history.timetable-active')
: (item.fulfilled || item.currentDistance >= item.routeDistance * 0.9) : item.fulfilled || item.currentDistance >= item.routeDistance * 0.9
? $t('history.timetable-fulfilled') ? $t('history.timetable-fulfilled')
: $t('history.timetable-abandoned') : $t('history.timetable-abandoned')
}} }}
@@ -215,6 +221,11 @@ export default defineComponent({
}, },
methods: { methods: {
sceneryList(historyItem: TimetableHistory) {
return historyItem.sceneriesString
.split('%')
.map((name, i) => ({ name, confirmed: i < historyItem.confirmedStopsCount }));
},
navigateToTrain(trainNo: number | null) { navigateToTrain(trainNo: number | null) {
if (!trainNo) return; if (!trainNo) return;
@@ -252,11 +263,10 @@ export default defineComponent({
if (props.searchedTrain) queries.push(`train=${props.searchedTrain}`); if (props.searchedTrain) queries.push(`train=${props.searchedTrain}`);
// Z API: const SORT_TYPES = ['allStopsCount', 'endDate', 'beginDate', 'routeDistance']; // Z API: const SORT_TYPES = ['allStopsCount', 'endDate', 'beginDate', 'routeDistance'];
if (this.sorterActive.id == 'distance') queries.push("sortBy=routeDistance"); if (this.sorterActive.id == 'distance') queries.push('sortBy=routeDistance');
else if (this.sorterActive.id == 'total-stops') queries.push("sortBy=allStopsCount"); else if (this.sorterActive.id == 'total-stops') queries.push('sortBy=allStopsCount');
console.log(queries); console.log(queries);
try { try {
const responseData: APIResponse | null = await (await axios.get(`${API_URL}?${queries.join('&')}`)).data; const responseData: APIResponse | null = await (await axios.get(`${API_URL}?${queries.join('&')}`)).data;
@@ -326,6 +336,16 @@ export default defineComponent({
justify-content: space-between; justify-content: space-between;
padding: 0.2em 0; padding: 0.2em 0;
.scenery-list {
span {
color: #adadad;
&.confirmed {
color: rgb(163, 235, 163);
}
}
}
} }
&-status { &-status {