|
@@ -1,7 +1,7 @@
|
|
|
<!--
|
|
|
* @Author: zk
|
|
|
* @Date: 2022-01-17 10:39:22
|
|
|
- * @LastEditTime: 2022-06-10 09:15:33
|
|
|
+ * @LastEditTime: 2022-06-14 10:44:04
|
|
|
* @LastEditors: your name
|
|
|
* @Description: 进港01
|
|
|
-->
|
|
@@ -264,6 +264,7 @@ import tableColsMixin from '../../mixins/tableCols'
|
|
|
import { getQuery } from '@/api/flight'
|
|
|
import TableHeaderCell from '@/components/TableHeaderCell'
|
|
|
import { setTableFilters } from '@/utils/table'
|
|
|
+// import { parseTime } from '@/utils'
|
|
|
|
|
|
export default {
|
|
|
name: 'DepartureTerminalView',
|
|
@@ -431,14 +432,19 @@ export default {
|
|
|
]
|
|
|
}
|
|
|
],
|
|
|
+ tableDataSortRules: {
|
|
|
+ flightCanceled: 'ascending'
|
|
|
+ },
|
|
|
AirportList: [],
|
|
|
loopEvent: null,
|
|
|
- leaveCount: 0,
|
|
|
+ arrivalCount: 0,
|
|
|
baggageCount: 0
|
|
|
}
|
|
|
},
|
|
|
- mounted() {
|
|
|
+ created() {
|
|
|
this.getAirPortData()
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
const that = this
|
|
|
this.loopEvent = setInterval(function () {
|
|
|
that.getTableData()
|
|
@@ -446,6 +452,7 @@ export default {
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
clearInterval(this.loopEvent)
|
|
|
+ this.loopEvent = null
|
|
|
},
|
|
|
methods: {
|
|
|
airPortChange() {
|
|
@@ -470,8 +477,14 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
tableRowClassName({ row, rowIndex }) {
|
|
|
+ if (row.flightStatus === 'DLY') {
|
|
|
+ return 'bgl-delayed'
|
|
|
+ }
|
|
|
+ if (row.flightStatus === 'CAN') {
|
|
|
+ return 'bgl-canceled'
|
|
|
+ }
|
|
|
if (row.hasTakenOff === 0) {
|
|
|
- if (rowIndex === this.leaveCount - 1) {
|
|
|
+ if (rowIndex === this.arrivalCount - 1) {
|
|
|
return 'bgl-hui redBorder'
|
|
|
} else {
|
|
|
return 'bgl-hui'
|
|
@@ -521,15 +534,16 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
initTableData(tableData) {
|
|
|
- this.leaveCount = 0
|
|
|
+ this.arrivalCount = 0
|
|
|
this.baggageCount = 0
|
|
|
tableData.forEach(item => {
|
|
|
- if (item.hasTakenOff === 0) {
|
|
|
- this.leaveCount++
|
|
|
- }
|
|
|
+ // if (this.hasArrived(item)) {
|
|
|
+ // this.arrivalCount++
|
|
|
+ // }
|
|
|
+ item['flightCanceled'] = item['flightStatus'] === 'CAN' ? 1 : 0
|
|
|
this.baggageCount = this.baggageCount + item.projectedLoad
|
|
|
})
|
|
|
- this.tableData = this._.sortBy(tableData, ['FlightDate', 'arrivalTime'])
|
|
|
+ this.tableData = this._.sortBy(tableData, ['hasArrived', 'arrivalTime'])
|
|
|
setTableFilters(this.tableData, this.tableDataFilters)
|
|
|
this.toOrderNum(this.baggageCount)
|
|
|
// setInterval(() => {
|
|
@@ -537,6 +551,12 @@ export default {
|
|
|
// // 这里输入数字即可调用
|
|
|
// }, 2000);
|
|
|
},
|
|
|
+ hasArrived(flight) {
|
|
|
+ const now = new Date()
|
|
|
+ const arrivalTime = new Date(flight.arrivalTime)
|
|
|
+ flight['hasArrived'] = now > arrivalTime
|
|
|
+ return flight['hasArrived']
|
|
|
+ },
|
|
|
setNumberTransform() {
|
|
|
const numberItems = this.$refs.numberItem // 拿到数字的ref,计算元素数量
|
|
|
const numberArr = this.orderNum.filter(item => !isNaN(item))
|
|
@@ -734,6 +754,12 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ tr.bgl-delayed td {
|
|
|
+ background: #fcf0b1;
|
|
|
+ }
|
|
|
+ tr.bgl-canceled td {
|
|
|
+ background: #f7babe;
|
|
|
+ }
|
|
|
}
|
|
|
.el-table__cell.is-hidden > * {
|
|
|
visibility: visible;
|