|
@@ -1,7 +1,7 @@
|
|
|
<!--
|
|
|
* @Author: zk
|
|
|
* @Date: 2022-01-17 10:39:22
|
|
|
- * @LastEditTime: 2022-06-15 14:00:35
|
|
|
+ * @LastEditTime: 2022-06-15 17:59:29
|
|
|
* @LastEditors: your name
|
|
|
* @Description: 离港01
|
|
|
-->
|
|
@@ -505,11 +505,11 @@ export default {
|
|
|
this.leaveCount = 0
|
|
|
this.baggageCount = 0
|
|
|
tableData.forEach(item => {
|
|
|
- if (item.hasTakenOff === 0) {
|
|
|
+ item['flightCanceled'] = item['flightStatus'] === 'CAN' ? 1 : 0
|
|
|
+ if (item['hasTakenOff'] === 0 && !item['flightCanceled']) {
|
|
|
this.leaveCount++
|
|
|
}
|
|
|
item['landingNumber'] = item['loadNumber']
|
|
|
- item['flightCanceled'] = item['flightStatus'] === 'CAN' ? 1 : 0
|
|
|
this.baggageCount = this.baggageCount + item.preLoad
|
|
|
})
|
|
|
this.tableData = this._.sortBy(tableData, ['hasTakenOff', 'PlanDepartureTime'])
|
|
@@ -532,15 +532,19 @@ export default {
|
|
|
if (scrollParent.scrollHeight <= scrollParent.offsetHeight) {
|
|
|
return
|
|
|
}
|
|
|
- let lastRow
|
|
|
- if (this.leaveCount === this.tableData.length) {
|
|
|
- lastRow = table.querySelectorAll('.el-table__body tr')[this.leaveCount - 1]
|
|
|
- } else {
|
|
|
- lastRow = table.querySelectorAll('.el-table__body tr')[this.leaveCount]
|
|
|
- }
|
|
|
+ const lastRow = table.querySelectorAll('.el-table__body tr')[this.leaveCount]
|
|
|
+ // if (this.leaveCount === this.tableData.length) {
|
|
|
+ // lastRow = table.querySelectorAll('.el-table__body tr')[this.leaveCount - 1]
|
|
|
+ // } else {
|
|
|
+ // lastRow = table.querySelectorAll('.el-table__body tr')[this.leaveCount]
|
|
|
+ // }
|
|
|
setTimeout(() => {
|
|
|
- const scrollTop = lastRow.offsetTop + lastRow.offsetHeight - scrollParent.offsetHeight
|
|
|
- scrollParent.scrollTo(0, scrollTop)
|
|
|
+ const scrollMid = lastRow.offsetTop + (lastRow.offsetHeight - scrollParent.offsetHeight) / 2
|
|
|
+ const scrollMax = scrollParent.scrollHeight - scrollParent.offsetHeight
|
|
|
+ if (scrollMid > 0) {
|
|
|
+ const scrollHeight = Math.min(scrollMid, scrollMax)
|
|
|
+ scrollParent.scrollTo(0, scrollHeight)
|
|
|
+ }
|
|
|
}, 0)
|
|
|
this.hasSetTableScroll = true
|
|
|
},
|