mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
fix(journal): timetable entries minor fixes
This commit is contained in:
@@ -138,7 +138,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, ref } from 'vue';
|
import { computed, PropType, ref } from 'vue';
|
||||||
import { RouteLocationRaw } from 'vue-router';
|
import { RouteLocationRaw } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
||||||
@@ -156,8 +156,8 @@ const props = defineProps({
|
|||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
|
|
||||||
timetableId: {
|
timetableEntry: {
|
||||||
type: Number,
|
type: Object as PropType<API.TimetableHistory.DataShort>,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -188,12 +188,12 @@ const stockHistory = computed(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const driverRouteLocation = computed<RouteLocationRaw | null>(() => {
|
const driverRouteLocation = computed<RouteLocationRaw | null>(() => {
|
||||||
if (!timetableDetails.value || timetableDetails.value.terminated) return null;
|
if (props.timetableEntry.terminated) return null;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: 'DriverView',
|
name: 'DriverView',
|
||||||
query: {
|
query: {
|
||||||
trainId: `${timetableDetails.value.driverId}|${timetableDetails.value.trainNo}|eu`
|
trainId: `${props.timetableEntry.driverId}|${props.timetableEntry.trainNo}|eu`
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@@ -204,7 +204,7 @@ async function fetchTimetableDetails() {
|
|||||||
'api/getTimetables',
|
'api/getTimetables',
|
||||||
{
|
{
|
||||||
params: {
|
params: {
|
||||||
timetableId: props.timetableId,
|
timetableId: props.timetableEntry.id,
|
||||||
returnType: 'detailed'
|
returnType: 'detailed'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<!-- Extra -->
|
<!-- Extra -->
|
||||||
<EntryDetails
|
<EntryDetails
|
||||||
:timetable-id="timetableEntry.id"
|
:timetableEntry="timetableEntry"
|
||||||
:show-extra-info="showExtraInfo"
|
:show-extra-info="showExtraInfo"
|
||||||
@toggle-extra-info="toggleExtraInfo"
|
@toggle-extra-info="toggleExtraInfo"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -151,8 +151,6 @@ export default defineComponent({
|
|||||||
|
|
||||||
chosenPlayerId: -1,
|
chosenPlayerId: -1,
|
||||||
|
|
||||||
currentOptionsActive: false,
|
|
||||||
|
|
||||||
timetableHistory: [] as API.TimetableHistory.ResponseShort,
|
timetableHistory: [] as API.TimetableHistory.ResponseShort,
|
||||||
|
|
||||||
dataStatus: Status.Data.Loading
|
dataStatus: Status.Data.Loading
|
||||||
@@ -202,17 +200,11 @@ export default defineComponent({
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
computed: {
|
||||||
currentQueryParams(q: API.TimetableHistory.QueryParams) {
|
currentOptionsActive() {
|
||||||
console.log(q);
|
return Object.keys(this.currentQueryParams)
|
||||||
this.currentOptionsActive = Object.values(q).some((v) => v !== undefined);
|
.filter((k) => k != 'countFrom' && k != 'returnType')
|
||||||
},
|
.some((k) => (this.currentQueryParams as any)[k] !== undefined);
|
||||||
|
|
||||||
'$route.query': {
|
|
||||||
deep: true,
|
|
||||||
handler() {
|
|
||||||
this.extraInfoIndexes.length = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -303,6 +295,8 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
async fetchHistoryData() {
|
async fetchHistoryData() {
|
||||||
|
this.extraInfoIndexes.length = 0;
|
||||||
|
|
||||||
const driverName = this.searchersValues['search-driver'].trim() || undefined;
|
const driverName = this.searchersValues['search-driver'].trim() || undefined;
|
||||||
const trainNo = this.searchersValues['search-train'].trim() || undefined;
|
const trainNo = this.searchersValues['search-train'].trim() || undefined;
|
||||||
const authorName = this.searchersValues['search-dispatcher'].trim() || undefined;
|
const authorName = this.searchersValues['search-dispatcher'].trim() || undefined;
|
||||||
|
|||||||
Reference in New Issue
Block a user