mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 21:38:13 +00:00
hotfix: proper schedule line tracks changing
This commit is contained in:
@@ -3,11 +3,11 @@
|
|||||||
<div class="schedule-wrapper" v-if="train.timetableData">
|
<div class="schedule-wrapper" v-if="train.timetableData">
|
||||||
<div class="stops">
|
<div class="stops">
|
||||||
<div
|
<div
|
||||||
v-for="(stop, i) in scheduleStopsV2"
|
v-for="(stop, i) in scheduleStops"
|
||||||
:key="i"
|
:key="i"
|
||||||
class="stop"
|
class="stop"
|
||||||
:data-status="stop.status"
|
:data-status="stop.status"
|
||||||
:data-sbl="stop.isSBL && stop.sceneryName == scheduleStopsV2[i + 1]?.sceneryName"
|
:data-sbl="stop.isSBL && stop.sceneryName == scheduleStops[i + 1]?.sceneryName"
|
||||||
:data-position="stop.position"
|
:data-position="stop.position"
|
||||||
:data-delayed="stop.departureDelay > 0"
|
:data-delayed="stop.departureDelay > 0"
|
||||||
:data-stop-type="stop.type"
|
:data-stop-type="stop.type"
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
<div></div>
|
<div></div>
|
||||||
|
|
||||||
<div class="progress">
|
<div class="progress">
|
||||||
<div class="line line_connection" v-if="i < scheduleStopsV2.length - 1"></div>
|
<div class="line line_connection" v-if="i < scheduleStops.length - 1"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="bottom-line-info">
|
<div class="bottom-line-info">
|
||||||
@@ -48,9 +48,9 @@
|
|||||||
<span
|
<span
|
||||||
v-if="
|
v-if="
|
||||||
stop.departureLine &&
|
stop.departureLine &&
|
||||||
(scheduleStopsV2[i + 1]?.arrivalLineInfo?.routeSpeed !=
|
(scheduleStops[i + 1]?.arrivalLineInfo?.routeSpeed !=
|
||||||
stop.arrivalLineInfo?.routeSpeed ||
|
stop.arrivalLineInfo?.routeSpeed ||
|
||||||
stop.sceneryName != scheduleStopsV2[i + 1]?.sceneryName)
|
stop.sceneryName != scheduleStops[i + 1]?.sceneryName)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<div class="scenery-route">
|
<div class="scenery-route">
|
||||||
@@ -85,13 +85,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
v-if="stop.sceneryName != scheduleStopsV2[i + 1]?.sceneryName"
|
v-if="stop.sceneryName != scheduleStops[i + 1]?.sceneryName"
|
||||||
class="scenery-change-name"
|
class="scenery-change-name"
|
||||||
>
|
>
|
||||||
<span>{{ scheduleStopsV2[i + 1].sceneryName }}</span>
|
<span>{{ scheduleStops[i + 1].sceneryName }}</span>
|
||||||
|
|
||||||
<i
|
<i
|
||||||
v-if="!scheduleStopsV2[i + 1].isSceneryOnline"
|
v-if="!scheduleStops[i + 1].isSceneryOnline"
|
||||||
class="fa-solid fa-ban fa-sm"
|
class="fa-solid fa-ban fa-sm"
|
||||||
data-tooltip-type="BaseTooltip"
|
data-tooltip-type="BaseTooltip"
|
||||||
:data-tooltip-content="$t('app.tooltip-scenery-offline')"
|
:data-tooltip-content="$t('app.tooltip-scenery-offline')"
|
||||||
@@ -101,30 +101,30 @@
|
|||||||
|
|
||||||
<div
|
<div
|
||||||
class="scenery-route"
|
class="scenery-route"
|
||||||
v-if="stop.sceneryName != scheduleStopsV2[i + 1]?.sceneryName"
|
v-if="stop.sceneryName != scheduleStops[i + 1]?.sceneryName"
|
||||||
>
|
>
|
||||||
<span> {{ scheduleStopsV2[i + 1].arrivalLine }}</span>
|
<span> {{ scheduleStops[i + 1].arrivalLine }}</span>
|
||||||
|
|
||||||
<span v-if="scheduleStopsV2[i + 1].arrivalLineInfo">
|
<span v-if="scheduleStops[i + 1].arrivalLineInfo">
|
||||||
<span> | {{ scheduleStopsV2[i + 1].arrivalLineInfo!.routeSpeed }} </span>
|
<span> | {{ scheduleStops[i + 1].arrivalLineInfo!.routeSpeed }} </span>
|
||||||
|
|
||||||
<img
|
<img
|
||||||
:src="
|
:src="
|
||||||
scheduleStopsV2[i + 1].arrivalLineInfo?.isElectric
|
scheduleStops[i + 1].arrivalLineInfo?.isElectric
|
||||||
? '/images/icon-catenary.svg'
|
? '/images/icon-catenary.svg'
|
||||||
: '/images/icon-we4a.png'
|
: '/images/icon-we4a.png'
|
||||||
"
|
"
|
||||||
data-tooltip-type="BaseTooltip"
|
data-tooltip-type="BaseTooltip"
|
||||||
:data-tooltip-content="
|
:data-tooltip-content="
|
||||||
$t(
|
$t(
|
||||||
`trains.${!scheduleStopsV2[i + 1].arrivalLineInfo?.isElectric ? 'no-' : ''}catenary-tooltip`
|
`trains.${!scheduleStops[i + 1].arrivalLineInfo?.isElectric ? 'no-' : ''}catenary-tooltip`
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
width="14"
|
width="14"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<img
|
<img
|
||||||
v-if="scheduleStopsV2[i + 1].arrivalLineInfo!.isRouteSBL"
|
v-if="scheduleStops[i + 1].arrivalLineInfo!.isRouteSBL"
|
||||||
src="/images/icon-sbl-transparent.svg"
|
src="/images/icon-sbl-transparent.svg"
|
||||||
width="14"
|
width="14"
|
||||||
data-tooltip-type="BaseTooltip"
|
data-tooltip-type="BaseTooltip"
|
||||||
@@ -206,7 +206,7 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
scheduleStopsV2() {
|
scheduleStops() {
|
||||||
if (!this.train.timetableData) return [];
|
if (!this.train.timetableData) return [];
|
||||||
|
|
||||||
const { timetablePath, followingStops } = this.train.timetableData;
|
const { timetablePath, followingStops } = this.train.timetableData;
|
||||||
@@ -224,20 +224,18 @@ export default defineComponent({
|
|||||||
let isActive = false;
|
let isActive = false;
|
||||||
|
|
||||||
if (pathData?.departureLineData) {
|
if (pathData?.departureLineData) {
|
||||||
arrivalLineInfo = pathData.departureLineData;
|
// arrivalLineInfo = pathData.departureLineData;
|
||||||
departureLineInfo = pathData.departureLineData;
|
departureLineInfo = pathData.departureLineData;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const stop of followingStops) {
|
for (const stop of followingStops) {
|
||||||
let isExternal = false;
|
let isExternal = false;
|
||||||
|
|
||||||
if (
|
if (stop.arrivalLine === currentPath.arrivalRouteExt) {
|
||||||
stop.arrivalLine &&
|
|
||||||
currentPath.arrivalRouteExt &&
|
|
||||||
stop.arrivalLine == currentPath.arrivalRouteExt
|
|
||||||
) {
|
|
||||||
isExternal = true;
|
isExternal = true;
|
||||||
|
|
||||||
|
departureLineInfo = pathData?.arrivalLineData ?? null;
|
||||||
|
|
||||||
if (pathData?.arrivalLineData) {
|
if (pathData?.arrivalLineData) {
|
||||||
arrivalLineInfo = pathData.arrivalLineData;
|
arrivalLineInfo = pathData.arrivalLineData;
|
||||||
}
|
}
|
||||||
@@ -282,8 +280,7 @@ export default defineComponent({
|
|||||||
departureLineInfo,
|
departureLineInfo,
|
||||||
|
|
||||||
isExternal,
|
isExternal,
|
||||||
|
isActive,
|
||||||
isActive: isActive,
|
|
||||||
|
|
||||||
isSBL: /sbl/gi.test(stop.stopName),
|
isSBL: /sbl/gi.test(stop.stopName),
|
||||||
position: stop.beginsHere ? 'begin' : stop.terminatesHere ? 'end' : 'en-route',
|
position: stop.beginsHere ? 'begin' : stop.terminatesHere ? 'end' : 'en-route',
|
||||||
@@ -312,11 +309,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
stopRows.push(rowData);
|
stopRows.push(rowData);
|
||||||
|
|
||||||
if (
|
if (stop.departureLine === currentPath.departureRouteExt) {
|
||||||
stop.departureLine &&
|
|
||||||
currentPath.departureRouteExt &&
|
|
||||||
stop.departureLine == currentPath.departureRouteExt
|
|
||||||
) {
|
|
||||||
// Reverse search for last scenery checkpoint
|
// Reverse search for last scenery checkpoint
|
||||||
if (pathData?.departureLineData) {
|
if (pathData?.departureLineData) {
|
||||||
stopRows[stopRows.length - 1].isExternal = true;
|
stopRows[stopRows.length - 1].isExternal = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user