mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 13:28:11 +00:00
Dodano listę szlaków w widoku scenerii
This commit is contained in:
@@ -138,8 +138,6 @@
|
||||
.info_counter {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
color: $accentCol;
|
||||
|
||||
span {
|
||||
margin: 0 0.15em;
|
||||
|
||||
+8
-5
@@ -50,8 +50,9 @@
|
||||
</span>
|
||||
|
||||
<img src="@/assets/icon-dispatcher.svg" alt="icon dispatcher" />
|
||||
<span>{{ data.activeStationCount }}</span>
|
||||
<span>{{ data.activeTrainCount }}</span>
|
||||
{{ data.activeStationCount }}
|
||||
|
|
||||
{{ data.activeTrainCount }}
|
||||
<img src="@/assets/icon-train.svg" alt="icon train" />
|
||||
</div>
|
||||
</span>
|
||||
@@ -131,6 +132,11 @@ export default defineComponent({
|
||||
sceneryDataStatus,
|
||||
dispatcherDataStatus: computed(() => data.value.dispatcherDataStatus),
|
||||
|
||||
timetableCount: data.value.trainList.filter((train) => train.timetableData).length,
|
||||
onlineDispatcherCount: data.value.stationList.filter(
|
||||
(station) => station.onlineInfo && station.onlineInfo.statusTimestamp > 0
|
||||
).length,
|
||||
|
||||
openFilterCard() {
|
||||
isFilterCardVisible.value = true;
|
||||
},
|
||||
@@ -148,8 +154,6 @@ export default defineComponent({
|
||||
pl: require('@/assets/icon-pl.svg'),
|
||||
error: require('@/assets/icon-error.svg'),
|
||||
},
|
||||
|
||||
|
||||
}),
|
||||
|
||||
created() {
|
||||
@@ -174,7 +178,6 @@ export default defineComponent({
|
||||
StorageManager.setBooleanValue('version_notes_read', true);
|
||||
},
|
||||
|
||||
|
||||
changeLang(lang: string) {
|
||||
this.$i18n.locale = lang;
|
||||
this.currentLang = lang;
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<svg width="144" height="144" viewBox="0 0 144 144" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M77.9831 61.3284L97.9732 7L44 74.9104H69.9871L51.996 137L99.9722 61.3284H77.9831Z" fill="#FFF500"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 216 B |
@@ -0,0 +1,5 @@
|
||||
<svg width="144" height="144" viewBox="0 0 144 144" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect x="9.20437" y="2.4661" width="36.5457" height="57.8287" rx="16.7449" transform="matrix(0.869001 -0.494811 0.505207 0.862998 50.006 87.4256)" stroke="white" stroke-width="13.3959"/>
|
||||
<rect x="9.20437" y="2.4661" width="36.5457" height="57.8287" rx="16.7449" transform="matrix(0.869001 -0.494811 0.505207 0.862998 14.9599 29.6039)" stroke="white" stroke-width="13.3959"/>
|
||||
<path d="M65.1132 58.145L79.8523 84.3103" stroke="white" stroke-width="10.0469" stroke-linecap="round" stroke-linejoin="bevel"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 611 B |
@@ -0,0 +1,3 @@
|
||||
<svg width="144" height="144" viewBox="0 0 144 144" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M7.19995 72L44.3741 93.9988L44.8386 50.8056L7.19995 72ZM139.192 73.4193L102.018 51.4204L101.554 94.6137L139.192 73.4193ZM40.8255 76.1026L105.486 76.7979L105.567 69.3166L40.9059 68.6214L40.8255 76.1026Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 334 B |
@@ -21,7 +21,7 @@
|
||||
:title="$t('desc.signals-type') + $t(`signals.${station.generalInfo.signalType}`)"
|
||||
/>
|
||||
|
||||
<img
|
||||
<!-- <img
|
||||
v-if="station.generalInfo && station.generalInfo.routes.sblRouteNames.length > 0"
|
||||
:src="icons.SBL"
|
||||
alt="sbl icon"
|
||||
@@ -35,7 +35,7 @@
|
||||
:title="
|
||||
$t('desc.TWB-routes') + station.generalInfo.routes.twoWay.filter(route => route.TWB).map(route => route.name).join(', ')
|
||||
"
|
||||
/>
|
||||
/> -->
|
||||
|
||||
<img v-if="station.generalInfo?.default" :src="icons.td2" alt="default scenery" :title="$t('desc.default')" />
|
||||
|
||||
|
||||
@@ -28,6 +28,33 @@
|
||||
</span>
|
||||
</span>
|
||||
</section>
|
||||
|
||||
<section class="info-tracks" v-if="station.generalInfo">
|
||||
<div
|
||||
class="track-info"
|
||||
:class="{ 'no-catenary': !route.catenary, internal: route.isInternal }"
|
||||
v-for="route in [...station.generalInfo.routes.oneWay, ...station.generalInfo.routes.twoWay].filter(route => route.name != '-')"
|
||||
:key="route.name"
|
||||
:title="
|
||||
`Szlak ${route.name}: ${route.isInternal ? 'wewnętrzny' : 'zewnętrzny'}, ${
|
||||
route.tracks == 2 ? 'dwutorowy' : 'jednotorowy'
|
||||
}, ${route.catenary ? 'zelektryfikowany' : 'niezelektryfikowany'} z ${route.SBL ? 'SBL' : 'PBL'} ${
|
||||
route.TWB ? 'i blokadą dwukierunkową' : ''
|
||||
}`
|
||||
"
|
||||
>
|
||||
<span class="track-name">
|
||||
<b>{{ route.name }}</b>
|
||||
</span>
|
||||
|
||||
<span class="track-specs">
|
||||
{{ route.tracks }}tor
|
||||
<img :src="require('@/assets/icon-track-catenary.svg')" alt="icon track catenary" v-if="route.catenary" />
|
||||
<img v-if="route.TWB" :src="require('@/assets/icon-track-twb.svg')" alt="icon track twb"/>
|
||||
<img v-if="route.SBL" :src="require('@/assets/icon-track-sbl.svg')" alt="icon track sbl"/>
|
||||
</span>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
@@ -57,6 +84,43 @@ export default defineComponent({
|
||||
<style lang="scss" scoped>
|
||||
@import '../../../styles/variables.scss';
|
||||
|
||||
.info-tracks {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
|
||||
padding: 0 3em;
|
||||
}
|
||||
|
||||
.track-info {
|
||||
margin: 0.45em 0.25em;
|
||||
font-size: 1.05em;
|
||||
cursor: help;
|
||||
|
||||
span {
|
||||
height: 100%;
|
||||
background-color: #009dce;
|
||||
|
||||
padding: 0.2em 0.25em;
|
||||
}
|
||||
|
||||
&.no-catenary > span {
|
||||
background-color: #686868;
|
||||
}
|
||||
|
||||
&.internal > .track-name {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
img {
|
||||
height: 1.2em;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
}
|
||||
|
||||
.train-specs {
|
||||
}
|
||||
|
||||
.info-stats {
|
||||
padding: 1rem 0;
|
||||
|
||||
|
||||
+10
-4
@@ -1,17 +1,15 @@
|
||||
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
|
||||
|
||||
import StationsView from "@/views/StationsView.vue";
|
||||
|
||||
const routes: Array<RouteRecordRaw> = [
|
||||
{
|
||||
path: '/',
|
||||
name: 'StationsView',
|
||||
component: StationsView
|
||||
component: () => import("@/views/StationsView.vue")
|
||||
},
|
||||
{
|
||||
path: "/trains",
|
||||
name: "TrainsView",
|
||||
component: () => import("@/views/TrainsView.vue"),
|
||||
component: () => import("@/views/TrainsView.vue"),
|
||||
props: route => ({ train: route.query.train })
|
||||
},
|
||||
{
|
||||
@@ -32,6 +30,14 @@ const routes: Array<RouteRecordRaw> = [
|
||||
]
|
||||
|
||||
const router = createRouter({
|
||||
scrollBehavior(to, from, savedPosition) {
|
||||
if (savedPosition) {
|
||||
return savedPosition;
|
||||
} else {
|
||||
return { top: 0, left: 0 };
|
||||
}
|
||||
|
||||
},
|
||||
history: createWebHistory(),
|
||||
routes,
|
||||
})
|
||||
|
||||
@@ -6,6 +6,7 @@ export default interface StationRoutes {
|
||||
SBL: boolean;
|
||||
TWB: boolean;
|
||||
isInternal: boolean;
|
||||
tracks: number;
|
||||
}[];
|
||||
|
||||
twoWay: {
|
||||
@@ -14,6 +15,7 @@ export default interface StationRoutes {
|
||||
SBL: boolean;
|
||||
TWB: boolean;
|
||||
isInternal: boolean;
|
||||
tracks: number;
|
||||
}[];
|
||||
|
||||
/* [catenary, noCatenary] */
|
||||
|
||||
+4
-8
@@ -365,7 +365,7 @@ export const store = createStore<State>({
|
||||
? 'oneWayCatenaryRouteNames'
|
||||
: 'oneWayNoCatenaryRouteNames';
|
||||
|
||||
acc[twoWay ? 'twoWay' : 'oneWay'].push({ name, SBL, TWB, catenary, isInternal });
|
||||
acc[twoWay ? 'twoWay' : 'oneWay'].push({ name, SBL, TWB, catenary, isInternal, tracks: twoWay ? 2 : 1 });
|
||||
if(!isInternal) acc[propName].push(name);
|
||||
|
||||
if (SBL) acc['sblRouteNames'].push(name);
|
||||
@@ -457,7 +457,7 @@ export const store = createStore<State>({
|
||||
},
|
||||
|
||||
UPDATE_TRAINS(state, updatedTrainList: any[]) {
|
||||
state.trainList = updatedTrainList.reduce((acc, updatedTrain) => {
|
||||
state.trainList = updatedTrainList.reduce((acc, updatedTrain) => {
|
||||
const trainData = state.trainList.find(train => train.trainNo === updatedTrain.trainNo);
|
||||
|
||||
if (trainData) acc.push({ ...trainData, ...updatedTrain });
|
||||
@@ -573,12 +573,8 @@ export const store = createStore<State>({
|
||||
|
||||
state.trainList = state.trainList.reduce((acc, train) => {
|
||||
const timetable = timetableList.find(tt => tt.data && tt.trainNo === train.trainNo && tt.data.driverId === train.driverId);
|
||||
const allTimetables = timetableList.filter(tt => tt.data && tt.data.driverId === train.driverId && tt.trainNo !== train.trainNo);
|
||||
|
||||
// if (!timetable || !timetable.data) return acc;
|
||||
|
||||
if (allTimetables.length > 0)
|
||||
return acc;
|
||||
|
||||
if (!train.online && !timetable) return acc;;
|
||||
|
||||
const trainStopData = state.stationList
|
||||
.find(station => station.name === train.currentStationName)
|
||||
|
||||
Reference in New Issue
Block a user