|
@@ -5,19 +5,25 @@ import { CommonData, MaybeRef } from '~/common'
|
|
interface TrackNode {
|
|
interface TrackNode {
|
|
name: string
|
|
name: string
|
|
nodeCode: string
|
|
nodeCode: string
|
|
- flag: boolean
|
|
|
|
|
|
+ active: boolean
|
|
labelWidth?: number
|
|
labelWidth?: number
|
|
descriptions: string[]
|
|
descriptions: string[]
|
|
|
|
+ sync?: boolean
|
|
}
|
|
}
|
|
-interface TrackAirport {
|
|
|
|
|
|
+interface CombinedTrackNode {
|
|
|
|
+ active: boolean
|
|
|
|
+ labelWidth?: number
|
|
|
|
+ children: [TrackNode, TrackNode]
|
|
|
|
+}
|
|
|
|
+interface TrackAirport<T = TrackNode> {
|
|
airport: string
|
|
airport: string
|
|
isDeparture: boolean
|
|
isDeparture: boolean
|
|
- trackSteps: TrackNode[]
|
|
|
|
|
|
+ trackSteps: T[]
|
|
}
|
|
}
|
|
-interface TrackAirline {
|
|
|
|
|
|
+interface TrackAirline<T = TrackNode> {
|
|
flightNO: string
|
|
flightNO: string
|
|
flightDate: string
|
|
flightDate: string
|
|
- airports: TrackAirport[]
|
|
|
|
|
|
+ airports: TrackAirport<T>[]
|
|
}
|
|
}
|
|
|
|
|
|
const trackNodesMap = {
|
|
const trackNodesMap = {
|
|
@@ -32,12 +38,13 @@ const trackNodesMap = {
|
|
// },
|
|
// },
|
|
{
|
|
{
|
|
name: '安检',
|
|
name: '安检',
|
|
- nodeCode: 'SECURITY_CHECK',
|
|
|
|
|
|
+ nodeCode: '安检',
|
|
// nodeCode: 'SECURITY', // 临时-复制加货
|
|
// nodeCode: 'SECURITY', // 临时-复制加货
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '加货',
|
|
name: '加货',
|
|
nodeCode: 'ACC_BUP',
|
|
nodeCode: 'ACC_BUP',
|
|
|
|
+ sync: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '预配载',
|
|
name: '预配载',
|
|
@@ -104,7 +111,7 @@ const trackNodesMap = {
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '出库',
|
|
name: '出库',
|
|
- nodeCode: 'FSU_DLV',
|
|
|
|
|
|
+ nodeCode: 'FSUDLV',
|
|
},
|
|
},
|
|
],
|
|
],
|
|
internationalDeparture: [
|
|
internationalDeparture: [
|
|
@@ -114,7 +121,7 @@ const trackNodesMap = {
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '海关',
|
|
name: '海关',
|
|
- nodeCode: 'MTREL',
|
|
|
|
|
|
+ nodeCode: 'MTREL_out',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '运抵',
|
|
name: '运抵',
|
|
@@ -130,7 +137,11 @@ const trackNodesMap = {
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '理货',
|
|
name: '理货',
|
|
- nodeCode: 'CARTON_LIST',
|
|
|
|
|
|
+ nodeCode: 'ACC_BUP',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: '实配',
|
|
|
|
+ nodeCode: 'LS_CARGO',
|
|
},
|
|
},
|
|
// {
|
|
// {
|
|
// name: '待运区',
|
|
// name: '待运区',
|
|
@@ -157,10 +168,6 @@ const trackNodesMap = {
|
|
nodeCode: 'CARGOS_OFFLOAD',
|
|
nodeCode: 'CARGOS_OFFLOAD',
|
|
},
|
|
},
|
|
// {
|
|
// {
|
|
- // name: '实配',
|
|
|
|
- // nodeCode: 'LS_CARGO',
|
|
|
|
- // },
|
|
|
|
- // {
|
|
|
|
// name: '退运',
|
|
// name: '退运',
|
|
// nodeCode: '',
|
|
// nodeCode: '',
|
|
// },
|
|
// },
|
|
@@ -180,7 +187,7 @@ const trackNodesMap = {
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '理货',
|
|
name: '理货',
|
|
- nodeCode: 'RCF',
|
|
|
|
|
|
+ nodeCode: 'RCF报',
|
|
},
|
|
},
|
|
// {
|
|
// {
|
|
// name: '快件运抵',
|
|
// name: '快件运抵',
|
|
@@ -188,11 +195,11 @@ const trackNodesMap = {
|
|
// },
|
|
// },
|
|
{
|
|
{
|
|
name: '海关放行',
|
|
name: '海关放行',
|
|
- nodeCode: 'MTREL',
|
|
|
|
|
|
+ nodeCode: 'MTREL_in',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '出库',
|
|
name: '出库',
|
|
- nodeCode: 'DLV',
|
|
|
|
|
|
+ nodeCode: 'DLV报',
|
|
},
|
|
},
|
|
],
|
|
],
|
|
internationalDepartureTransfer: [
|
|
internationalDepartureTransfer: [
|
|
@@ -202,7 +209,7 @@ const trackNodesMap = {
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '海关',
|
|
name: '海关',
|
|
- nodeCode: 'MTREL',
|
|
|
|
|
|
+ nodeCode: 'MTREL_out',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '运抵',
|
|
name: '运抵',
|
|
@@ -218,7 +225,7 @@ const trackNodesMap = {
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '理货',
|
|
name: '理货',
|
|
- nodeCode: 'CARTON_LIST',
|
|
|
|
|
|
+ nodeCode: 'ACC_BUP',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '实配',
|
|
name: '实配',
|
|
@@ -248,7 +255,7 @@ export function useTrackData(name: string, trackData: MaybeRef<CommonData[]>) {
|
|
return unref(trackData)
|
|
return unref(trackData)
|
|
})
|
|
})
|
|
|
|
|
|
- const trackAirlines = ref<TrackAirline[]>([])
|
|
|
|
|
|
+ const trackAirlines = ref<TrackAirline<TrackNode | CombinedTrackNode>[]>([])
|
|
const getTrackAirlines = () => {
|
|
const getTrackAirlines = () => {
|
|
const airlines = unref(computedTrackData).reduce(
|
|
const airlines = unref(computedTrackData).reduce(
|
|
(
|
|
(
|
|
@@ -283,15 +290,14 @@ export function useTrackData(name: string, trackData: MaybeRef<CommonData[]>) {
|
|
? String(departureAirport ?? '')
|
|
? String(departureAirport ?? '')
|
|
: String(arriveAirport ?? '')
|
|
: String(arriveAirport ?? '')
|
|
const trackNode = {
|
|
const trackNode = {
|
|
- flag: Boolean(
|
|
|
|
- execPosition ||
|
|
|
|
- ConsignmentItemPackagingQuantityQuantity ||
|
|
|
|
- execResult ||
|
|
|
|
- execTime
|
|
|
|
|
|
+ active: Boolean(
|
|
|
|
+ // execPosition ||
|
|
|
|
+ // ConsignmentItemPackagingQuantityQuantity ||
|
|
|
|
+ execResult || execTime
|
|
),
|
|
),
|
|
descriptions: [
|
|
descriptions: [
|
|
- String(execPosition ?? ''),
|
|
|
|
- String(ConsignmentItemPackagingQuantityQuantity ?? ''),
|
|
|
|
|
|
+ // String(execPosition ?? ''),
|
|
|
|
+ // String(ConsignmentItemPackagingQuantityQuantity ?? ''),
|
|
execResult ? '通过' : '未通过',
|
|
execResult ? '通过' : '未通过',
|
|
datetimeToTime(execTime, flightDate),
|
|
datetimeToTime(execTime, flightDate),
|
|
],
|
|
],
|
|
@@ -315,8 +321,8 @@ export function useTrackData(name: string, trackData: MaybeRef<CommonData[]>) {
|
|
} else {
|
|
} else {
|
|
return {
|
|
return {
|
|
...node,
|
|
...node,
|
|
- flag: false,
|
|
|
|
- descriptions: [],
|
|
|
|
|
|
+ active: false,
|
|
|
|
+ descriptions: ['', ''],
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -366,19 +372,41 @@ export function useTrackData(name: string, trackData: MaybeRef<CommonData[]>) {
|
|
trackAirlines.value = airlines.map((airline) => {
|
|
trackAirlines.value = airlines.map((airline) => {
|
|
const dealedAirports = airline.airports.map((airport, index) => ({
|
|
const dealedAirports = airline.airports.map((airport, index) => ({
|
|
...airport,
|
|
...airport,
|
|
- trackSteps: airport.trackSteps.filter(
|
|
|
|
- (node, i, steps) =>
|
|
|
|
- node.flag ||
|
|
|
|
|
|
+ trackSteps: airport.trackSteps.reduce((prevSteps, node, i, steps) => {
|
|
|
|
+ if (
|
|
|
|
+ node.active ||
|
|
(index > 0
|
|
(index > 0
|
|
? ['IMP_TALLY', 'FSUDLV'].includes(node.nodeCode) &&
|
|
? ['IMP_TALLY', 'FSUDLV'].includes(node.nodeCode) &&
|
|
steps.some(
|
|
steps.some(
|
|
(node) =>
|
|
(node) =>
|
|
- ['IMP_TALLY', 'FSUDLV'].includes(node.nodeCode) && node.flag
|
|
|
|
|
|
+ ['IMP_TALLY', 'FSUDLV'].includes(node.nodeCode) &&
|
|
|
|
+ node.active
|
|
)
|
|
)
|
|
: !['CARGOS_OFFLOAD', 'OFFLOAD_CONFIRM', 'BILL_RETURN'].includes(
|
|
: !['CARGOS_OFFLOAD', 'OFFLOAD_CONFIRM', 'BILL_RETURN'].includes(
|
|
node.nodeCode
|
|
node.nodeCode
|
|
))
|
|
))
|
|
- ),
|
|
|
|
|
|
+ ) {
|
|
|
|
+ if (node.sync && prevSteps.length > 0) {
|
|
|
|
+ const lastNode = prevSteps.pop() as TrackNode | CombinedTrackNode
|
|
|
|
+ if ('nodeCode' in lastNode) {
|
|
|
|
+ const active = node.active || lastNode.active
|
|
|
|
+ const labelWidth =
|
|
|
|
+ Math.max(node.labelWidth ?? 0, lastNode.labelWidth ?? 0) ||
|
|
|
|
+ undefined
|
|
|
|
+ prevSteps.push({
|
|
|
|
+ active,
|
|
|
|
+ labelWidth,
|
|
|
|
+ children: [lastNode, node],
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ prevSteps.push(lastNode, node)
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ prevSteps.push(node)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return prevSteps
|
|
|
|
+ }, [] as (TrackNode | CombinedTrackNode)[]),
|
|
}))
|
|
}))
|
|
const sortedAirports =
|
|
const sortedAirports =
|
|
name.includes('Departure') === airline.airports[0].isDeparture
|
|
name.includes('Departure') === airline.airports[0].isDeparture
|
|
@@ -396,7 +424,10 @@ export function useTrackData(name: string, trackData: MaybeRef<CommonData[]>) {
|
|
})
|
|
})
|
|
|
|
|
|
const trackBoxStyle = computed(
|
|
const trackBoxStyle = computed(
|
|
- () => (airports: TrackAirport[], index: number) => {
|
|
|
|
|
|
+ () => (
|
|
|
|
+ airports: TrackAirport<TrackNode | CombinedTrackNode>[],
|
|
|
|
+ index: number
|
|
|
|
+ ) => {
|
|
const style: CSSProperties = {}
|
|
const style: CSSProperties = {}
|
|
const totalLength = airports.reduce((pre, current) => {
|
|
const totalLength = airports.reduce((pre, current) => {
|
|
return pre + current.trackSteps.length - 1
|
|
return pre + current.trackSteps.length - 1
|