|
@@ -3,15 +3,29 @@
|
|
|
<div class="airport-header">
|
|
|
<AirportForm :name="name" @form-data-change="formDataChangeHandler" />
|
|
|
<div class="airport-count">
|
|
|
- <CountBox
|
|
|
+ <!-- <CountBox
|
|
|
:count-number="tableDataCount.waybillCount"
|
|
|
:label="isDeparture ? '预计装载总运单数' : '预计卸载总运单数'"
|
|
|
/>
|
|
|
<CountBox
|
|
|
- v-show="countFlag"
|
|
|
- :count-number="tableDataCount.goodsCount"
|
|
|
- :label="isDeparture ? '预计装载总件数' : '预计卸载总件数'"
|
|
|
+ v-show="countFlag"
|
|
|
+ :count-number="tableDataCount.goodsCount"
|
|
|
+ :label="isDeparture ? '预计装载总件数' : '预计卸载总件数'"
|
|
|
+ /> -->
|
|
|
+ <CountBox
|
|
|
+ :count-number="tableDataCount.flightCount"
|
|
|
+ label="今日计划航班数"
|
|
|
+ />
|
|
|
+ <CountBox
|
|
|
+ :count-number="
|
|
|
+ isDeparture ? finishedCount : tableDataCount.tallyCount
|
|
|
+ "
|
|
|
+ label="已完成航班数"
|
|
|
/>
|
|
|
+ <!-- <CountBox
|
|
|
+ :count-number="tableDataCount.weightCount"
|
|
|
+ label="已转载重量"
|
|
|
+ /> -->
|
|
|
</div>
|
|
|
<div class="airport-settings">
|
|
|
<div v-permission="getPermission('count')">
|
|
@@ -51,9 +65,9 @@
|
|
|
>
|
|
|
<template #footer>
|
|
|
<div class="table-footer">
|
|
|
- <span class="table-footer-count"
|
|
|
+ <!-- <span class="table-footer-count"
|
|
|
>今日航班总数:{{ tableDataCount.flightCount }}</span
|
|
|
- >
|
|
|
+ > -->
|
|
|
<span class="table-footer-count"
|
|
|
>货运航班总数:{{ tableDataCount.freightFlightCount }}</span
|
|
|
>
|
|
@@ -211,6 +225,8 @@ const rowClass: RowClassGetter = params => {
|
|
|
) {
|
|
|
classes.push('underline-red')
|
|
|
}
|
|
|
+ } else if (rowData.loadPlaneSureTime) {
|
|
|
+ classes.push('bg-light')
|
|
|
}
|
|
|
if (selectedRowKey.value && rowData.rowKey === selectedRowKey.value) {
|
|
|
classes.push('is-selected')
|
|
@@ -231,11 +247,11 @@ const rowEventHandlers: RowEventHandlers = {
|
|
|
const tableDataCount = computed(() =>
|
|
|
tableData.value.reduce(
|
|
|
(counts: { [x: string]: number }, current) => {
|
|
|
- const preCount = current[isDeparture ? 'preLoad' : 'preUnload']
|
|
|
- if (preCount) {
|
|
|
- counts.waybillCount += Number(String(preCount).split('/')[0])
|
|
|
- counts.goodsCount += Number(String(preCount).split('/')[1])
|
|
|
- }
|
|
|
+ // const preCount = current[isDeparture ? 'preLoad' : 'preUnload']
|
|
|
+ // if (preCount) {
|
|
|
+ // counts.waybillCount += Number(String(preCount).split('/')[0])
|
|
|
+ // counts.goodsCount += Number(String(preCount).split('/')[1])
|
|
|
+ // }
|
|
|
if (typeof current['allNumber'] === 'number') {
|
|
|
counts.flightCount = current['allNumber']
|
|
|
}
|
|
@@ -254,16 +270,21 @@ const tableDataCount = computed(() =>
|
|
|
if (current['unLoadTime']) {
|
|
|
counts.unloadCount++
|
|
|
}
|
|
|
+ if (current['tallyTime_in']) {
|
|
|
+ counts.tallyCount++
|
|
|
+ }
|
|
|
return counts
|
|
|
},
|
|
|
{
|
|
|
- waybillCount: 0,
|
|
|
- goodsCount: 0,
|
|
|
+ // waybillCount: 0,
|
|
|
+ // goodsCount: 0,
|
|
|
flightCount: 0,
|
|
|
depotFlightCount: 0,
|
|
|
freightFlightCount: 0,
|
|
|
loadCount: 0,
|
|
|
unloadCount: 0,
|
|
|
+ tallyCount: 0,
|
|
|
+ weightCount: 0,
|
|
|
}
|
|
|
)
|
|
|
)
|
|
@@ -292,6 +313,56 @@ const flightStateFilter = computed<{} | { [x: string]: string[] }>(() => {
|
|
|
return {}
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
+/* 离港视图默认的排序方式:
|
|
|
+ * 1.已起飞排在前
|
|
|
+ * 2.未起飞中已装机在前
|
|
|
+ * 3.已起飞和未起飞分类中各自按照预计起飞时间排序
|
|
|
+ */
|
|
|
+const defaultSortFunction = (a: CommonData, b: CommonData) => {
|
|
|
+ const departureTimeCompare = (a: CommonData, b: CommonData) => {
|
|
|
+ if (a.planDepartureTime) {
|
|
|
+ if (b.planDepartureTime) {
|
|
|
+ if (a.planDepartureTime > b.planDepartureTime) {
|
|
|
+ return 1
|
|
|
+ } else if (a.planDepartureTime < b.planDepartureTime) {
|
|
|
+ return -1
|
|
|
+ } else {
|
|
|
+ return 0
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return -1
|
|
|
+ }
|
|
|
+ } else if (b.planDepartureTime) {
|
|
|
+ return 1
|
|
|
+ } else {
|
|
|
+ return 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (a.hasTakenOff) {
|
|
|
+ if (b.hasTakenOff) {
|
|
|
+ return departureTimeCompare(a, b)
|
|
|
+ } else {
|
|
|
+ return -1
|
|
|
+ }
|
|
|
+ } else if (b.hasTakenOff) {
|
|
|
+ return 1
|
|
|
+ } else {
|
|
|
+ if (a.loadPlaneSureTime) {
|
|
|
+ if (b.loadPlaneSureTime) {
|
|
|
+ return departureTimeCompare(a, b)
|
|
|
+ } else {
|
|
|
+ return -1
|
|
|
+ }
|
|
|
+ } else if (b.loadPlaneSureTime) {
|
|
|
+ return 1
|
|
|
+ } else {
|
|
|
+ return departureTimeCompare(a, b)
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
const {
|
|
|
filterOptionMap,
|
|
|
filterValueMap,
|
|
@@ -301,11 +372,12 @@ const {
|
|
|
} = useTableFilterAndSort(tableColumns, tableData, {
|
|
|
defaultFilterValueMap,
|
|
|
extraFilterValueMap: flightStateFilter,
|
|
|
- defaultSortRuleMap: {
|
|
|
- [props.name.includes('Departure')
|
|
|
- ? 'planDepartureTime'
|
|
|
- : 'planLandingTime']: 'ascending',
|
|
|
- },
|
|
|
+ defaultSortRuleMap: isDeparture
|
|
|
+ ? undefined
|
|
|
+ : {
|
|
|
+ planLandingTime: 'ascending',
|
|
|
+ },
|
|
|
+ defaultSortFunction: isDeparture ? defaultSortFunction : undefined,
|
|
|
})
|
|
|
const columnsShouldCache = ['IATACode']
|
|
|
watch(filterValueMap, map => {
|