mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 21:38:13 +00:00
Zmiana wyglądu filtrów widoku pociągów
This commit is contained in:
+18
-6
@@ -1,6 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app">
|
<div class="app">
|
||||||
<UpdateModal :currentVersion="VERSION" @toggleUpdateModal="toggleUpdateModal" v-if="updateModalVisible" />
|
<UpdateModal
|
||||||
|
:currentVersion="VERSION"
|
||||||
|
@toggleUpdateModal="toggleUpdateModal"
|
||||||
|
v-if="updateModalVisible"
|
||||||
|
/>
|
||||||
|
|
||||||
<div class="app_container">
|
<div class="app_container">
|
||||||
<header class="app_header">
|
<header class="app_header">
|
||||||
@@ -22,9 +26,15 @@
|
|||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span class="header_links">
|
<span class="header_links">
|
||||||
<router-link class="route" active-class="route-active" to="/" exact>SCENERIE</router-link>/
|
<router-link class="route" active-class="route-active" to="/" exact
|
||||||
<router-link class="route" active-class="route-active" to="/trains">POCIĄGI</router-link>/
|
>SCENERIE</router-link
|
||||||
<router-link class="route" active-class="route-active" to="/history">DZIENNIK</router-link>
|
>/
|
||||||
|
<router-link class="route" active-class="route-active" to="/trains"
|
||||||
|
>POCIĄGI</router-link
|
||||||
|
>/
|
||||||
|
<router-link class="route" active-class="route-active" to="/history"
|
||||||
|
>DZIENNIK</router-link
|
||||||
|
>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
@@ -39,8 +49,10 @@
|
|||||||
|
|
||||||
<footer class="app_footer">
|
<footer class="app_footer">
|
||||||
©
|
©
|
||||||
<a href="https://td2.info.pl/profile/?u=20777" target="_blank">Spythere</a>
|
<a href="https://td2.info.pl/profile/?u=20777" target="_blank">
|
||||||
2021 | v{{VERSION}}
|
Spythere
|
||||||
|
</a>
|
||||||
|
2021 | v{{ VERSION }}
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,8 +3,16 @@
|
|||||||
<h3 class="timetable-header">
|
<h3 class="timetable-header">
|
||||||
<span>AKTYWNE ROZKŁADY JAZDY</span>
|
<span>AKTYWNE ROZKŁADY JAZDY</span>
|
||||||
|
|
||||||
<a v-if="!timetableOnly" :href="currentURL + '&timetable_only=1'" target="_blank">
|
<a
|
||||||
<img :src="viewIcon" alt="icon-view" title="Wyodrębnij rozkłady jazdy" />
|
v-if="!timetableOnly"
|
||||||
|
:href="currentURL + '&timetable_only=1'"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
:src="viewIcon"
|
||||||
|
alt="icon-view"
|
||||||
|
title="Wyodrębnij rozkłady jazdy"
|
||||||
|
/>
|
||||||
</a>
|
</a>
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
@@ -16,7 +24,12 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul class="option-list" :class="{ open: listOpen }">
|
<ul class="option-list" :class="{ open: listOpen }">
|
||||||
<li class="option-item" v-for="(cp, i) in stationInfo.checkpoints" :key="i" @click="() => chooseOption(cp.checkpointName)">
|
<li
|
||||||
|
class="option-item"
|
||||||
|
v-for="(cp, i) in stationInfo.checkpoints"
|
||||||
|
:key="i"
|
||||||
|
@click="() => chooseOption(cp.checkpointName)"
|
||||||
|
>
|
||||||
<input type="option-radio" name="sort" />
|
<input type="option-radio" name="sort" />
|
||||||
<label :id="cp.checkpointName">{{ cp.checkpointName }}</label>
|
<label :id="cp.checkpointName">{{ cp.checkpointName }}</label>
|
||||||
</li>
|
</li>
|
||||||
@@ -24,50 +37,74 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<span class="timetable-item loading" v-if="dataStatus == 0">Ładowanie...</span>
|
<span class="timetable-item loading" v-if="dataStatus == 0"
|
||||||
|
>Ładowanie...</span
|
||||||
|
>
|
||||||
|
|
||||||
<span class="timetable-item empty" v-else-if="computedScheduledTrains.length == 0">Brak aktywnych rozkładów!</span>
|
<span
|
||||||
|
class="timetable-item empty"
|
||||||
|
v-else-if="computedScheduledTrains.length == 0"
|
||||||
|
>Brak aktywnych rozkładów!</span
|
||||||
|
>
|
||||||
|
|
||||||
<transition-group name="list-anim">
|
<transition-group name="list-anim">
|
||||||
<div class="timetable-item" v-for="(scheduledTrain, i) in computedScheduledTrains" :key="i+1">
|
<div
|
||||||
|
class="timetable-item"
|
||||||
|
v-for="(scheduledTrain, i) in computedScheduledTrains"
|
||||||
|
:key="i + 1"
|
||||||
|
>
|
||||||
<span class="timetable-general">
|
<span class="timetable-general">
|
||||||
<span class="general-info">
|
<span class="general-info">
|
||||||
<router-link :to="{
|
<router-link
|
||||||
name: 'TrainsView',
|
:to="{
|
||||||
params: {
|
name: 'TrainsView',
|
||||||
passedSearchedTrain: scheduledTrain.trainNo.toString(),
|
params: {
|
||||||
},
|
queryTrain: scheduledTrain.trainNo.toString(),
|
||||||
}">
|
},
|
||||||
|
}"
|
||||||
|
>
|
||||||
<span>
|
<span>
|
||||||
<strong>{{ scheduledTrain.category }}</strong>
|
<strong>{{ scheduledTrain.category }}</strong>
|
||||||
{{ scheduledTrain.trainNo }}
|
{{ scheduledTrain.trainNo }}
|
||||||
</span>
|
</span> </router-link
|
||||||
</router-link>|
|
>|
|
||||||
<span>
|
<span>
|
||||||
<a :href="
|
<a
|
||||||
'https://td2.info.pl/profile/?u=' + scheduledTrain.driverId
|
:href="
|
||||||
" target="_blank">{{ scheduledTrain.driverName }}</a>
|
'https://td2.info.pl/profile/?u=' + scheduledTrain.driverId
|
||||||
|
"
|
||||||
|
target="_blank"
|
||||||
|
>{{ scheduledTrain.driverName }}</a
|
||||||
|
>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<div class="info-route">
|
<div class="info-route">
|
||||||
<strong>{{ scheduledTrain.beginsAt }} - {{ scheduledTrain.terminatesAt }}</strong>
|
<strong
|
||||||
|
>{{ scheduledTrain.beginsAt }} -
|
||||||
|
{{ scheduledTrain.terminatesAt }}</strong
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span class="general-status">
|
<span class="general-status">
|
||||||
<span :class="scheduledTrain.stopStatus">{{scheduledTrain.stopLabel}}</span>
|
<span :class="scheduledTrain.stopStatus">{{
|
||||||
|
scheduledTrain.stopLabel
|
||||||
|
}}</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span class="timetable-schedule">
|
<span class="timetable-schedule">
|
||||||
<span class="schedule-arrival">
|
<span class="schedule-arrival">
|
||||||
<span class="arrival-time begins" v-if="scheduledTrain.stopInfo.beginsHere">
|
<span
|
||||||
|
class="arrival-time begins"
|
||||||
|
v-if="scheduledTrain.stopInfo.beginsHere"
|
||||||
|
>
|
||||||
ROZPOCZYNA
|
ROZPOCZYNA
|
||||||
<div>BIEG</div>
|
<div>BIEG</div>
|
||||||
</span>
|
</span>
|
||||||
<span class="arrival-time" v-else>
|
<span class="arrival-time" v-else>
|
||||||
{{ scheduledTrain.stopInfo.arrivalTimeString }} ({{
|
{{ scheduledTrain.stopInfo.arrivalTimeString }} ({{
|
||||||
scheduledTrain.stopInfo.arrivalDelay
|
scheduledTrain.stopInfo.arrivalDelay
|
||||||
}})
|
}})
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
@@ -80,10 +117,14 @@
|
|||||||
<span class="stop-arrow arrow"></span>
|
<span class="stop-arrow arrow"></span>
|
||||||
</span>
|
</span>
|
||||||
<span class="schedule-departure">
|
<span class="schedule-departure">
|
||||||
<span class="departure-time terminates" v-if="scheduledTrain.stopInfo.terminatesHere">KOŃCZY BIEG</span>
|
<span
|
||||||
|
class="departure-time terminates"
|
||||||
|
v-if="scheduledTrain.stopInfo.terminatesHere"
|
||||||
|
>KOŃCZY BIEG</span
|
||||||
|
>
|
||||||
<span class="departure-time" v-else>
|
<span class="departure-time" v-else>
|
||||||
{{ scheduledTrain.stopInfo.departureTimeString }} ({{
|
{{ scheduledTrain.stopInfo.departureTimeString }} ({{
|
||||||
scheduledTrain.stopInfo.departureDelay
|
scheduledTrain.stopInfo.departureDelay
|
||||||
}})
|
}})
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -0,0 +1,280 @@
|
|||||||
|
<template>
|
||||||
|
<div class="train-options">
|
||||||
|
<div class="options_wrapper">
|
||||||
|
<div class="train-sorter option">
|
||||||
|
<div class="train-sorter_wrapper">
|
||||||
|
<div class="train-sorter_selected" @click="toggleSorterOptions">
|
||||||
|
<span>{{ currentSorterOption }}</span>
|
||||||
|
<img :src="descIcon" alt="icon-select" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="train-sorter_options">
|
||||||
|
<ul :class="{ open: sorterOptionsOpen }">
|
||||||
|
<li
|
||||||
|
v-for="(option, i) in sorterOptions"
|
||||||
|
:key="i"
|
||||||
|
@click="() => chooseOption(option)"
|
||||||
|
>
|
||||||
|
<input type="radio" name="sort" :id="option.id" />
|
||||||
|
<label :for="option.id">{{ option.content }}</label>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="train-search_train option">
|
||||||
|
<div class="search-box">
|
||||||
|
<input
|
||||||
|
class="search-input"
|
||||||
|
placeholder="Szukaj nr pociągu..."
|
||||||
|
v-model="searchedTrain"
|
||||||
|
/>
|
||||||
|
<img
|
||||||
|
class="search-exit"
|
||||||
|
:src="exitIcon"
|
||||||
|
alt="exit-icon"
|
||||||
|
@click="() => (searchedTrain = '')"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="train-search_driver option">
|
||||||
|
<div class="search-box">
|
||||||
|
<input
|
||||||
|
class="search-input"
|
||||||
|
placeholder="Szukaj maszynisty..."
|
||||||
|
v-model="searchedDriver"
|
||||||
|
/>
|
||||||
|
<img
|
||||||
|
class="search-exit"
|
||||||
|
:src="exitIcon"
|
||||||
|
alt="exit-icon"
|
||||||
|
@click="() => (searchedDriver = '')"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { Component, Vue, Watch, Prop } from "vue-property-decorator";
|
||||||
|
|
||||||
|
@Component
|
||||||
|
export default class TrainOptions extends Vue {
|
||||||
|
ascIcon = require("@/assets/icon-arrow-asc.svg");
|
||||||
|
descIcon = require("@/assets/icon-arrow-desc.svg");
|
||||||
|
exitIcon = require("@/assets/icon-exit.svg");
|
||||||
|
|
||||||
|
clickEventListener!: EventListener;
|
||||||
|
|
||||||
|
sorterOptionsOpen = false;
|
||||||
|
currentSorterOption = "kilometraż";
|
||||||
|
|
||||||
|
searchedTrain = "";
|
||||||
|
searchedDriver = "";
|
||||||
|
|
||||||
|
// Passed as component parameters
|
||||||
|
@Prop() readonly queryTrain!: string;
|
||||||
|
@Prop() readonly focusedTrain!: string;
|
||||||
|
|
||||||
|
sorterOptions: { id: string; content: string }[] = [
|
||||||
|
{
|
||||||
|
id: "mass",
|
||||||
|
content: "masa",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "speed",
|
||||||
|
content: "prędkość",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "length",
|
||||||
|
content: "długość",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "distance",
|
||||||
|
content: "kilometraż",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "timetable",
|
||||||
|
content: "numer pociągu",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
toggleSorterOptions() {
|
||||||
|
this.sorterOptionsOpen = !this.sorterOptionsOpen;
|
||||||
|
}
|
||||||
|
|
||||||
|
closeSorterOptions() {
|
||||||
|
this.sorterOptionsOpen = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
chooseOption(option: { id: string; content: string }) {
|
||||||
|
this.$emit("changeSorter", { id: option.id, dir: -1 });
|
||||||
|
this.currentSorterOption = option.content;
|
||||||
|
|
||||||
|
this.closeSorterOptions();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Watch("searchedTrain")
|
||||||
|
onSearchedTrainChanged(train: string) {
|
||||||
|
this.$emit("changeSearchedTrain", train);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Watch("searchedDriver")
|
||||||
|
onSearchedDriverChanged(driver: string) {
|
||||||
|
this.$emit("changeSearchedDriver", driver);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Watch("queryTrain")
|
||||||
|
onQueryTrainChanged(train: string) {
|
||||||
|
if (train && train != "") {
|
||||||
|
this.searchedTrain = train;
|
||||||
|
this.searchedDriver = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Watch("focusedTrain")
|
||||||
|
onFocusedTrainChanged(train: string) {
|
||||||
|
this.searchedTrain = train;
|
||||||
|
this.searchedDriver = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import "../../styles/responsive";
|
||||||
|
|
||||||
|
.train-options {
|
||||||
|
@include smallScreen() {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.options_wrapper {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
margin-bottom: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.option {
|
||||||
|
background: #333;
|
||||||
|
border-radius: 0.5em 0.5em 0 0;
|
||||||
|
|
||||||
|
margin-right: 0.5rem;
|
||||||
|
|
||||||
|
@include smallScreen() {
|
||||||
|
width: 100%;
|
||||||
|
margin: 0.5rem 0;
|
||||||
|
|
||||||
|
font-size: 1.15em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.train-sorter {
|
||||||
|
user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
|
||||||
|
&_options {
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
ul {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
transition: all 150ms ease-in;
|
||||||
|
|
||||||
|
z-index: 9;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
max-height: 0;
|
||||||
|
|
||||||
|
&.open {
|
||||||
|
max-height: 250px;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
display: flex;
|
||||||
|
transition: background 150ms ease-in;
|
||||||
|
|
||||||
|
background-color: rgba(#222, 0.95);
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
border-radius: 0 0 0.5em 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: rgba(#868686, 0.85);
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
width: 100%;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&_selected {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
padding: 0.5rem 0.5rem;
|
||||||
|
min-width: 200px;
|
||||||
|
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
span {
|
||||||
|
margin-right: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
max-width: 2em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.search {
|
||||||
|
&-box {
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
background: #333;
|
||||||
|
border-radius: 0.5em;
|
||||||
|
min-width: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-input {
|
||||||
|
border: none;
|
||||||
|
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
margin: 0;
|
||||||
|
|
||||||
|
font-size: 1em;
|
||||||
|
|
||||||
|
min-width: 85%;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-exit {
|
||||||
|
position: absolute;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
top: 50%;
|
||||||
|
right: 10px;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
|
||||||
|
width: 1em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -80,16 +80,10 @@ export default class extends Vue {
|
|||||||
@import "../../styles/responsive.scss";
|
@import "../../styles/responsive.scss";
|
||||||
|
|
||||||
.train-search {
|
.train-search {
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search {
|
.search {
|
||||||
padding-right: 1rem;
|
|
||||||
|
|
||||||
&-box {
|
&-box {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
<div class="train-sorter">
|
<div class="train-sorter">
|
||||||
<div class="sorter-wrapper">
|
<div class="sorter-wrapper">
|
||||||
<div class="sorter-box">
|
<div class="sorter-box">
|
||||||
<div class="title">Sortuj według</div>
|
|
||||||
|
|
||||||
<div class="selected" @click="toggleOptionList">
|
<div class="selected" @click="toggleOptionList">
|
||||||
<span>{{ sorterName }}</span>
|
<span>{{ sorterName }}</span>
|
||||||
<img :src="require('@/assets/icon-select.svg')" alt="icon-select" />
|
<img :src="require('@/assets/icon-select.svg')" alt="icon-select" />
|
||||||
@@ -88,10 +86,6 @@ export default class TrainSorter extends Vue {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.title {
|
|
||||||
padding-left: 0.3em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sorter-wrapper {
|
.sorter-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
|
|||||||
@@ -115,8 +115,11 @@ export default class TrainStats extends Vue {
|
|||||||
if (this.trains.length == 0) return { avg: "0", min: "0", max: "0" };
|
if (this.trains.length == 0) return { avg: "0", min: "0", max: "0" };
|
||||||
|
|
||||||
const avg = (
|
const avg = (
|
||||||
this.trains.reduce((acc, train) => train.timetableData ? acc + train.timetableData.routeDistance : acc, 0) /
|
this.trains.reduce(
|
||||||
this.trains.length
|
(acc, train) =>
|
||||||
|
train.timetableData ? acc + train.timetableData.routeDistance : acc,
|
||||||
|
0
|
||||||
|
) / this.trains.length
|
||||||
).toFixed(2);
|
).toFixed(2);
|
||||||
|
|
||||||
const minMax = this.trains.reduce((acc, train) => {
|
const minMax = this.trains.reduce((acc, train) => {
|
||||||
@@ -143,7 +146,9 @@ export default class TrainStats extends Vue {
|
|||||||
|
|
||||||
acc.set(
|
acc.set(
|
||||||
train.timetableData.category,
|
train.timetableData.category,
|
||||||
acc.get(train.timetableData.category) ? acc.get(train.timetableData.category) + 1 : 1
|
acc.get(train.timetableData.category)
|
||||||
|
? acc.get(train.timetableData.category) + 1
|
||||||
|
: 1
|
||||||
);
|
);
|
||||||
|
|
||||||
return acc;
|
return acc;
|
||||||
@@ -172,8 +177,12 @@ export default class TrainStats extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get specialTrainCount(): [number, number] {
|
get specialTrainCount(): [number, number] {
|
||||||
const twrList = this.trains.filter((train) => train.timetableData && train.timetableData.TWR);
|
const twrList = this.trains.filter(
|
||||||
const skrList = this.trains.filter((train) => train.timetableData && train.timetableData.SKR);
|
(train) => train.timetableData && train.timetableData.TWR
|
||||||
|
);
|
||||||
|
const skrList = this.trains.filter(
|
||||||
|
(train) => train.timetableData && train.timetableData.SKR
|
||||||
|
);
|
||||||
|
|
||||||
return [twrList.length, skrList.length];
|
return [twrList.length, skrList.length];
|
||||||
}
|
}
|
||||||
@@ -198,11 +207,14 @@ export default class TrainStats extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.train-stats {
|
.train-stats {
|
||||||
padding: 0.3em 0;
|
|
||||||
font-size: 1.1em;
|
font-size: 1.1em;
|
||||||
z-index: 5;
|
z-index: 10;
|
||||||
|
|
||||||
|
margin-bottom: 0.5em;
|
||||||
|
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stats {
|
.stats {
|
||||||
@@ -219,6 +231,7 @@ export default class TrainStats extends Vue {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
max-width: 700px;
|
max-width: 700px;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
background: rgba(black, 0.85);
|
background: rgba(black, 0.85);
|
||||||
border-radius: 0 1em 1em 1em;
|
border-radius: 0 1em 1em 1em;
|
||||||
|
|||||||
@@ -181,25 +181,21 @@ import { Vue, Component, Prop, Watch } from "vue-property-decorator";
|
|||||||
|
|
||||||
const unknownTrainImage = require("@/assets/unknown.png");
|
const unknownTrainImage = require("@/assets/unknown.png");
|
||||||
|
|
||||||
const ascSVG = require("@/assets/icon-arrow-asc.svg");
|
|
||||||
const descSVG = require("@/assets/icon-arrow-desc.svg");
|
|
||||||
|
|
||||||
import Train from "@/scripts/interfaces/Train";
|
import Train from "@/scripts/interfaces/Train";
|
||||||
import Station from "@/scripts/interfaces/Station";
|
|
||||||
|
|
||||||
import TrainSchedule from "@/components/TrainsView/TrainSchedule.vue";
|
import TrainSchedule from "@/components/TrainsView/TrainSchedule.vue";
|
||||||
import TrainStop from '@/scripts/interfaces/TrainStop';
|
import TrainStop from "@/scripts/interfaces/TrainStop";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
components: { TrainSchedule }
|
components: { TrainSchedule },
|
||||||
})
|
})
|
||||||
export default class TrainTable extends Vue {
|
export default class TrainTable extends Vue {
|
||||||
@Prop() computedTrains!: Train[];
|
@Prop() computedTrains!: Train[];
|
||||||
|
|
||||||
showedSchedule = 0;
|
showedSchedule = 0;
|
||||||
|
|
||||||
ascSVG = ascSVG;
|
ascSVG = require("@/assets/icon-arrow-asc.svg");
|
||||||
descSVG = descSVG;
|
descSVG = require("@/assets/icon-arrow-desc.svg");
|
||||||
|
|
||||||
speedIcon: string = require("@/assets/icon-speed.svg");
|
speedIcon: string = require("@/assets/icon-speed.svg");
|
||||||
massIcon: string = require("@/assets/icon-mass.svg");
|
massIcon: string = require("@/assets/icon-mass.svg");
|
||||||
@@ -220,15 +216,29 @@ export default class TrainTable extends Vue {
|
|||||||
|
|
||||||
generateStopList(stops: any): string | undefined {
|
generateStopList(stops: any): string | undefined {
|
||||||
if (!stops) return "";
|
if (!stops) return "";
|
||||||
return stops.reduce((acc, stop: TrainStop, i) => {
|
return stops
|
||||||
if (stop.stopType.includes("ph")) acc.push(`<strong style='color:${stop.confirmed ? "springgreen" : "white"}'>${stop.stopName}</strong>`);
|
.reduce((acc, stop: TrainStop, i) => {
|
||||||
else if (i > 0 && i < stops.length - 1 && !stop.stopNameRAW.includes("po."))
|
if (stop.stopType.includes("ph"))
|
||||||
acc.push(`<span style='color:${stop.confirmed ? "springgreen" : "lightgray"}'>${stop.stopName}</span>`);
|
acc.push(
|
||||||
return acc;
|
`<strong style='color:${
|
||||||
}, []).join(" * ");
|
stop.confirmed ? "springgreen" : "white"
|
||||||
|
}'>${stop.stopName}</strong>`
|
||||||
|
);
|
||||||
|
else if (
|
||||||
|
i > 0 &&
|
||||||
|
i < stops.length - 1 &&
|
||||||
|
!stop.stopNameRAW.includes("po.") &&
|
||||||
|
!stop.stopNameRAW.includes("SBL")
|
||||||
|
)
|
||||||
|
acc.push(
|
||||||
|
`<span style='color:${
|
||||||
|
stop.confirmed ? "springgreen" : "lightgray"
|
||||||
|
}'>${stop.stopName}</span>`
|
||||||
|
);
|
||||||
|
return acc;
|
||||||
|
}, [])
|
||||||
|
.join(" > ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -249,6 +259,8 @@ export default class TrainTable extends Vue {
|
|||||||
|
|
||||||
.train {
|
.train {
|
||||||
&-list {
|
&-list {
|
||||||
|
font-size: 1.05em;
|
||||||
|
|
||||||
@include smallScreen() {
|
@include smallScreen() {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@@ -266,13 +278,12 @@ export default class TrainTable extends Vue {
|
|||||||
& > .wrapper {
|
& > .wrapper {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
|
grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
|
||||||
font-size: calc(0.4rem + 0.5vw);
|
|
||||||
|
|
||||||
@include smallScreen() {
|
@include smallScreen() {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
grid-template-rows: repeat(3, minmax(100px, 1fr));
|
grid-template-rows: repeat(3, minmax(100px, 1fr));
|
||||||
|
|
||||||
font-size: 0.8rem;
|
font-size: 1.1em;
|
||||||
gap: 0.4em 0;
|
gap: 0.4em 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -305,7 +316,7 @@ export default class TrainTable extends Vue {
|
|||||||
background: #1085b3;
|
background: #1085b3;
|
||||||
border-radius: 1em;
|
border-radius: 1em;
|
||||||
|
|
||||||
font-size: 0.9em;
|
font-size: 0.85em;
|
||||||
|
|
||||||
-moz-user-select: none;
|
-moz-user-select: none;
|
||||||
-webkit-user-select: none;
|
-webkit-user-select: none;
|
||||||
@@ -330,14 +341,14 @@ export default class TrainTable extends Vue {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
font-size: 1.25em;
|
font-size: 1.3em;
|
||||||
margin: 5px 0;
|
margin: 5px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-stops {
|
&-stops {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
|
||||||
font-size: 0.75em;
|
font-size: 0.7em;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-online {
|
&-online {
|
||||||
@@ -374,23 +385,16 @@ export default class TrainTable extends Vue {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
||||||
&-exp {
|
|
||||||
font-size: 1.4em;
|
|
||||||
padding: 0.3em 0.6em;
|
|
||||||
|
|
||||||
border-radius: 0.4em;
|
|
||||||
|
|
||||||
background-color: red;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-name {
|
&-name {
|
||||||
margin: 0 0.3em;
|
margin: 0 0.3em;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
font-size: 1.1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-type {
|
&-type {
|
||||||
color: #bbb;
|
color: #bbb;
|
||||||
margin-left: 1em;
|
margin-left: 0.5em;
|
||||||
|
font-size: 1.1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-loco {
|
&-loco {
|
||||||
@@ -400,7 +404,7 @@ export default class TrainTable extends Vue {
|
|||||||
|
|
||||||
&-loco img {
|
&-loco img {
|
||||||
width: 13em;
|
width: 13em;
|
||||||
max-width: 190px;
|
max-width: 200px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -433,8 +437,6 @@ export default class TrainTable extends Vue {
|
|||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
font-size: 0.9em;
|
|
||||||
|
|
||||||
p {
|
p {
|
||||||
color: #00cff3;
|
color: #00cff3;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export default class StationFilterManager {
|
|||||||
|
|
||||||
private sorter: { index: number; dir: number } = { index: 0, dir: 1 };
|
private sorter: { index: number; dir: number } = { index: 0, dir: 1 };
|
||||||
|
|
||||||
private filteredStationList(stationList: Station[]): Station[] {
|
getFilteredStationList(stationList: Station[]): Station[] {
|
||||||
return stationList
|
return stationList
|
||||||
.filter(station => {
|
.filter(station => {
|
||||||
if ((station.nonPublic || !station.reqLevel) && this.filters['nonPublic']) return false;
|
if ((station.nonPublic || !station.reqLevel) && this.filters['nonPublic']) return false;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
@mixin smallScreen() {
|
@mixin smallScreen() {
|
||||||
@media only screen and (max-width: 650px) {
|
@media only screen and (max-width: 700px) {
|
||||||
@content;
|
@content;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+49
-11
@@ -3,15 +3,25 @@
|
|||||||
<div class="history_wrapper">
|
<div class="history_wrapper">
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<h2>DZIENNIK AKTYWNOŚCI SCENERII</h2>
|
<h2>DZIENNIK AKTYWNOŚCI SCENERII</h2>
|
||||||
<p style="color: #ccc;">Pokazuje dyżurnych, którzy ostatnio byli aktywni na wybranej scenerii</p>
|
<p style="color: #ccc">
|
||||||
|
Pokazuje dyżurnych, którzy ostatnio byli aktywni na wybranej scenerii
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="search-box">
|
<div class="search-box">
|
||||||
<div class="search-box_content">
|
<div class="search-box_content">
|
||||||
<label :class="{ disabled: dataLoading }">
|
<label :class="{ disabled: dataLoading }">
|
||||||
<select v-model="inputStationName" :disabled="dataLoading">
|
<select v-model="inputStationName" :disabled="dataLoading">
|
||||||
<option value disabled selected hidden>{{ dataLoading ? 'Pobieranie danych...' : 'Wybierz scenerię' }}</option>
|
<option value disabled selected hidden>
|
||||||
<option v-for="(station) in filteredStationList" :key="station" :value="station">{{ station }}</option>
|
{{ dataLoading ? "Pobieranie danych..." : "Wybierz scenerię" }}
|
||||||
|
</option>
|
||||||
|
<option
|
||||||
|
v-for="station in filteredStationList"
|
||||||
|
:key="station"
|
||||||
|
:value="station"
|
||||||
|
>
|
||||||
|
{{ station }}
|
||||||
|
</option>
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
@@ -19,35 +29,63 @@
|
|||||||
|
|
||||||
<div class="disclaimer">
|
<div class="disclaimer">
|
||||||
<h4>Ta funkcjonalność jest w testach beta!</h4>
|
<h4>Ta funkcjonalność jest w testach beta!</h4>
|
||||||
<p>Informacje pokazywane na ekranie mogą znikać, a ich zawartość może być fałszywa!</p>
|
<p>
|
||||||
|
Informacje pokazywane na ekranie mogą znikać, a ich zawartość może być
|
||||||
|
fałszywa!
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="list">
|
<div class="list">
|
||||||
<div class="list_wrapper">
|
<div class="list_wrapper">
|
||||||
<!-- <div class="list_loading" v-if="dataLoading">POBIERANIE DANYCH...</div> -->
|
<!-- <div class="list_loading" v-if="dataLoading">POBIERANIE DANYCH...</div> -->
|
||||||
<transition name="list-anim" mode="out-in">
|
<transition name="list-anim" mode="out-in">
|
||||||
<ul class="list_content" v-if="!dataLoading && !historyLoading && computedHistoryList.length != 0" :key="inputStationName">
|
<ul
|
||||||
|
class="list_content"
|
||||||
|
v-if="
|
||||||
|
!dataLoading &&
|
||||||
|
!historyLoading &&
|
||||||
|
computedHistoryList.length != 0
|
||||||
|
"
|
||||||
|
:key="inputStationName"
|
||||||
|
>
|
||||||
<li v-if="currentDispatcherFrom != -1" class="current">
|
<li v-if="currentDispatcherFrom != -1" class="current">
|
||||||
<div class="dispatcher-name">
|
<div class="dispatcher-name">
|
||||||
<a :href="`https://td2.info.pl/profile/?u=${currentDispatcherId}`">{{ currentDispatcher}}</a>
|
<a
|
||||||
|
:href="`https://td2.info.pl/profile/?u=${currentDispatcherId}`"
|
||||||
|
>{{ currentDispatcher }}</a
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="dispatcher-date">
|
<div class="dispatcher-date">
|
||||||
<span style="color: #bbb">{{ new Date(currentDispatcherFrom).toLocaleDateString('pl-PL') }}</span>
|
<span style="color: #bbb">{{
|
||||||
{{ new Date(currentDispatcherFrom).toLocaleTimeString('pl-PL', { hour: '2-digit', minute: '2-digit' })}}
|
new Date(currentDispatcherFrom).toLocaleDateString("pl-PL")
|
||||||
|
}}</span>
|
||||||
|
{{
|
||||||
|
new Date(currentDispatcherFrom).toLocaleTimeString(
|
||||||
|
"pl-PL",
|
||||||
|
{ hour: "2-digit", minute: "2-digit" }
|
||||||
|
)
|
||||||
|
}}
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li v-for="(history, i) in computedHistoryList" :key="i">
|
<li v-for="(history, i) in computedHistoryList" :key="i">
|
||||||
<div class="dispatcher-name">
|
<div class="dispatcher-name">
|
||||||
<a :href="`https://td2.info.pl/profile/?u=${history.dispatcherId}`">{{ history.dispatcherName }}</a>
|
<a
|
||||||
|
:href="`https://td2.info.pl/profile/?u=${history.dispatcherId}`"
|
||||||
|
>{{ history.dispatcherName }}</a
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="dispatcher-date">
|
<div class="dispatcher-date">
|
||||||
<div>
|
<div>
|
||||||
<span style="color: #888">{{history.dispatcherFromDate }}</span>
|
<span style="color: #888">{{
|
||||||
|
history.dispatcherFromDate
|
||||||
|
}}</span>
|
||||||
{{ history.dispatcherFromTime }}
|
{{ history.dispatcherFromTime }}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<span style="color: #888">{{ history.dispatcherToDate }}</span>
|
<span style="color: #888">{{
|
||||||
|
history.dispatcherToDate
|
||||||
|
}}</span>
|
||||||
{{ history.dispatcherToTime }}
|
{{ history.dispatcherToTime }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,8 +6,15 @@
|
|||||||
<div class="stations_body">
|
<div class="stations_body">
|
||||||
<div class="body_bar">
|
<div class="body_bar">
|
||||||
<div class="bar_actions">
|
<div class="bar_actions">
|
||||||
<button class="action-btn" :class="{ open: filterCardOpen }" @click="() => toggleCardsState('filter')">
|
<button
|
||||||
<img :src="require('@/assets/icon-filter2.svg')" alt="icon-filter" />
|
class="action-btn"
|
||||||
|
:class="{ open: filterCardOpen }"
|
||||||
|
@click="() => toggleCardsState('filter')"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
:src="require('@/assets/icon-filter2.svg')"
|
||||||
|
alt="icon-filter"
|
||||||
|
/>
|
||||||
<p>FILTRY</p>
|
<p>FILTRY</p>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
@@ -20,13 +27,21 @@
|
|||||||
|
|
||||||
<div class="bar_indicators">
|
<div class="bar_indicators">
|
||||||
<transition name="indicator-anim">
|
<transition name="indicator-anim">
|
||||||
<span class="indicator_scenery-data" v-if="data.dataConnectionStatus < 2" :class="dataStatusClass">
|
<span
|
||||||
|
class="indicator_scenery-data"
|
||||||
|
v-if="data.dataConnectionStatus < 2"
|
||||||
|
:class="dataStatusClass"
|
||||||
|
>
|
||||||
<img :src="trainIcon" alt="icon-train" />
|
<img :src="trainIcon" alt="icon-train" />
|
||||||
</span>
|
</span>
|
||||||
</transition>
|
</transition>
|
||||||
|
|
||||||
<transition name="indicator-anim">
|
<transition name="indicator-anim">
|
||||||
<span class="indicator_timetable-data" v-if="data.timetableDataStatus < 2" :class="timetableDataStatusClass">
|
<span
|
||||||
|
class="indicator_timetable-data"
|
||||||
|
v-if="data.timetableDataStatus < 2"
|
||||||
|
:class="timetableDataStatusClass"
|
||||||
|
>
|
||||||
<img :src="timetableIcon" alt="icon-timetable" />
|
<img :src="timetableIcon" alt="icon-timetable" />
|
||||||
</span>
|
</span>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -34,17 +49,31 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="body_table">
|
<div class="body_table">
|
||||||
<StationTable :stations="computedStations" :sorterActive="filterManager.getSorter()" :setFocusedStation="setFocusedStation" :changeSorter="changeSorter" />
|
<StationTable
|
||||||
|
:stations="computedStations"
|
||||||
|
:sorterActive="filterManager.getSorter()"
|
||||||
|
:setFocusedStation="setFocusedStation"
|
||||||
|
:changeSorter="changeSorter"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<transition name="card-anim">
|
<transition name="card-anim">
|
||||||
<StationCard v-if="focusedStationInfo" :stationInfo="focusedStationInfo" :exit="closeCard" />
|
<StationCard
|
||||||
|
v-if="focusedStationInfo"
|
||||||
|
:stationInfo="focusedStationInfo"
|
||||||
|
:exit="closeCard"
|
||||||
|
/>
|
||||||
</transition>
|
</transition>
|
||||||
|
|
||||||
<transition name="card-anim">
|
<transition name="card-anim">
|
||||||
<FilterCard v-if="filterCardOpen" :exit="() => toggleCardsState('filter')" @changeFilterValue="changeFilterValue" @resetFilters="resetFilters" />
|
<FilterCard
|
||||||
|
v-if="filterCardOpen"
|
||||||
|
:exit="() => toggleCardsState('filter')"
|
||||||
|
@changeFilterValue="changeFilterValue"
|
||||||
|
@resetFilters="resetFilters"
|
||||||
|
/>
|
||||||
</transition>
|
</transition>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -54,7 +83,6 @@ import { Vue, Component } from "vue-property-decorator";
|
|||||||
import { Getter } from "vuex-class";
|
import { Getter } from "vuex-class";
|
||||||
|
|
||||||
import Station from "@/scripts/interfaces/Station";
|
import Station from "@/scripts/interfaces/Station";
|
||||||
import Train from "@/scripts/interfaces/Train";
|
|
||||||
|
|
||||||
import StorageManager from "@/scripts/storageManager";
|
import StorageManager from "@/scripts/storageManager";
|
||||||
import StationFilterManager from "@/scripts/stationFilterManager";
|
import StationFilterManager from "@/scripts/stationFilterManager";
|
||||||
@@ -172,7 +200,7 @@ export default class StationsView extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get computedStations() {
|
get computedStations() {
|
||||||
return this.filterManager.filteredStationList(this.stationList);
|
return this.filterManager.getFilteredStationList(this.stationList);
|
||||||
}
|
}
|
||||||
|
|
||||||
closeCard() {
|
closeCard() {
|
||||||
|
|||||||
+28
-24
@@ -1,13 +1,29 @@
|
|||||||
<template>
|
<template>
|
||||||
<section class="trains-view">
|
<section class="trains-view">
|
||||||
<div class="body-wrapper">
|
<div class="body-wrapper">
|
||||||
<div class="options-wrapper">
|
<!-- <TrainSorter :trainList="computedTrains" @changeSorter="changeSorter" />
|
||||||
<TrainSorter :trainList="computedTrains" @changeSorter="changeSorter" />
|
<TrainSearch
|
||||||
<TrainSearch @changeSearchedTrain="changeSearchedTrain" @changeSearchedDriver="changeSearchedDriver" :passedSearchedTrain="passedSearchedTrain" :focusedTrain="focusedTrain" />
|
@changeSearchedTrain="changeSearchedTrain"
|
||||||
|
@changeSearchedDriver="changeSearchedDriver"
|
||||||
|
:passedSearchedTrain="passedSearchedTrain"
|
||||||
|
:focusedTrain="focusedTrain"
|
||||||
|
/> -->
|
||||||
|
|
||||||
|
<div class="options-bar">
|
||||||
|
<TrainStats :trains="trains" class="test" />
|
||||||
|
<TrainOptions
|
||||||
|
:queryTrain="queryTrain"
|
||||||
|
:focusedTrain="focusedTrain"
|
||||||
|
@changeSorter="changeSorter"
|
||||||
|
@changeSearchedTrain="changeSearchedTrain"
|
||||||
|
@changeSearchedDriver="changeSearchedDriver"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<TrainStats :trains="trains" />
|
<TrainTable
|
||||||
<TrainTable :computedTrains="computedTrains" @changeFocusedTrain="changeFocusedTrain" />
|
:computedTrains="computedTrains"
|
||||||
|
@changeFocusedTrain="changeFocusedTrain"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
@@ -15,31 +31,28 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Vue from "vue";
|
import Vue from "vue";
|
||||||
import { Component, Prop } from "vue-property-decorator";
|
import { Component, Prop } from "vue-property-decorator";
|
||||||
import { Getter, Action } from "vuex-class";
|
import { Getter } from "vuex-class";
|
||||||
|
|
||||||
import Station from "@/scripts/interfaces/Station";
|
|
||||||
import Train from "@/scripts/interfaces/Train";
|
import Train from "@/scripts/interfaces/Train";
|
||||||
|
|
||||||
import TrainSorter from "@/components/TrainsView/TrainSorter.vue";
|
|
||||||
import TrainSearch from "@/components/TrainsView/TrainSearch.vue";
|
|
||||||
import TrainTable from "@/components/TrainsView/TrainTable.vue";
|
import TrainTable from "@/components/TrainsView/TrainTable.vue";
|
||||||
import TrainStats from "@/components/TrainsView/TrainStats.vue";
|
import TrainStats from "@/components/TrainsView/TrainStats.vue";
|
||||||
|
import TrainOptions from "@/components/TrainsView/TrainOptions.vue";
|
||||||
import axios from "axios";
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
components: {
|
components: {
|
||||||
TrainSorter,
|
|
||||||
TrainTable,
|
TrainTable,
|
||||||
TrainStats,
|
TrainStats,
|
||||||
TrainSearch,
|
TrainOptions,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
export default class TrainsView extends Vue {
|
export default class TrainsView extends Vue {
|
||||||
@Getter("getTrainList") trains!: Train[];
|
@Getter("getTrainList") trains!: Train[];
|
||||||
@Prop() readonly passedSearchedTrain!: string;
|
|
||||||
|
|
||||||
sorterActive: { id: string; dir: number } = { id: "timetable", dir: 1 };
|
// Passed in route as query parameters
|
||||||
|
@Prop() readonly queryTrain!: string;
|
||||||
|
|
||||||
|
sorterActive: { id: string; dir: number } = { id: "distance", dir: -1 };
|
||||||
|
|
||||||
searchedTrain: string = "";
|
searchedTrain: string = "";
|
||||||
searchedDriver: string = "";
|
searchedDriver: string = "";
|
||||||
@@ -130,15 +143,6 @@ export default class TrainsView extends Vue {
|
|||||||
padding: 0 0.5rem;
|
padding: 0 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.options-wrapper {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
|
|
||||||
& > div {
|
|
||||||
margin-right: 1rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include bigScreen() {
|
@include bigScreen() {
|
||||||
.body-wrapper {
|
.body-wrapper {
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
|
|||||||
Reference in New Issue
Block a user