design szlaków na liście scenerii

This commit is contained in:
2024-03-02 23:16:17 +01:00
parent 7b868a9f28
commit e33ba4af90
7 changed files with 106 additions and 88 deletions
@@ -81,11 +81,11 @@ export default defineComponent({
computed: {
filteredOneWayRoutes() {
return this.station.generalInfo?.routes.oneWay.filter(routeFilter) || [];
return this.station.generalInfo?.routes.single.filter(routeFilter) || [];
},
filteredTwoWayRoutes() {
return this.station.generalInfo?.routes.twoWay.filter(routeFilter) || [];
return this.station.generalInfo?.routes.double.filter(routeFilter) || [];
}
}
});
+76 -57
View File
@@ -144,60 +144,54 @@
</span>
</td>
<td class="station-tracks twoway">
<span
v-if="
station.generalInfo &&
station.generalInfo.routes.twoWayCatenaryRouteNames.length > 0
"
class="track catenary"
:title="`${$t('sceneries.info.double-track-routes-catenary')}${
station.generalInfo.routes.twoWayCatenaryRouteNames.length
}`"
>
{{ station.generalInfo.routes.twoWayCatenaryRouteNames.length }}
</span>
<td class="station-tracks">
<div v-if="station.generalInfo">
<div class="double-tracks">
<span
v-if="station.generalInfo.routes.doubleElectrifiedNames.length != 0"
class="track catenary"
:title="`${$t('sceneries.info.double-track-routes-catenary')}${
station.generalInfo.routes.doubleElectrifiedNames.length
}`"
>
{{ station.generalInfo.routes.doubleElectrifiedNames.length }}
</span>
<span
v-if="
station.generalInfo &&
station.generalInfo.routes.twoWayNoCatenaryRouteNames.length > 0
"
class="track no-catenary"
:title="`${$t('sceneries.info.double-track-routes-other')}${
station.generalInfo.routes.twoWayNoCatenaryRouteNames.length
}`"
>
{{ station.generalInfo.routes.twoWayNoCatenaryRouteNames.length }}
</span>
<span
v-if="station.generalInfo.routes.doubleOtherNames.length != 0"
class="track no-catenary"
:title="`${$t('sceneries.info.double-track-routes-other')}${
station.generalInfo.routes.doubleOtherNames.length
}`"
>
{{ station.generalInfo.routes.doubleOtherNames.length }}
</span>
</div>
<span class="separator"></span>
<div class="separator"></div>
<span
v-if="
station.generalInfo &&
station.generalInfo.routes.oneWayCatenaryRouteNames.length > 0
"
class="track catenary"
:title="`${$t('sceneries.info.single-track-routes-catenary')}${
station.generalInfo.routes.oneWayCatenaryRouteNames.length
}`"
>
{{ station.generalInfo.routes.oneWayCatenaryRouteNames.length }}
</span>
<div class="single-tracks">
<span
v-if="station.generalInfo.routes.singleElectrifiedNames.length != 0"
class="track catenary"
:title="`${$t('sceneries.info.single-track-routes-catenary')}${
station.generalInfo.routes.singleElectrifiedNames.length
}`"
>
{{ station.generalInfo.routes.singleElectrifiedNames.length }}
</span>
<span
v-if="
station.generalInfo &&
station.generalInfo.routes.oneWayNoCatenaryRouteNames.length > 0
"
class="track no-catenary"
:title="`${$t('sceneries.info.single-track-routes-other')}${
station.generalInfo.routes.oneWayNoCatenaryRouteNames.length
}`"
>
{{ station.generalInfo.routes.oneWayNoCatenaryRouteNames.length }}
</span>
<span
v-if="station.generalInfo.routes.singleOtherNames.length != 0"
class="track no-catenary"
:title="`${$t('sceneries.info.single-track-routes-other')}${
station.generalInfo.routes.singleOtherNames.length
}`"
>
{{ station.generalInfo.routes.singleOtherNames.length }}
</span>
</div>
</div>
</td>
<td class="station-info" v-if="station.generalInfo">
@@ -541,6 +535,10 @@ tr {
.station-info {
/* Images */
display: flex;
gap: 5px;
justify-content: center;
.icon-info {
vertical-align: middle;
line-height: 32px;
@@ -549,14 +547,34 @@ tr {
height: 32px;
font-size: 12px;
margin: 0 4px;
outline: 2px solid #2b2b2b;
border-radius: 5px;
}
}
.station-tracks {
& > div {
display: grid;
grid-template-columns: 3em 3px 3em;
gap: 5px;
justify-content: center;
& > div {
display: flex;
gap: 5px;
&.double-tracks {
justify-content: flex-end;
}
&.single-tracks {
justify-content: flex-start;
}
}
}
text-align: center;
.no-catenary {
background-color: #939393;
}
@@ -566,14 +584,15 @@ tr {
}
.separator {
border-left: 3px solid #b3b3b3;
background-color: #b3b3b3;
padding: 2px;
}
.track {
margin: 0 0.35em;
padding: 0.35em;
font-size: 1.05em;
white-space: pre-wrap;
width: 1.25em;
text-align: center;
padding: 0.35em 0;
font-size: 1.1em;
}
}
+1 -1
View File
@@ -238,7 +238,7 @@
"status": "Status",
"dispatcher": "Dispatcher",
"dispatcher-lvl": "Dispatcher\nlevel",
"routes": "Routes\ndouble / single",
"routes": "Routes\ndouble {'|'} single",
"general": "General info",
"user": "Drivers online",
"spawn": "Spawns online",
+1 -1
View File
@@ -230,7 +230,7 @@
"status": "Status",
"dispatcher": "Dyżurny",
"dispatcher-lvl": "Poziom\ndyżurnego",
"routes": "Szlaki\n2tor / 1tor",
"routes": "Szlaki\n2tor {'|'} 1tor",
"general": "Informacje\nogólne",
"user": "Maszyniści online",
"spawn": "Otwarte spawny",
+7 -8
View File
@@ -1,13 +1,12 @@
import { StationRoutesInfo } from '../../store/typings';
export interface StationRoutes {
oneWay: StationRoutesInfo[];
twoWay: StationRoutesInfo[];
single: StationRoutesInfo[];
double: StationRoutesInfo[];
/* [catenary, noCatenary] */
oneWayCatenaryRouteNames: string[];
oneWayNoCatenaryRouteNames: string[];
twoWayCatenaryRouteNames: string[];
twoWayNoCatenaryRouteNames: string[];
sblRouteNames: string[];
singleElectrifiedNames: string[];
singleOtherNames: string[];
doubleElectrifiedNames: string[];
doubleOtherNames: string[];
sblNames: string[];
}
+8 -8
View File
@@ -176,21 +176,21 @@ export const filterStations = (station: Station, filters: Filter) => {
if (
filters['no-1track'] &&
(routes.oneWayCatenaryRouteNames.length != 0 || routes.oneWayNoCatenaryRouteNames.length != 0)
(routes.singleElectrifiedNames.length != 0 || routes.singleOtherNames.length != 0)
)
return false;
if (
filters['no-2track'] &&
(routes.twoWayCatenaryRouteNames.length != 0 || routes.twoWayNoCatenaryRouteNames.length != 0)
(routes.doubleElectrifiedNames.length != 0 || routes.doubleOtherNames.length != 0)
)
return false;
if (routes.oneWayCatenaryRouteNames.length < filters['minOneWayCatenary']) return false;
if (routes.oneWayNoCatenaryRouteNames.length < filters['minOneWay']) return false;
if (routes.singleElectrifiedNames.length < filters['minOneWayCatenary']) return false;
if (routes.singleOtherNames.length < filters['minOneWay']) return false;
if (routes.twoWayCatenaryRouteNames.length < filters['minTwoWayCatenary']) return false;
if (routes.twoWayNoCatenaryRouteNames.length < filters['minTwoWay']) return false;
if (routes.doubleElectrifiedNames.length < filters['minTwoWayCatenary']) return false;
if (routes.doubleOtherNames.length < filters['minTwoWay']) return false;
if (filters[controlType]) return false;
if (filters[signalType]) return false;
@@ -198,8 +198,8 @@ export const filterStations = (station: Station, filters: Filter) => {
if (filters['SUP'] && SUP) return false;
if (filters['noSUP'] && !SUP) return false;
if (filters['SBL'] && routes.sblRouteNames.length > 0) return false;
if (filters['PBL'] && routes.sblRouteNames.length == 0) return false;
if (filters['SBL'] && routes.sblNames.length > 0) return false;
if (filters['PBL'] && routes.sblNames.length == 0) return false;
if (
filters['authors'].length > 3 &&
+11 -11
View File
@@ -230,27 +230,27 @@ export const useMainStore = defineStore('store', {
return apiStore.sceneryData.map((scenery) => {
const routes = scenery.routesInfo.reduce(
(acc, route) => {
const tracksKey = route.routeTracks == 2 ? 'twoWay' : 'oneWay';
const tracksKey = route.routeTracks == 2 ? 'double' : 'single';
const isElectric = route.isElectric;
const routesKey: keyof StationRoutes = `${tracksKey}${
!isElectric ? 'No' : ''
}CatenaryRouteNames`;
!isElectric ? 'Other' : 'Electrified'
}Names`;
if (!route.isInternal) acc[routesKey].push(route.routeName);
if (route.isRouteSBL) acc['sblRouteNames'].push(route.routeName);
if (route.isRouteSBL) acc['sblNames'].push(route.routeName);
acc[tracksKey].push(route);
return acc;
},
{
oneWay: [],
oneWayCatenaryRouteNames: [],
oneWayNoCatenaryRouteNames: [],
twoWay: [],
twoWayCatenaryRouteNames: [],
twoWayNoCatenaryRouteNames: [],
sblRouteNames: []
single: [],
singleElectrifiedNames: [],
singleOtherNames: [],
double: [],
doubleElectrifiedNames: [],
doubleOtherNames: [],
sblNames: []
} as StationRoutes
);