TimelineListNew.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <!-- eslint-disable vue/multi-word-component-names -->
  2. <template>
  3. <div class="timelineNew">
  4. <div class="left-section">
  5. <div class="warnBg"></div>
  6. <div class="warnInfo">
  7. <div>{{ 0 }}</div>
  8. <div>报警数</div>
  9. </div>
  10. </div>
  11. <div class="center-section"></div>
  12. <div class="right-section">
  13. <div v-for="item in listConfig" :key="item.prop" class="flex items-center timeline-item">
  14. <div class="timeline-item__icon" :class="`timeline-item__icon_${item.color}`" style="margin-bottom: 15px"></div>
  15. <div class="timeline-item__label" style="margin-bottom: 15px">{{ item.label }}</div>
  16. <div :class="`timeline-item__value_${item.color}`" style="margin-bottom: 15px">
  17. {{ item.value }}
  18. </div>
  19. </div>
  20. </div>
  21. <!-- <div class="timeline-item__dot"></div> -->
  22. </div>
  23. </template>
  24. <script lang="ts" setup>
  25. withDefaults(
  26. defineProps<{
  27. listConfig: {
  28. value: string;
  29. color: string;
  30. label: string;
  31. prop: string;
  32. }[];
  33. }>(),
  34. {
  35. listConfig: () => [],
  36. }
  37. );
  38. </script>
  39. <style lang="less" scoped>
  40. @import '/@/design/theme.less';
  41. @import '@/design/theme.less';
  42. /* Timeline 相关的样式 */
  43. @{theme-deepblue} {
  44. .timeline-item {
  45. --image-warn_icon_4: url('/@/assets/images/vent/homeNew/warn_icon_1.png');
  46. --image-warn_icon_3: url('/@/assets/images/vent/homeNew/warn_icon_2.png');
  47. --image-warn_icon_2: url('/@/assets/images/vent/homeNew/warn_icon_3.png');
  48. --image-warn_icon_1: url('/@/assets/images/vent/homeNew/warn_icon_4.png');
  49. }
  50. }
  51. .timeline-item {
  52. --image-warn_icon_4: url('/@/assets/images/vent/homeNew/warn_icon_1.png');
  53. --image-warn_icon_3: url('/@/assets/images/vent/homeNew/warn_icon_2.png');
  54. --image-warn_icon_2: url('/@/assets/images/vent/homeNew/warn_icon_3.png');
  55. --image-warn_icon_1: url('/@/assets/images/vent/homeNew/warn_icon_4.png');
  56. height: 20%;
  57. }
  58. .timelineNew {
  59. display: flex;
  60. height: 220px;
  61. position: relative;
  62. width: 100%;
  63. }
  64. .left-section {
  65. width: 24%;
  66. display: flex;
  67. flex-direction: column;
  68. margin-top: 30px;
  69. margin-left: 10px;
  70. .warnBg {
  71. flex: 1;
  72. background: url('/@/assets/images/vent/homeNew/Alarm.png');
  73. background-repeat: no-repeat;
  74. background-size: 100%;
  75. }
  76. .warnInfo {
  77. flex: 1;
  78. display: flex;
  79. flex-direction: column;
  80. align-items: center;
  81. background: url('/@/assets/images/vent/homeNew/databg/10.png');
  82. background-repeat: no-repeat;
  83. background-size: 100%;
  84. div:first-child {
  85. font-size: 16px;
  86. font-weight: bold;
  87. color: red;
  88. }
  89. div:last-child {
  90. font-size: 14px;
  91. color: #fff;
  92. }
  93. }
  94. }
  95. .center-section {
  96. width: 22%;
  97. margin-top: 30px;
  98. background: url('/@/assets/images/vent/homeNew/warn-dot.png') center/contain no-repeat;
  99. }
  100. .right-section {
  101. width: 71%;
  102. height: 100%;
  103. line-height: 100%;
  104. display: flex;
  105. flex-direction: column;
  106. align-items: center; /* 垂直居中 */
  107. justify-content: center; /* 水平居中 */
  108. .timeline-item {
  109. display: flex;
  110. background: url('/@/assets/images/vent/homeNew/databg/12.png');
  111. background-size: 100%;
  112. background-repeat: no-repeat;
  113. align-items: center;
  114. padding: 0 10px;
  115. &__icon {
  116. width: 33px;
  117. height: 35px;
  118. background-position: center;
  119. background-repeat: no-repeat;
  120. &_red {
  121. background-image: var(--image-warn_icon_4);
  122. }
  123. &_orange {
  124. background-image: var(--image-warn_icon_3);
  125. }
  126. &_yellow {
  127. background-image: var(--image-warn_icon_2);
  128. }
  129. &_blue {
  130. background-image: var(--image-warn_icon_1);
  131. }
  132. }
  133. &__label {
  134. width: 100px;
  135. }
  136. &__value {
  137. &_red {
  138. color: red;
  139. }
  140. &_orange {
  141. color: orange;
  142. }
  143. &_yellow {
  144. color: yellow;
  145. }
  146. &_blue {
  147. color: lightblue;
  148. }
  149. }
  150. }
  151. }
  152. </style>