From 02838b2be3f568c5f4adfa7221b4c24d0642f0ff Mon Sep 17 00:00:00 2001 From: Spythere Date: Tue, 21 Jul 2020 18:32:37 +0200 Subject: [PATCH] =?UTF-8?q?Migracja=20pozosta=C5=82ych=20klas=20i=20kompon?= =?UTF-8?q?ent=C3=B3w=20na=20TS,=20optymalizacja=20kodu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 42 ++- src/components/ui/AppBar.vue | 2 +- src/components/ui/LegendCard.vue | 5 + src/components/ui/List.vue | 474 ++++++++++++++---------------- src/components/ui/Options.vue | 2 +- src/components/ui/StationCard.vue | 48 +-- src/mixins/styleMixin.ts | 43 ++- src/scripts/interfaces/Filter.ts | 23 ++ src/scripts/interfaces/Station.ts | 23 ++ src/store/modules/store.ts | 26 +- 10 files changed, 338 insertions(+), 350 deletions(-) create mode 100644 src/scripts/interfaces/Filter.ts create mode 100644 src/scripts/interfaces/Station.ts diff --git a/src/App.vue b/src/App.vue index 8abcc45..a00dc22 100644 --- a/src/App.vue +++ b/src/App.vue @@ -14,9 +14,9 @@
- - - + + +
© Spythere 2020
@@ -36,30 +36,32 @@ import Clock from "@/components/ui/Clock.vue"; import AppBar from "@/components/ui/AppBar.vue"; enum ConnState { - Loading = 0, - Error = 1, - Connected = 2 + Loading = 0, + Error = 1, + Connected = 2 } @Component({ components: { Error, Loading, Clock, AppBar } }) export default class App extends Vue { - @Getter('getStations') stations - @Getter('getTrainCount') trainCount - @Getter("getStationCount") stationCount + @Getter("getStations") stations; + @Getter("getTrainCount") trainCount; + @Getter("getStationCount") stationCount; - @Action("initStations") initStations + @Action("initStations") initStations; errorMessage: string = ""; connectionState: ConnState = ConnState.Loading; - + mounted() { this.initStations(); - this.$store.watch((state, getters) => getters.getConnectionState, (state: ConnState) => this.connectionState = state); + this.$store.watch( + (state, getters) => getters.getConnectionState, + (state: ConnState) => (this.connectionState = state) + ); } - } @@ -126,7 +128,7 @@ input { border-radius: 1.3rem; font-weight: 500; - font-size: .95em; + font-size: 0.95em; padding: 0.25em 0.4em; background-color: #00be19; @@ -144,17 +146,13 @@ input { &.no-limit { background-color: #0077ae; - font-size: 0.9em; - } - - &.not-signed { - background-color: $accent2Col; - font-size: 0.8em; + font-size: 0.85em; } + &.not-signed, &.unavailable { background-color: $accent2Col; - font-size: 0.9em; + font-size: 0.8em; } &.brb { @@ -196,7 +194,7 @@ input { max-height: 95%; // font-size: calc(0.6rem + 0.5vw); - font-size: calc(0.55rem + 0.35vw); + font-size: calc(0.45rem + 0.35vw); @include smallScreen { width: 95%; diff --git a/src/components/ui/AppBar.vue b/src/components/ui/AppBar.vue index 0e32473..439fb4f 100644 --- a/src/components/ui/AppBar.vue +++ b/src/components/ui/AppBar.vue @@ -43,7 +43,7 @@ export default class AppBar extends Vue { position: sticky; top: 0; - font-size: 0.3em; + font-size: 0.25em; background: #222; } diff --git a/src/components/ui/LegendCard.vue b/src/components/ui/LegendCard.vue index 243470f..895d290 100644 --- a/src/components/ui/LegendCard.vue +++ b/src/components/ui/LegendCard.vue @@ -58,6 +58,11 @@ export default class LegendCard extends Vue { name: "mieszana", desc: "Sceneria ze sygnalizacją mieszaną (kształtowe, historyczne lub/i współczesne)" + }, + { + name: "SBL", + desc: + "Sceneria posiadająca samoczynną blokadę liniową na co najmniej jednym z jej szlaków" } ]; } diff --git a/src/components/ui/List.vue b/src/components/ui/List.vue index 40f2b9c..0dbaa06 100644 --- a/src/components/ui/List.vue +++ b/src/components/ui/List.vue @@ -27,293 +27,251 @@ - - {{station.stationName}} + + {{station.stationName}} - - {{ (station.reqLevel && station.reqLevel > -1) ? (parseInt(station.reqLevel) >= 2 ? station.reqLevel : "L") : "?" }} + + {{ (station.reqLevel && station.reqLevel > -1) ? (parseInt(station.reqLevel) >= 2 ? station.reqLevel : "L") : "?" }} - ? - + ? + - - {{station.occupiedTo}} - + + {{station.occupiedTo}} + - {{station.online ? station.dispatcherName : ""}} - - {{station.dispatcherExp < 2 ? 'L' : station.dispatcherExp}} - - {{station.online ? (station.currentUsers + "/" + station.maxUsers) : ""}} - - + {{station.online ? station.dispatcherName : ""}} + + {{station.dispatcherExp < 2 ? 'L' : station.dispatcherExp}} + + {{station.online ? (station.currentUsers + "/" + station.maxUsers) : ""}} + + - + - SBL + SBL - non-public - + non-public + - - {{station.routes.twoWay.catenary}} + + {{station.routes.twoWay.catenary}} - {{station.routes.twoWay.noCatenary}} - + {{station.routes.twoWay.noCatenary}} + - - {{station.routes.oneWay.catenary}} + + {{station.routes.oneWay.catenary}} - {{station.routes.oneWay.noCatenary}} - - + {{station.routes.oneWay.noCatenary}} + +