dziennik dr: kolumna regionów

This commit is contained in:
2023-09-03 18:34:45 +02:00
parent e5fe727ccd
commit dc862252ba
4 changed files with 35 additions and 2 deletions
@@ -24,6 +24,7 @@
<th>{{ $t('journal.history-dispatcher') }}</th>
<th>{{ $t('journal.history-level') }}</th>
<th>{{ $t('journal.history-rate') }}</th>
<th>{{ $t('journal.history-region') }}</th>
<th>{{ $t('journal.history-date') }}</th>
</thead>
@@ -54,6 +55,12 @@
<b>{{ historyItem.dispatcherRate }}</b>
</td>
<td>
<b class="region-badge" :aria-describedby="historyItem.region">{{
regions.find((r) => r.id == historyItem.region)?.value || '???'
}}</b>
</td>
<td style="min-width: 200px" class="time">
<span v-if="historyItem.timestampTo">
<b>{{ $d(historyItem.timestampFrom) }}</b>
@@ -108,6 +115,7 @@ import imageMixin from '../../mixins/imageMixin';
import { DataStatus } from '../../scripts/enums/DataStatus';
import { useStore } from '../../store/store';
import Loading from '../Global/Loading.vue';
import { regions } from '../../data/options.json';
export default defineComponent({
components: { Loading },
@@ -137,11 +145,14 @@ export default defineComponent({
return {
DataStatus,
store: useStore(),
regions,
};
},
computed: {
computedDispatcherHistory() {
console.log(this.dispatcherHistory.length);
return this.dispatcherHistory.reduce((acc, historyItem, i) => {
if (this.isAnotherDay(i - 1, i)) acc.push(new Date(historyItem.timestampFrom).toLocaleDateString('pl-PL'));
acc.push(historyItem);
+1
View File
@@ -346,6 +346,7 @@
"history-dispatcher": "Dispatcher",
"history-level": "Level",
"history-rate": "Rate",
"history-region": "Region",
"history-date": "Service date"
},
"scenery": {
+1
View File
@@ -349,6 +349,7 @@
"history-dispatcher": "Dyżurny",
"history-level": "Poziom",
"history-rate": "Ocena",
"history-region": "Region",
"history-date": "Data służby"
},
"scenery": {
+22 -2
View File
@@ -46,13 +46,33 @@
}
.region-badge {
padding: 0 0.5em;
padding: 0.25em 0.5em;
border-radius: 0.5em;
font-weight: bold;
color: white;
&.eu {
&[aria-describedby='eu'] {
background-color: forestgreen;
}
&[aria-describedby='cae'] {
background-color: lightcoral;
color: black;
}
&[aria-describedby='usw'] {
background-color: lightblue;
color: black;
}
&[aria-describedby='us'] {
background-color: lightblue;
color: black;
}
&[aria-describedby='ru'] {
background-color: lightslategray;
}
}
.train-badge {