mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 21:38:13 +00:00
Zamiana menu na listę posterunków w karcie scenerii
This commit is contained in:
@@ -16,17 +16,19 @@
|
|||||||
</a>
|
</a>
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<div class="checkpoints">
|
<div
|
||||||
<select-box
|
class="checkpoints"
|
||||||
v-if="stationInfo && stationInfo.checkpoints"
|
v-if="stationInfo && stationInfo.online && stationInfo.checkpoints"
|
||||||
:itemList="
|
>
|
||||||
stationInfo.checkpoints.map((cp, i) => ({
|
<button
|
||||||
id: cp.checkpointName,
|
class="checkpoint_item btn--text"
|
||||||
value: cp.checkpointName,
|
:class="{ current: selectedCheckpoint === cp.checkpointName }"
|
||||||
}))
|
v-for="cp in stationInfo.checkpoints"
|
||||||
"
|
:key="cp.checkpointName"
|
||||||
@selected="selectCheckpoint"
|
@click="selectCheckpoint(cp)"
|
||||||
></select-box>
|
>
|
||||||
|
{{ cp.checkpointName }}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<span class="timetable-item loading" v-if="dataStatus == 0">{{
|
<span class="timetable-item loading" v-if="dataStatus == 0">{{
|
||||||
@@ -207,8 +209,8 @@ export default defineComponent({
|
|||||||
this.selectedCheckpoint = this.stationInfo.checkpoints[0].checkpointName;
|
this.selectedCheckpoint = this.stationInfo.checkpoints[0].checkpointName;
|
||||||
},
|
},
|
||||||
|
|
||||||
selectCheckpoint(item: { id: number | string; value: string }) {
|
selectCheckpoint(cp: { checkpointName: string }) {
|
||||||
this.selectedCheckpoint = item.value;
|
this.selectedCheckpoint = cp.checkpointName;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -408,8 +410,21 @@ h3 {
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
& > div {
|
flex-wrap: wrap;
|
||||||
border: 1px solid white;
|
|
||||||
|
font-size: 1.2em;
|
||||||
|
|
||||||
|
> .checkpoint_item {
|
||||||
|
&.current {
|
||||||
|
font-weight: bold;
|
||||||
|
color: $accentCol;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:not(:last-child)::after {
|
||||||
|
margin: 0 0.5em;
|
||||||
|
content: "•";
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -334,7 +334,6 @@ export const store = createStore<State>({
|
|||||||
statusTimeString: "",
|
statusTimeString: "",
|
||||||
stationTrains: [],
|
stationTrains: [],
|
||||||
scheduledTrains: [],
|
scheduledTrains: [],
|
||||||
checkpoints: null
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return acc;
|
return acc;
|
||||||
|
|||||||
@@ -198,4 +198,21 @@ ul {
|
|||||||
&--grayed {
|
&--grayed {
|
||||||
color: #ccc;
|
color: #ccc;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
&--text {
|
||||||
|
background: none;
|
||||||
|
color: white;
|
||||||
|
font-size: 1em;
|
||||||
|
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
transition: color 0.3s;
|
||||||
|
|
||||||
|
|
||||||
|
&:hover, &:focus {
|
||||||
|
color: $accentCol;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user