mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-04 22:08:12 +00:00
design szlaków na liście scenerii
This commit is contained in:
@@ -81,11 +81,11 @@ export default defineComponent({
|
|||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
filteredOneWayRoutes() {
|
filteredOneWayRoutes() {
|
||||||
return this.station.generalInfo?.routes.oneWay.filter(routeFilter) || [];
|
return this.station.generalInfo?.routes.single.filter(routeFilter) || [];
|
||||||
},
|
},
|
||||||
|
|
||||||
filteredTwoWayRoutes() {
|
filteredTwoWayRoutes() {
|
||||||
return this.station.generalInfo?.routes.twoWay.filter(routeFilter) || [];
|
return this.station.generalInfo?.routes.double.filter(routeFilter) || [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -144,60 +144,54 @@
|
|||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="station-tracks twoway">
|
<td class="station-tracks">
|
||||||
<span
|
<div v-if="station.generalInfo">
|
||||||
v-if="
|
<div class="double-tracks">
|
||||||
station.generalInfo &&
|
<span
|
||||||
station.generalInfo.routes.twoWayCatenaryRouteNames.length > 0
|
v-if="station.generalInfo.routes.doubleElectrifiedNames.length != 0"
|
||||||
"
|
class="track catenary"
|
||||||
class="track catenary"
|
:title="`${$t('sceneries.info.double-track-routes-catenary')}${
|
||||||
:title="`${$t('sceneries.info.double-track-routes-catenary')}${
|
station.generalInfo.routes.doubleElectrifiedNames.length
|
||||||
station.generalInfo.routes.twoWayCatenaryRouteNames.length
|
}`"
|
||||||
}`"
|
>
|
||||||
>
|
{{ station.generalInfo.routes.doubleElectrifiedNames.length }}
|
||||||
{{ station.generalInfo.routes.twoWayCatenaryRouteNames.length }}
|
</span>
|
||||||
</span>
|
|
||||||
|
|
||||||
<span
|
<span
|
||||||
v-if="
|
v-if="station.generalInfo.routes.doubleOtherNames.length != 0"
|
||||||
station.generalInfo &&
|
class="track no-catenary"
|
||||||
station.generalInfo.routes.twoWayNoCatenaryRouteNames.length > 0
|
:title="`${$t('sceneries.info.double-track-routes-other')}${
|
||||||
"
|
station.generalInfo.routes.doubleOtherNames.length
|
||||||
class="track no-catenary"
|
}`"
|
||||||
:title="`${$t('sceneries.info.double-track-routes-other')}${
|
>
|
||||||
station.generalInfo.routes.twoWayNoCatenaryRouteNames.length
|
{{ station.generalInfo.routes.doubleOtherNames.length }}
|
||||||
}`"
|
</span>
|
||||||
>
|
</div>
|
||||||
{{ station.generalInfo.routes.twoWayNoCatenaryRouteNames.length }}
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<span class="separator"></span>
|
<div class="separator"></div>
|
||||||
|
|
||||||
<span
|
<div class="single-tracks">
|
||||||
v-if="
|
<span
|
||||||
station.generalInfo &&
|
v-if="station.generalInfo.routes.singleElectrifiedNames.length != 0"
|
||||||
station.generalInfo.routes.oneWayCatenaryRouteNames.length > 0
|
class="track catenary"
|
||||||
"
|
:title="`${$t('sceneries.info.single-track-routes-catenary')}${
|
||||||
class="track catenary"
|
station.generalInfo.routes.singleElectrifiedNames.length
|
||||||
:title="`${$t('sceneries.info.single-track-routes-catenary')}${
|
}`"
|
||||||
station.generalInfo.routes.oneWayCatenaryRouteNames.length
|
>
|
||||||
}`"
|
{{ station.generalInfo.routes.singleElectrifiedNames.length }}
|
||||||
>
|
</span>
|
||||||
{{ station.generalInfo.routes.oneWayCatenaryRouteNames.length }}
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<span
|
<span
|
||||||
v-if="
|
v-if="station.generalInfo.routes.singleOtherNames.length != 0"
|
||||||
station.generalInfo &&
|
class="track no-catenary"
|
||||||
station.generalInfo.routes.oneWayNoCatenaryRouteNames.length > 0
|
:title="`${$t('sceneries.info.single-track-routes-other')}${
|
||||||
"
|
station.generalInfo.routes.singleOtherNames.length
|
||||||
class="track no-catenary"
|
}`"
|
||||||
:title="`${$t('sceneries.info.single-track-routes-other')}${
|
>
|
||||||
station.generalInfo.routes.oneWayNoCatenaryRouteNames.length
|
{{ station.generalInfo.routes.singleOtherNames.length }}
|
||||||
}`"
|
</span>
|
||||||
>
|
</div>
|
||||||
{{ station.generalInfo.routes.oneWayNoCatenaryRouteNames.length }}
|
</div>
|
||||||
</span>
|
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="station-info" v-if="station.generalInfo">
|
<td class="station-info" v-if="station.generalInfo">
|
||||||
@@ -541,6 +535,10 @@ tr {
|
|||||||
|
|
||||||
.station-info {
|
.station-info {
|
||||||
/* Images */
|
/* Images */
|
||||||
|
display: flex;
|
||||||
|
gap: 5px;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
.icon-info {
|
.icon-info {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
line-height: 32px;
|
line-height: 32px;
|
||||||
@@ -549,14 +547,34 @@ tr {
|
|||||||
height: 32px;
|
height: 32px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
|
||||||
margin: 0 4px;
|
|
||||||
|
|
||||||
outline: 2px solid #2b2b2b;
|
outline: 2px solid #2b2b2b;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.station-tracks {
|
.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 {
|
.no-catenary {
|
||||||
background-color: #939393;
|
background-color: #939393;
|
||||||
}
|
}
|
||||||
@@ -566,14 +584,15 @@ tr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.separator {
|
.separator {
|
||||||
border-left: 3px solid #b3b3b3;
|
background-color: #b3b3b3;
|
||||||
|
padding: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.track {
|
.track {
|
||||||
margin: 0 0.35em;
|
width: 1.25em;
|
||||||
padding: 0.35em;
|
text-align: center;
|
||||||
font-size: 1.05em;
|
padding: 0.35em 0;
|
||||||
white-space: pre-wrap;
|
font-size: 1.1em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -238,7 +238,7 @@
|
|||||||
"status": "Status",
|
"status": "Status",
|
||||||
"dispatcher": "Dispatcher",
|
"dispatcher": "Dispatcher",
|
||||||
"dispatcher-lvl": "Dispatcher\nlevel",
|
"dispatcher-lvl": "Dispatcher\nlevel",
|
||||||
"routes": "Routes\ndouble / single",
|
"routes": "Routes\ndouble {'|'} single",
|
||||||
"general": "General info",
|
"general": "General info",
|
||||||
"user": "Drivers online",
|
"user": "Drivers online",
|
||||||
"spawn": "Spawns online",
|
"spawn": "Spawns online",
|
||||||
|
|||||||
+1
-1
@@ -230,7 +230,7 @@
|
|||||||
"status": "Status",
|
"status": "Status",
|
||||||
"dispatcher": "Dyżurny",
|
"dispatcher": "Dyżurny",
|
||||||
"dispatcher-lvl": "Poziom\ndyżurnego",
|
"dispatcher-lvl": "Poziom\ndyżurnego",
|
||||||
"routes": "Szlaki\n2tor / 1tor",
|
"routes": "Szlaki\n2tor {'|'} 1tor",
|
||||||
"general": "Informacje\nogólne",
|
"general": "Informacje\nogólne",
|
||||||
"user": "Maszyniści online",
|
"user": "Maszyniści online",
|
||||||
"spawn": "Otwarte spawny",
|
"spawn": "Otwarte spawny",
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
import { StationRoutesInfo } from '../../store/typings';
|
import { StationRoutesInfo } from '../../store/typings';
|
||||||
|
|
||||||
export interface StationRoutes {
|
export interface StationRoutes {
|
||||||
oneWay: StationRoutesInfo[];
|
single: StationRoutesInfo[];
|
||||||
twoWay: StationRoutesInfo[];
|
double: StationRoutesInfo[];
|
||||||
|
|
||||||
/* [catenary, noCatenary] */
|
singleElectrifiedNames: string[];
|
||||||
oneWayCatenaryRouteNames: string[];
|
singleOtherNames: string[];
|
||||||
oneWayNoCatenaryRouteNames: string[];
|
doubleElectrifiedNames: string[];
|
||||||
twoWayCatenaryRouteNames: string[];
|
doubleOtherNames: string[];
|
||||||
twoWayNoCatenaryRouteNames: string[];
|
sblNames: string[];
|
||||||
sblRouteNames: string[];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -176,21 +176,21 @@ export const filterStations = (station: Station, filters: Filter) => {
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
filters['no-1track'] &&
|
filters['no-1track'] &&
|
||||||
(routes.oneWayCatenaryRouteNames.length != 0 || routes.oneWayNoCatenaryRouteNames.length != 0)
|
(routes.singleElectrifiedNames.length != 0 || routes.singleOtherNames.length != 0)
|
||||||
)
|
)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
filters['no-2track'] &&
|
filters['no-2track'] &&
|
||||||
(routes.twoWayCatenaryRouteNames.length != 0 || routes.twoWayNoCatenaryRouteNames.length != 0)
|
(routes.doubleElectrifiedNames.length != 0 || routes.doubleOtherNames.length != 0)
|
||||||
)
|
)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (routes.oneWayCatenaryRouteNames.length < filters['minOneWayCatenary']) return false;
|
if (routes.singleElectrifiedNames.length < filters['minOneWayCatenary']) return false;
|
||||||
if (routes.oneWayNoCatenaryRouteNames.length < filters['minOneWay']) return false;
|
if (routes.singleOtherNames.length < filters['minOneWay']) return false;
|
||||||
|
|
||||||
if (routes.twoWayCatenaryRouteNames.length < filters['minTwoWayCatenary']) return false;
|
if (routes.doubleElectrifiedNames.length < filters['minTwoWayCatenary']) return false;
|
||||||
if (routes.twoWayNoCatenaryRouteNames.length < filters['minTwoWay']) return false;
|
if (routes.doubleOtherNames.length < filters['minTwoWay']) return false;
|
||||||
|
|
||||||
if (filters[controlType]) return false;
|
if (filters[controlType]) return false;
|
||||||
if (filters[signalType]) 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['SUP'] && SUP) return false;
|
||||||
if (filters['noSUP'] && !SUP) return false;
|
if (filters['noSUP'] && !SUP) return false;
|
||||||
|
|
||||||
if (filters['SBL'] && routes.sblRouteNames.length > 0) return false;
|
if (filters['SBL'] && routes.sblNames.length > 0) return false;
|
||||||
if (filters['PBL'] && routes.sblRouteNames.length == 0) return false;
|
if (filters['PBL'] && routes.sblNames.length == 0) return false;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
filters['authors'].length > 3 &&
|
filters['authors'].length > 3 &&
|
||||||
|
|||||||
+11
-11
@@ -230,27 +230,27 @@ export const useMainStore = defineStore('store', {
|
|||||||
return apiStore.sceneryData.map((scenery) => {
|
return apiStore.sceneryData.map((scenery) => {
|
||||||
const routes = scenery.routesInfo.reduce(
|
const routes = scenery.routesInfo.reduce(
|
||||||
(acc, route) => {
|
(acc, route) => {
|
||||||
const tracksKey = route.routeTracks == 2 ? 'twoWay' : 'oneWay';
|
const tracksKey = route.routeTracks == 2 ? 'double' : 'single';
|
||||||
const isElectric = route.isElectric;
|
const isElectric = route.isElectric;
|
||||||
const routesKey: keyof StationRoutes = `${tracksKey}${
|
const routesKey: keyof StationRoutes = `${tracksKey}${
|
||||||
!isElectric ? 'No' : ''
|
!isElectric ? 'Other' : 'Electrified'
|
||||||
}CatenaryRouteNames`;
|
}Names`;
|
||||||
|
|
||||||
if (!route.isInternal) acc[routesKey].push(route.routeName);
|
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);
|
acc[tracksKey].push(route);
|
||||||
|
|
||||||
return acc;
|
return acc;
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
oneWay: [],
|
single: [],
|
||||||
oneWayCatenaryRouteNames: [],
|
singleElectrifiedNames: [],
|
||||||
oneWayNoCatenaryRouteNames: [],
|
singleOtherNames: [],
|
||||||
twoWay: [],
|
double: [],
|
||||||
twoWayCatenaryRouteNames: [],
|
doubleElectrifiedNames: [],
|
||||||
twoWayNoCatenaryRouteNames: [],
|
doubleOtherNames: [],
|
||||||
sblRouteNames: []
|
sblNames: []
|
||||||
} as StationRoutes
|
} as StationRoutes
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user