zhaoke 1 year ago
parent
commit
a3af50f748

+ 13 - 2
src/views/baggageManagementTemp/components/arrival/index.vue

@@ -97,7 +97,7 @@
     </div>
     <!--表格-->
     <div v-loading="loading" class="terminal-table" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)">
-      <el-table ref="table" class="table" :height="computedTableHeight" :data="dealedTableData" :header-cell-class-name="headerCellClass" :row-class-name="tableRowClassName" :cell-class-name="cellClass" show-summary :summary-method="summaryMethod" border stripe fit @cell-click="cellClickHandler">
+      <el-table ref="table" class="table" :height="computedTableHeight" :data="dealedTableData" :header-cell-class-name="headerCellClass" :row-class-name="tableRowClassName" :span-method="objectSpanMethod" :cell-class-name="cellClass" show-summary :summary-method="summaryMethod" border stripe fit @cell-click="cellClickHandler">
         <el-table-column v-for="col in tableColsCopy" :key="col.prop" :prop="col.prop" :label="col.label" :width="col.width" :fixed="col.fixed">
           <el-table-column v-for="childCol in col.children" :key="childCol.prop" :prop="childCol.prop" :label="childCol.label" :width="childCol.width" :formatter="tableFormat">
             <template #header>
@@ -337,7 +337,8 @@ export default {
       arrivalCount: 0,
       baggageCount: 0,
       hasSetTableScroll: false,
-      table: null
+      table: null,
+      spanArr: []
     }
   },
   computed: {
@@ -466,6 +467,16 @@ export default {
         this.loading = false
       }
     },
+    objectSpanMethod ({ row, column, rowIndex, columnIndex }) {
+      if (['flightNO', 'flightDate'].includes(column.property)) {
+        const _row = this.spanArr[rowIndex]
+        const _col = _row > 0 ? 1 : 0
+        return {
+          rowspan: _row,
+          colspan: _col,
+        }
+      }
+    },
     initTableData (tableData) {
       this.baggageCount = 0
       tableData.forEach(item => {

+ 13 - 2
src/views/baggageManagementTemp/components/departure/index.vue

@@ -100,7 +100,7 @@
     </div>
     <!--表格-->
     <div v-loading="loading" class="terminal-table" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)">
-      <el-table ref="table" class="table" :height="computedTableHeight" :data="dealedTableData" :header-cell-class-name="headerCellClass" :row-class-name="tableRowClassName" :cell-class-name="cellClass" show-summary :summary-method="summaryMethod" border stripe fit @cell-click="cellClickHandler">
+      <el-table ref="table" class="table" :height="computedTableHeight" :data="dealedTableData" :header-cell-class-name="headerCellClass" :row-class-name="tableRowClassName" :span-method="objectSpanMethod" :cell-class-name="cellClass" show-summary :summary-method="summaryMethod" border stripe fit @cell-click="cellClickHandler">
         <el-table-column v-for="col in tableColsCopy" :key="col.prop" :prop="col.prop" :label="col.label" :width="col.width" :fixed="col.fixed" :formatter="tableFormat">
           <template #header>
             <el-tooltip :content="col.desc || childCol.label" placement="top">
@@ -294,7 +294,8 @@ export default {
       baggageCount: 0,
       hasSetTableScroll: false,
       table: null,
-      WarningData: []
+      WarningData: [],
+      spanArr: []
     }
   },
   computed: {
@@ -445,6 +446,16 @@ export default {
         this.loading = false
       }
     },
+    objectSpanMethod ({ row, column, rowIndex, columnIndex }) {
+      if (['flightNO', 'flightDate'].includes(column.property)) {
+        const _row = this.spanArr[rowIndex]
+        const _col = _row > 0 ? 1 : 0
+        return {
+          rowspan: _row,
+          colspan: _col,
+        }
+      }
+    },
     initTableData (tableData) {
       const currentTime = new Date()
       const curTime = this.formatTime(currentTime)