|
@@ -54,7 +54,7 @@
|
|
|
ref="table"
|
|
|
max-height="100%"
|
|
|
class="table"
|
|
|
- :data="tableData"
|
|
|
+ :data="filteredTableData"
|
|
|
border
|
|
|
stripe
|
|
|
fit
|
|
@@ -615,7 +615,45 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapGetters(['clickedCells', 'queryForm'])
|
|
|
+ ...mapGetters(['clickedCells', 'queryForm']),
|
|
|
+ filteredTableData() {
|
|
|
+ return this.tableData.filter(item => {
|
|
|
+ let flag = true
|
|
|
+ Object.entries(this.filterValues).forEach(([key, value]) => {
|
|
|
+ if (value !== '' && item[key] !== value) {
|
|
|
+ flag = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return flag
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ filteredTableData: {
|
|
|
+ handler(val) {
|
|
|
+ this.spanArr = []
|
|
|
+ let contactDot = this.contactDot
|
|
|
+ val.forEach((item, index, arr) => {
|
|
|
+ if (index === 0) {
|
|
|
+ this.spanArr.push(1)
|
|
|
+ } else {
|
|
|
+ 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']
|
|
|
+ ) {
|
|
|
+ this.spanArr[contactDot] += 1
|
|
|
+ this.spanArr.push(0)
|
|
|
+ } else {
|
|
|
+ this.spanArr.push(1)
|
|
|
+ contactDot = index
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ deep: true
|
|
|
+ }
|
|
|
},
|
|
|
created() {
|
|
|
// console.log(this.$store.state.app.queryForm)
|
|
@@ -689,11 +727,7 @@ export default {
|
|
|
this.$refs['dialog'].focus()
|
|
|
},
|
|
|
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
|
|
- if (
|
|
|
- ['FlightDate', 'DepartureTime', 'SourceAirport', 'TargetAirport', 'PassengerNameUpcase', 'BagWeight'].includes(
|
|
|
- column.property
|
|
|
- )
|
|
|
- ) {
|
|
|
+ if (['PassengerNameUpcase', 'BagWeight'].includes(column.property)) {
|
|
|
const _row = this.spanArr[rowIndex]
|
|
|
const _col = _row > 0 ? 1 : 0
|
|
|
return {
|
|
@@ -719,6 +753,9 @@ export default {
|
|
|
}
|
|
|
return classString
|
|
|
},
|
|
|
+ sortChangeHandler({ column, prop, order }) {
|
|
|
+ console.log(column, prop, order)
|
|
|
+ },
|
|
|
cellClickHandler(row, column, cell, event) {
|
|
|
if (['FlightNO', 'TransferFlightNO', 'BagSN'].includes(column.property)) {
|
|
|
this.$store.dispatch('keepAlive/addClickedCell', {
|
|
@@ -918,24 +955,10 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- const tableData = this._.sortBy(result, ['FlightNO', 'FlightDate'])
|
|
|
- this.spanArr = []
|
|
|
- let contactDot = this.contactDot
|
|
|
+ const tableData = this._.sortBy(result, ['FlightDate', 'FlightNO', 'PassengerNameUpcase', 'BagWeight'])
|
|
|
this.tableData = tableData.map((item, index, arr) => {
|
|
|
- item.index = index
|
|
|
item['deleted'] === 'DEL' || (item['deleted'] = '')
|
|
|
item['activated'] = item['activated'] === 'I' ? '未激活' : '激活'
|
|
|
- if (index === 0) {
|
|
|
- this.spanArr.push(1)
|
|
|
- } else {
|
|
|
- if (item.FlightNO === arr[index - 1].FlightNO && item.FlightDate === arr[index - 1].FlightDate) {
|
|
|
- this.spanArr[contactDot] += 1
|
|
|
- this.spanArr.push(0)
|
|
|
- } else {
|
|
|
- this.spanArr.push(1)
|
|
|
- contactDot = index
|
|
|
- }
|
|
|
- }
|
|
|
return item
|
|
|
})
|
|
|
setTableFilters(this.tableData, this.tableDataFilters)
|