messageTable.vue 3.2 KB

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