ViolationRecords.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <div class="violation-records-container">
  3. <div class="container-title">
  4. <span class="line"></span>
  5. <span class="title">本月车辆违规记录</span>
  6. <span class="more" @click="handleClickMore"
  7. >查看全部<el-icon><ArrowRight /></el-icon
  8. ></span>
  9. </div>
  10. <div class="table-container">
  11. <el-table :data="violationRecords" style="width: 100%; height: 100%">
  12. <el-table-column prop="carNumber" label="车牌号" />
  13. <el-table-column prop="violateBy" label="车主">
  14. <template #default="scope">
  15. {{ scope.row.violateName || '-' }}
  16. </template>
  17. </el-table-column>
  18. <el-table-column prop="deptName" label="所属部门">
  19. <template #default="scope">
  20. {{ scope.row.deptName || '-' }}
  21. </template>
  22. </el-table-column>
  23. <el-table-column prop="violateType" label="违规类型">
  24. <template #default="scope">
  25. {{ getVehicleViolationTypeMap(scope.row.violateType) }}
  26. </template>
  27. </el-table-column>
  28. <el-table-column prop="violateLocation" label="违规地点">
  29. <template #default="scope">
  30. {{ scope.row.violateLocation || '-' }}
  31. </template>
  32. </el-table-column>
  33. <el-table-column prop="captureTime" label="违规时间" />
  34. <el-table-column prop="capturePhotos" label="抓拍照片" align="center">
  35. <template #default="scope">
  36. <ImageViewer :file-list="scope.row.capturePhotos" />
  37. </template>
  38. </el-table-column>
  39. </el-table>
  40. </div>
  41. </div>
  42. </template>
  43. <script setup lang="ts">
  44. import { ref, onMounted } from 'vue';
  45. import router from '@/router';
  46. import { ElIcon } from 'element-plus';
  47. import { ArrowRight } from '@element-plus/icons-vue';
  48. import { getVehicleViolationTypeMap } from '@/views/traffic/overview/constant';
  49. import ImageViewer from '@/views/traffic/violation/act/components/ImageViewer.vue';
  50. import {
  51. QueryPageParams,
  52. QueryTrafficViolationOverviewPageRes,
  53. getTrafficViolationOverview,
  54. } from '@/api/traffic-overview';
  55. const queryPageParams = ref<QueryPageParams>({
  56. pageNumber: 1,
  57. pageSize: 20,
  58. });
  59. const violationRecords = ref<QueryTrafficViolationOverviewPageRes[]>([]);
  60. const handleClickMore = () => {
  61. router.push({
  62. path: '/traffic/violation/notice',
  63. });
  64. };
  65. const getTrafficViolationOverviewData = () => {
  66. getTrafficViolationOverview(queryPageParams.value).then((res) => {
  67. violationRecords.value = res.records;
  68. });
  69. };
  70. onMounted(() => {
  71. getTrafficViolationOverviewData();
  72. });
  73. </script>
  74. <style scoped lang="scss">
  75. .container-title {
  76. height: 24px;
  77. display: flex;
  78. align-items: center;
  79. font-weight: 500;
  80. font-size: 16px;
  81. color: #000000;
  82. .line {
  83. width: 3px;
  84. height: 16px;
  85. background: #1777ff;
  86. margin-right: 10px;
  87. }
  88. .title {
  89. margin-right: 12px;
  90. }
  91. .more {
  92. margin-left: auto;
  93. margin-right: 17px;
  94. font-weight: 400;
  95. font-size: 16px;
  96. color: #1777ff;
  97. display: flex;
  98. align-items: center;
  99. cursor: pointer;
  100. }
  101. .more:hover {
  102. color: #94c1ff;
  103. }
  104. }
  105. .violation-records-container {
  106. width: 100%;
  107. height: 100%;
  108. padding: 14px 0;
  109. .table-container {
  110. width: 100%;
  111. height: calc(100% - 24px - 18px);
  112. margin-top: 18px;
  113. padding: 0 16px;
  114. overflow: auto;
  115. }
  116. }
  117. </style>