messageTable.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <div
  3. class="countPageClass"
  4. style="padding-left: 1vw; padding-top: 1.5vh; padding-right: 2vw"
  5. >
  6. <div>
  7. <div class="title" style="padding-left: 0.5vw">车辆报站</div>
  8. <div
  9. style="margin-left: 1vw; max-height: 20vh; overflow-y: scroll"
  10. class="tableClass"
  11. >
  12. <div v-for="(item, index) in messageList" :key="index">
  13. <div
  14. style="
  15. display: flex;
  16. flex-direction: row;
  17. justify-content: space-around;
  18. margin-top: 20px;
  19. "
  20. >
  21. <div :class="item.type == '1' ? 'carClass' : 'goodClass'" style="width: 80px">
  22. {{ item.carNum }}
  23. </div>
  24. <div class="contentClass" style="width: 60px">{{ "即将到达" }}</div>
  25. <div class="stationClass">
  26. <el-popover placement="top-start" trigger="hover" :content="item.station">
  27. <template #reference
  28. ><span>{{ item.station }}</span>
  29. </template>
  30. </el-popover>
  31. </div>
  32. <div class="timeClass">{{ moment(item.time).format("MM/DD HH:mm") }}</div>
  33. </div>
  34. <el-divider />
  35. </div>
  36. </div>
  37. </div>
  38. </div>
  39. </template>
  40. <script setup name="CarInfo" lang="ts">
  41. import moment from "moment";
  42. import { playlist } from "@/api/gpsData";
  43. const messageList = ref([]);
  44. const getList = () => {
  45. playlist().then((res) => {
  46. res = res.sort((a, b) => {
  47. return moment(b.time).unix() - moment(a.time).unix();
  48. });
  49. messageList.value = res;
  50. });
  51. };
  52. onMounted(() => {
  53. getList();
  54. });
  55. </script>
  56. <style scoped lang="scss">
  57. .countPageClass {
  58. height: 28vh;
  59. background: rgba(255, 255, 255, 0.85);
  60. border-radius: 8px 8px 8px 8px;
  61. box-shadow: 6px 6px 6px 6px rgba(0, 0, 0, 0.3);
  62. .title {
  63. font-family: Source Han Sans CN, Source Han Sans CN;
  64. font-weight: bold;
  65. font-size: 20px;
  66. color: #000000;
  67. line-height: 24px;
  68. text-align: left;
  69. font-style: normal;
  70. text-transform: none;
  71. }
  72. }
  73. .tableClass::-webkit-scrollbar {
  74. display: none;
  75. }
  76. .contentClass {
  77. font-family: Source Han Sans CN, Source Han Sans CN;
  78. font-weight: 400;
  79. font-size: 13px;
  80. color: #000000;
  81. line-height: 24px;
  82. text-align: left;
  83. font-style: normal;
  84. text-transform: none;
  85. }
  86. .stationClass {
  87. font-family: Source Han Sans CN, Source Han Sans CN;
  88. font-weight: bold;
  89. font-size: 13px;
  90. color: #000000;
  91. line-height: 24px;
  92. text-align: left;
  93. font-style: normal;
  94. text-transform: none;
  95. white-space: nowrap;
  96. text-overflow: ellipsis;
  97. overflow: hidden;
  98. width: 44px;
  99. text-align: center;
  100. }
  101. .timeClass {
  102. font-family: Source Han Sans CN, Source Han Sans CN;
  103. font-weight: 400;
  104. font-size: 10px;
  105. color: #000000;
  106. line-height: 24px;
  107. text-align: left;
  108. font-style: normal;
  109. text-transform: none;
  110. }
  111. .el-divider--horizontal {
  112. margin-top: 10px;
  113. margin-bottom: 0px;
  114. }
  115. .carClass {
  116. background: url("@/assets/images/home/Bg(2).png") no-repeat;
  117. background-size: 100% 100%;
  118. font-family: Source Han Sans CN, Source Han Sans CN;
  119. font-weight: 400;
  120. font-size: 10px;
  121. color: #ffffff;
  122. line-height: 20px;
  123. text-align: left;
  124. font-style: normal;
  125. text-transform: none;
  126. width: 5vw;
  127. text-align: center;
  128. height: 24px;
  129. line-height: 24px;
  130. }
  131. .goodClass {
  132. background: url("@/assets/images/home/Bg(3).png") no-repeat;
  133. background-size: 100% 100%;
  134. font-family: Source Han Sans CN, Source Han Sans CN;
  135. font-weight: 400;
  136. font-size: 10px;
  137. color: #6a4119;
  138. line-height: 20px;
  139. text-align: left;
  140. font-style: normal;
  141. text-transform: none;
  142. width: 5vw;
  143. text-align: center;
  144. height: 24px;
  145. line-height: 24px;
  146. }
  147. </style>