feature: skrót posterunku w tabelce

This commit is contained in:
2023-04-09 01:37:11 +02:00
parent 77f61d17fd
commit 4c41076519
13 changed files with 142 additions and 168 deletions
+1 -1
View File
@@ -164,7 +164,7 @@
import { defineComponent } from 'vue';
import { DataStatus } from '../../scripts/enums/DataStatus';
import { useStore } from '../../store/store';
import { StoreState } from '../../store/storeTypes';
import { StoreState } from '../../scripts/interfaces/store/storeTypes';
export default defineComponent({
data() {
@@ -50,9 +50,6 @@ export default defineComponent({
handleDbClick(e: Event) {
e.preventDefault();
const lastClicked = this.filterStore.lastClickedFilterId == this.option.id;
console.log(this.filterStore.lastClickedFilterId);
this.filterStore.lastClickedFilterId = this.option.id;
this.option.value = true;
@@ -96,51 +93,8 @@ button {
}
&[data-selected='true'] {
// &.reality {
// background-color: $realityCol;
// box-shadow: 0 0 6px 1px $realityCol;
// }
// &.access {
// background-color: $accessCol;
// box-shadow: 0 0 6px 1px $accessCol;
// }
// &.control {
// background-color: $controlCol;
// box-shadow: 0 0 6px 1px $controlCol;
// }
// &.signals {
// background-color: $signalCol;
// box-shadow: 0 0 6px 1px $signalCol;
// }
// &.routes {
// background-color: $routesCol;
// box-shadow: 0 0 6px 1px $routesCol;
// }
// &.status {
// background-color: $statusCol;
// box-shadow: 0 0 6px 1px $statusCol;
// }
// &.save {
// background-color: $saveCol;
// box-shadow: 0 0 6px 1px $saveCol;
// }
// &.troll {
// background-color: firebrick;
// box-shadow: 0 0 6px 1px firebrick;
// }
// & {
background-color: forestgreen;
font-weight: bold;
// }
}
}
</style>
@@ -128,7 +128,6 @@ import { useStore } from '../../store/store';
import ActionButton from '../Global/ActionButton.vue';
import FilterOption from './FilterOption.vue';
import { filterInitStates } from '../../store/constants/initFilterStates';
export default defineComponent({
components: { ActionButton, FilterOption },
+20 -11
View File
@@ -8,26 +8,26 @@
<table>
<thead>
<tr>
<th v-for="(id, i) in headIds" :key="id" @click="() => changeSorter(i)">
<th v-for="(headerName, i) in headIds" :key="headerName" @click="changeSorter(headerName)">
<span class="header_wrapper">
<div v-html="$t(`sceneries.${id}`)"></div>
<div v-html="$t(`sceneries.${headerName}`)"></div>
<img
class="sort-icon"
v-if="sorterActive.index == i"
v-if="sorterActive.headerName == headerName"
:src="sorterActive.dir == 1 ? getIcon('arrow-asc') : getIcon('arrow-desc')"
alt="sort icon"
/>
</span>
</th>
<th v-for="(id, i) in headIconsIds" :key="id" @click="() => changeSorter(i + 7)">
<th v-for="(headerName, i) in headIconsIds" :key="headerName" @click="changeSorter(headerName)">
<span class="header_wrapper">
<img :src="getIcon(id)" :alt="id" :title="$t(`sceneries.${id}s`)" />
<img :src="getIcon(headerName)" :alt="headerName" :title="$t(`sceneries.${headerName}s`)" />
<img
class="sort-icon"
v-if="sorterActive.index == i + 7"
v-if="sorterActive.headerName == headerName"
:src="sorterActive.dir == 1 ? getIcon('arrow-asc') : getIcon('arrow-desc')"
alt="sort icon"
/>
@@ -53,6 +53,12 @@
{{ station.name }}
</td>
<td>
<b>
{{ station.generalInfo?.abbr }}
</b>
</td>
<td class="station_level">
<span v-if="station.generalInfo">
<span
@@ -236,6 +242,7 @@ import Station from '../../scripts/interfaces/Station';
import { useStationFiltersStore } from '../../store/stationFiltersStore';
import { useStore } from '../../store/store';
import Loading from '../Global/Loading.vue';
import { HeadIdsTypes, headIconsIds, headIds } from '../../scripts/data/stationHeaderNames';
export default defineComponent({
props: {
@@ -249,8 +256,8 @@ export default defineComponent({
mixins: [styleMixin, dateMixin, stationInfoMixin, returnBtnMixin, imageMixin],
data: () => ({
headIds: ['station', 'min-lvl', 'status', 'dispatcher', 'dispatcher-lvl', 'routes', 'general'],
headIconsIds: ['user', 'spawn', 'timetable'],
headIconsIds,
headIds,
lastSelectedStationName: '',
}),
@@ -291,8 +298,10 @@ export default defineComponent({
window.open(url, '_blank');
},
changeSorter(i: number) {
this.stationFiltersStore.changeSorter(i);
changeSorter(headerName: HeadIdsTypes) {
if (headerName == 'general' || headerName == 'routes') return;
this.stationFiltersStore.changeSorter(headerName);
},
},
});
@@ -349,7 +358,7 @@ table {
position: sticky;
top: 0;
min-width: 75px;
min-width: 80px;
padding: 0.5em;
background-color: $bgCol;