index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <div class="station-view">
  3. <div class="station-header">
  4. <StationForm />
  5. <div class="station-count">
  6. <CountBox
  7. :count-number="tableDataCount.waybillCount"
  8. label="预计装载总运单数"
  9. />
  10. <CountBox
  11. v-if="goodsCountFlag"
  12. :count-number="tableDataCount.goodsCount"
  13. label="预计装载总件数"
  14. />
  15. </div>
  16. <div class="station-settings">
  17. <TableSwitch v-model:flag="goodsCountFlag" label="显示件数" />
  18. <TableSwitch v-model:flag="UTCFlag" label="开启UTC" />
  19. <ColumnSet
  20. :table-columns="tableColumns"
  21. @checked-submit="columnChecked"
  22. />
  23. </div>
  24. </div>
  25. <div class="station-table">
  26. <el-auto-resizer>
  27. <template #default="{ height, width }">
  28. <el-table-v2
  29. :columns="filteredColumns"
  30. :data="tableData"
  31. :width="width"
  32. :height="height"
  33. :footer-height="60"
  34. :row-class="rowClass"
  35. fixed
  36. >
  37. <template #cell="slot: CellSlotProps">
  38. <div :class="cellClass(slot)">
  39. <span class="cell-text">{{
  40. slot.rowData[slot.column.dataKey]
  41. }}</span>
  42. <div class="cell-background" />
  43. </div>
  44. </template>
  45. <template #footer>
  46. <div class="table-footer">
  47. <span class="table-footer-count"
  48. >航班总数:{{ tableDataCount.flightCount }}</span
  49. >
  50. <span class="table-footer-count"
  51. >货运航班总数:{{ tableDataCount.freightFlightCount }}</span
  52. >
  53. <span class="table-footer-count"
  54. >已装机总数:{{ tableDataCount.loadCount }}</span
  55. >
  56. <span class="table-footer-count"
  57. >已起飞总数:{{ tableDataCount.takeOffCount }}</span
  58. >
  59. </div>
  60. </template>
  61. </el-table-v2>
  62. </template>
  63. </el-auto-resizer>
  64. </div>
  65. </div>
  66. </template>
  67. <script lang="ts" setup>
  68. import type { CellSlotProps } from '../../hooks/useTableStyle'
  69. import StationForm from '../../components/StationForm/index.vue'
  70. import ColumnSet from '../../components/ColumnSet/index.vue'
  71. import CountBox from '../../components/CountBox/index.vue'
  72. import TableSwitch from '../../components/TableSwitch/index.vue'
  73. import useTableColumnSet from '../../hooks/useTableColumnSet'
  74. import useTableData from '../../hooks/useTableData'
  75. import useTableStyle from '../../hooks/useTableStyle'
  76. const goodsCountFlag = ref(true)
  77. const UTCFlag = ref(true)
  78. const { tableColumns, tableData } = useTableData('arrival')
  79. const { columnChecked, filteredColumns } = useTableColumnSet(tableColumns)
  80. const tableDataCount = reactive({
  81. waybillCount: 0,
  82. goodsCount: 0,
  83. flightCount: 0,
  84. freightFlightCount: 0,
  85. loadCount: 0,
  86. takeOffCount: 0,
  87. })
  88. watch(tableData, records => {
  89. tableDataCount.waybillCount = records.length
  90. tableDataCount.goodsCount = records.length
  91. tableDataCount.flightCount = records.length
  92. tableDataCount.freightFlightCount = records.length
  93. tableDataCount.loadCount = records.length
  94. tableDataCount.takeOffCount = records.length
  95. })
  96. const { rowClass, cellClass } = useTableStyle()
  97. </script>
  98. <style lang="scss" scoped>
  99. @import '../../style/station.scss';
  100. </style>