|
|
|
@@ -19,7 +19,9 @@ const ITEMS_PER_PAGE = 25
|
|
|
|
|
|
|
|
|
|
const defaultColumns = ['airline', 'flight_number', 'departure_airport', 'arrival_airport', 'departure_date', 'departure_time', 'arrival_time', 'duration', 'distance', 'aircraft', 'registration', 'class_seat_combined', 'note']
|
|
|
|
|
const columnsToShow = computed(() => page.auth.user?.resolved_settings?.departure_board_columns ?? defaultColumns)
|
|
|
|
|
const showColumn = (column: string) => columnsToShow.value.includes(column)
|
|
|
|
|
const showColumn = (column: string) =>
|
|
|
|
|
columnsToShow.value.includes(column) ||
|
|
|
|
|
(column === 'aircraft_registration' && columnsToShow.value.includes('registration'))
|
|
|
|
|
|
|
|
|
|
const allHeaders = [
|
|
|
|
|
{ title: '', key: 'airline', sortable: true, resizable: false},
|
|
|
|
@@ -38,7 +40,7 @@ const allHeaders = [
|
|
|
|
|
{ title: 'MODEL', key: 'aircraft.model_full_name', sortable: true },
|
|
|
|
|
{ title: 'AIRCRAFT', key: 'aircraft.display_name_short', sortable: true },
|
|
|
|
|
{ title: 'AIRCRAFT', key: 'aircraft', sortable: true },
|
|
|
|
|
{ title: 'REG', key: 'registration', sortable: true },
|
|
|
|
|
{ title: 'REG', key: 'aircraft_registration', sortable: true },
|
|
|
|
|
{ title: 'CLASS', key: 'flight_class', sortable: true },
|
|
|
|
|
{ title: 'CLASS', key: 'class_seat_combined', sortable: true },
|
|
|
|
|
{ title: 'SEAT TYPE', key: 'seat_type_id', sortable: true },
|
|
|
|
@@ -70,7 +72,7 @@ const customKeySort = {
|
|
|
|
|
aircraft: (a: Flight['aircraft'], b: Flight['aircraft']) => (a?.designator ?? '').localeCompare(b?.designator ?? ''),
|
|
|
|
|
duration: (a: any, b: any) => (a ?? 0) - (b ?? 0),
|
|
|
|
|
departure_airport: (a: Flight['departure_airport'], b: Flight['departure_airport']) => (a?.display_code ?? '').localeCompare(b?.display_code ?? ''),
|
|
|
|
|
arrival_airport: (a: Flight['arrival_airport'], b: Flight['arrival_airport']) => (a?.display_code ?? '').localeCompare(b?.display_code ?? '')
|
|
|
|
|
arrival_airport: (a: Flight['arrival_airport'], b: Flight['arrival_airport']) => (a?.display_code ?? '').localeCompare(b?.display_code ?? ''),
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const sortBy = ref<DataTableSortItem[]>([])
|
|
|
|
|