|
@@ -173,23 +173,26 @@ const summaryMethod: SummaryMethod<CommonData> = ({ columns, data }) => {
|
|
|
)
|
|
|
if (countColumn) {
|
|
|
if (countColumn.countMode === 'split') {
|
|
|
- let sumArr = data.reduce((prev: number[], curr: CommonData) => {
|
|
|
- const cellData = curr[column.property]
|
|
|
- if (typeof cellData === 'string') {
|
|
|
- const splitData = cellData.split('/')
|
|
|
- splitData.forEach((str, i) => {
|
|
|
- const num = Number(str)
|
|
|
- if (!Number.isNaN(num)) {
|
|
|
- if (prev[i]) {
|
|
|
- prev[i] += num
|
|
|
- } else {
|
|
|
- prev[i] = num
|
|
|
+ let sumArr = data.reduce(
|
|
|
+ (prev: number[], curr: CommonData) => {
|
|
|
+ const cellData = curr[column.property]
|
|
|
+ if (typeof cellData === 'string') {
|
|
|
+ const splitData = cellData.split('/')
|
|
|
+ splitData.forEach((str, i) => {
|
|
|
+ const num = Number(str)
|
|
|
+ if (!Number.isNaN(num)) {
|
|
|
+ if (prev[i]) {
|
|
|
+ prev[i] += num
|
|
|
+ } else {
|
|
|
+ prev[i] = num
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- return prev
|
|
|
- }, [0])
|
|
|
+ })
|
|
|
+ }
|
|
|
+ return prev
|
|
|
+ },
|
|
|
+ [0]
|
|
|
+ )
|
|
|
const matched = column.label.match(/(?<=\()\S+(?=\))/)
|
|
|
if (matched && !countFlag.value) {
|
|
|
const machedStr = matched[0]
|
|
@@ -319,7 +322,8 @@ const defaultDepartureSortFunction = (a: CommonData, b: CommonData) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- return isInternational ? enterCompare(a, b) : receiveCompare(a, b)
|
|
|
+ // return isInternational ? enterCompare(a, b) : receiveCompare(a, b)
|
|
|
+ return takeOffCompare(a, b)
|
|
|
}
|
|
|
|
|
|
const defaultArrivalSortFunction = (a: CommonData, b: CommonData) => {
|
|
@@ -377,9 +381,12 @@ const defaultArrivalSortFunction = (a: CommonData, b: CommonData) => {
|
|
|
const filterSortOptions = computed(() => ({
|
|
|
defaultFilterValueMap,
|
|
|
extraFilterValueMap: flightStateFilter,
|
|
|
- defaultSortFunction: isDeparture
|
|
|
- ? defaultDepartureSortFunction
|
|
|
- : defaultArrivalSortFunction,
|
|
|
+ defaultSortFunction: isDeparture ? defaultDepartureSortFunction : undefined,
|
|
|
+ defaultSortRuleMap: isDeparture
|
|
|
+ ? undefined
|
|
|
+ : {
|
|
|
+ planLandingTime: 'ascending',
|
|
|
+ },
|
|
|
}))
|
|
|
|
|
|
const sortRuleMap = ref({})
|