Quellcode durchsuchen

筛选后重新合并

zhongxiaoyu vor 2 Jahren
Ursprung
Commit
fbc6ed9272
1 geänderte Dateien mit 30 neuen und 20 gelöschten Zeilen
  1. 30 20
      src/views/advancedQuery/views/advancedHome.vue

+ 30 - 20
src/views/advancedQuery/views/advancedHome.vue

@@ -628,6 +628,33 @@ export default {
       })
     }
   },
+  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)
     // 参数顺序   【航班开始日期,航班结束日期,航班号,航班号,行李牌号,行李牌号,起飞站,起飞站,目的站,目的站,特殊行李类型,特殊 行李类型,旅客姓名大写拼音,旅客姓名大写拼音,PNR,PNR,值机号,值机号】
@@ -726,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', {
@@ -926,29 +956,9 @@ export default {
             }
           }
           const tableData = this._.sortBy(result, ['FlightDate', 'FlightNO', 'PassengerNameUpcase', 'BagWeight'])
-          this.spanArr = []
-          let contactDot = this.contactDot
           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) {
-              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
-              }
-            }
             return item
           })
           setTableFilters(this.tableData, this.tableDataFilters)