|
@@ -1,6 +1,5 @@
|
|
import { CSSProperties } from 'vue'
|
|
import { CSSProperties } from 'vue'
|
|
-import { CommonData, CommonValue, MaybeRef } from '~/common'
|
|
|
|
-import { Query } from '@/api/webApi'
|
|
|
|
|
|
+import { CommonData, MaybeRef } from '~/common'
|
|
|
|
|
|
interface TrackNode {
|
|
interface TrackNode {
|
|
name: string
|
|
name: string
|
|
@@ -105,7 +104,7 @@ export default function useTrackData(
|
|
const trackAirlines = ref<TrackAirline[]>([])
|
|
const trackAirlines = ref<TrackAirline[]>([])
|
|
|
|
|
|
const getTrackAirlines = () => {
|
|
const getTrackAirlines = () => {
|
|
- trackAirlines.value = unref(trackData).reduce(
|
|
|
|
|
|
+ const airlines = unref(trackData).reduce(
|
|
(
|
|
(
|
|
airlines,
|
|
airlines,
|
|
{
|
|
{
|
|
@@ -216,6 +215,15 @@ export default function useTrackData(
|
|
},
|
|
},
|
|
[] as TrackAirline[]
|
|
[] as TrackAirline[]
|
|
)
|
|
)
|
|
|
|
+ trackAirlines.value = airlines.map(airline => {
|
|
|
|
+ return {
|
|
|
|
+ ...airline,
|
|
|
|
+ airports:
|
|
|
|
+ name.includes('Departure') === airline.airports[0].isDeparture
|
|
|
|
+ ? airline.airports
|
|
|
|
+ : airline.airports.reverse(),
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
|
|
|
|
watch(trackData, () => {
|
|
watch(trackData, () => {
|