|
@@ -247,17 +247,19 @@ export default {
|
|
|
if (status == 'fulfilled') {
|
|
|
const { returnData } = value
|
|
|
const newArray = [...returnData]
|
|
|
- const itemObj = newArray[0]
|
|
|
- const newObj = {}
|
|
|
- const { actualTakeOffTime, estimateTakeOffTime, scheduleTakeOffTime, actualLandInTime, estimateLandInTime, scheduleLandInTime } = itemObj
|
|
|
- newObj.newTakeoff_time = actualTakeOffTime ? actualTakeOffTime : estimateTakeOffTime ? estimateTakeOffTime : scheduleTakeOffTime
|
|
|
- newObj.newLand_time = actualLandInTime ? actualLandInTime : estimateLandInTime ? estimateLandInTime : scheduleLandInTime
|
|
|
- newObj.takeTime = newObj.newTakeoff_time ? newObj.newTakeoff_time.split('T').at(-1) : newObj.newTakeoff_time
|
|
|
- newObj.landTime = newObj.newLand_time ? newObj.newLand_time.split('T').at(-1) : newObj.newLand_time
|
|
|
- newArr[index] = Object.assign(newArr[index], newObj)
|
|
|
+ if (newArray && newArray.length) {
|
|
|
+ const itemObj = newArray[0]
|
|
|
+ const newObj = {}
|
|
|
+ const { actualTakeOffTime, estimateTakeOffTime, scheduleTakeOffTime, actualLandInTime, estimateLandInTime, scheduleLandInTime } = itemObj
|
|
|
+ newObj.newTakeoff_time = actualTakeOffTime ? actualTakeOffTime : estimateTakeOffTime ? estimateTakeOffTime : scheduleTakeOffTime
|
|
|
+ newObj.newLand_time = actualLandInTime ? actualLandInTime : estimateLandInTime ? estimateLandInTime : scheduleLandInTime
|
|
|
+ newObj.takeTime = newObj.newTakeoff_time ? newObj.newTakeoff_time.split('T').at(-1) : newObj.newTakeoff_time
|
|
|
+ newObj.landTime = newObj.newLand_time ? newObj.newLand_time.split('T').at(-1) : newObj.newLand_time
|
|
|
+ newArr[index] = Object.assign(newArr[index], newObj)
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
- this.tableData = [...newArr]
|
|
|
+ this.tableData = _.orderBy([...newArr], ["takeTime"], ["asc", "desc"]);
|
|
|
}
|
|
|
}
|
|
|
}
|