|
@@ -6,6 +6,7 @@
|
|
|
<div class="interfaceLog_head_time_start mr10">
|
|
|
<el-date-picker
|
|
|
v-model="FlightDate[0]"
|
|
|
+ class="input-shadow"
|
|
|
size="small"
|
|
|
type="date"
|
|
|
value-format="yyyy-MM-dd"
|
|
@@ -15,6 +16,7 @@
|
|
|
<div class="interfaceLog_head_time_end">
|
|
|
<el-date-picker
|
|
|
v-model="FlightDate[1]"
|
|
|
+ class="input-shadow"
|
|
|
size="small"
|
|
|
type="date"
|
|
|
value-format="yyyy-MM-dd"
|
|
@@ -55,7 +57,7 @@
|
|
|
ref="table"
|
|
|
max-height="100%"
|
|
|
class="table"
|
|
|
- :data="filteredTableData"
|
|
|
+ :data="dealedTableData"
|
|
|
border
|
|
|
stripe
|
|
|
fit
|
|
@@ -65,6 +67,7 @@
|
|
|
:cell-class-name="cellClass"
|
|
|
:summary-method="summaryRow(tableData.length)"
|
|
|
:span-method="objectSpanMethod"
|
|
|
+ :header-cell-class-name="headerCellClass"
|
|
|
@cell-click="cellClickHandler"
|
|
|
>
|
|
|
<el-table-column
|
|
@@ -73,7 +76,6 @@
|
|
|
:prop="col.prop"
|
|
|
:label="col.label"
|
|
|
:width="col.width"
|
|
|
- :sortable="col.sortable"
|
|
|
>
|
|
|
<template #header>
|
|
|
<div class="table-header-cell">
|
|
@@ -85,6 +87,15 @@
|
|
|
:filter-value.sync="filterValues[col.prop]"
|
|
|
/>
|
|
|
</template>
|
|
|
+ <template v-if="col.sortable">
|
|
|
+ <span
|
|
|
+ class="caret-wrapper"
|
|
|
+ @click="sortChange(col.prop)"
|
|
|
+ >
|
|
|
+ <i class="sort-caret ascending" />
|
|
|
+ <i class="sort-caret descending" />
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -387,7 +398,8 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
prop: 'PassengerNameUpcase',
|
|
|
- label: '旅客姓名'
|
|
|
+ label: '旅客姓名',
|
|
|
+ width: 150
|
|
|
},
|
|
|
{
|
|
|
prop: 'BagSN',
|
|
@@ -396,7 +408,8 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
prop: 'SpecialType',
|
|
|
- label: '特殊行李类型'
|
|
|
+ label: '特殊行李类型',
|
|
|
+ width: 115
|
|
|
},
|
|
|
{
|
|
|
prop: 'deleted',
|
|
@@ -611,14 +624,17 @@ export default {
|
|
|
PreFlightNONotNull: '',
|
|
|
PreFlightNONull: ''
|
|
|
},
|
|
|
+ tableDataSortRules: {
|
|
|
+ BagSN: ''
|
|
|
+ },
|
|
|
spanArr: [],
|
|
|
contactDot: 0
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters(['clickedCells', 'queryForm']),
|
|
|
- filteredTableData() {
|
|
|
- return this.tableData.filter(item => {
|
|
|
+ dealedTableData() {
|
|
|
+ const filtered = this.tableData.filter(item => {
|
|
|
let flag = true
|
|
|
Object.entries(this.filterValues).forEach(([key, value]) => {
|
|
|
if (value !== '' && item[key] !== value) {
|
|
@@ -627,10 +643,19 @@ export default {
|
|
|
})
|
|
|
return flag
|
|
|
})
|
|
|
+ const sortRules = Object.entries(this.tableDataSortRules).reduce((pre, [key, value]) => {
|
|
|
+ if (value) {
|
|
|
+ pre[0].push(key)
|
|
|
+ value = value === 'ascending' ? 'asc' : 'desc'
|
|
|
+ pre[1].push(value)
|
|
|
+ }
|
|
|
+ return pre
|
|
|
+ }, [[], []])
|
|
|
+ return this._.orderBy(filtered, sortRules[0], sortRules[1])
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
- filteredTableData: {
|
|
|
+ dealedTableData: {
|
|
|
handler(val) {
|
|
|
this.spanArr = []
|
|
|
let contactDot = this.contactDot
|
|
@@ -641,8 +666,7 @@ export default {
|
|
|
if (
|
|
|
item['FlightNO'] === arr[index - 1]['FlightNO'] &&
|
|
|
item['FlightDate'] === arr[index - 1]['FlightDate'] &&
|
|
|
- item['PassengerNameUpcase'] === arr[index - 1]['PassengerNameUpcase'] &&
|
|
|
- item['BagWeight'] === arr[index - 1]['BagWeight']
|
|
|
+ item['CheckInNO'] === arr[index - 1]['CheckInNO']
|
|
|
) {
|
|
|
this.spanArr[contactDot] += 1
|
|
|
this.spanArr.push(0)
|
|
@@ -733,6 +757,14 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ headerCellClass({ row, column, rowIndex, columnIndex }) {
|
|
|
+ const classes = []
|
|
|
+ const rule = this.tableDataSortRules[column.property]
|
|
|
+ if (rule) {
|
|
|
+ classes.push(rule)
|
|
|
+ }
|
|
|
+ return classes.join(' ')
|
|
|
+ },
|
|
|
cellClass({ row, column, rowIndex, columnIndex }) {
|
|
|
const classes = []
|
|
|
if (['FlightNO', 'TransferFlightNO', 'BagSN'].includes(column.property)) {
|
|
@@ -750,6 +782,10 @@ export default {
|
|
|
}
|
|
|
return classes.join(' ')
|
|
|
},
|
|
|
+ sortChange(prop) {
|
|
|
+ this.tableDataSortRules[prop] =
|
|
|
+ this.tableDataSortRules[prop] === '' ? 'ascending' : this.tableDataSortRules[prop] === 'ascending' ? 'descending' : ''
|
|
|
+ },
|
|
|
cellClickHandler(row, column, cell, event) {
|
|
|
if (['FlightNO', 'TransferFlightNO', 'BagSN'].includes(column.property)) {
|
|
|
this.$store.dispatch('keepAlive/addClickedCell', {
|
|
@@ -951,7 +987,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- const tableData = this._.sortBy(result, ['FlightDate', 'FlightNO', 'PassengerNameUpcase', 'BagWeight'])
|
|
|
+ const tableData = this._.sortBy(result, ['FlightDate', 'DepartureTime', 'PassengerNameUpcase', 'BagSN'])
|
|
|
this.tableData = tableData.map((item, index, arr) => {
|
|
|
item['deleted'] === 'DEL' || (item['deleted'] = '')
|
|
|
item['activated'] = item['activated'] === 'I' ? '未激活' : '激活'
|