ComplexList.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <!-- eslint-disable vue/multi-word-component-names -->
  2. <template>
  3. <!-- 基准的列表模块,通过不同的 type 展示不同的样式 -->
  4. <div class="list flex items-center" :class="`list_${type}`">
  5. <!-- 部分类型的列表需要加一张图片 -->
  6. <div :class="`list__image_${type}`"></div>
  7. <!-- 剩下的部分填充剩余宽度 -->
  8. <div class="flex-grow" :class="`list__wrapper_${type}`">
  9. <div v-for="(item, i) in listConfig" :key="`vvhccdcl${i}`" :class="`list-item_${type}`">
  10. <!-- 列表项前面的图标 -->
  11. <div :class="`list-item__title_${type}`">{{ item.title }}</div>
  12. <!-- 列表项的具体内容填充剩余宽度 -->
  13. <div v-for="(ctx, j) in item.contents" :key="`vvhccdclc${j}`" :class="`list-item__content_${type}`">
  14. <div class="list-item__label">{{ ctx.label }}</div>
  15. <div class="list-item__info" :class="`list-item__info_${ctx.color}`">{{ ctx.info }}</div>
  16. <div class="list-item__value" :class="`list-item__value_${ctx.color} list-item__value_${type}`">{{ ctx.value }}</div>
  17. </div>
  18. </div>
  19. </div>
  20. </div>
  21. </template>
  22. <script lang="ts" setup>
  23. withDefaults(
  24. defineProps<{
  25. listConfig: {
  26. title: string;
  27. contents: {
  28. value: string;
  29. color: string;
  30. label: string;
  31. info: string;
  32. }[];
  33. }[];
  34. /** A B */
  35. type: string;
  36. }>(),
  37. {
  38. listConfig: () => [],
  39. type: 'A',
  40. }
  41. );
  42. // defineEmits(['click']);
  43. </script>
  44. <style lang="less" scoped>
  45. @import '@/design/vent/color.less';
  46. /* Timeline 相关的样式 */
  47. .list {
  48. padding: 5px 20px;
  49. position: relative;
  50. width: 100%;
  51. height: 100%;
  52. }
  53. .list-item_A {
  54. position: relative;
  55. height: 140px;
  56. background-repeat: no-repeat;
  57. background-image: url(/@/assets/images/home-container/configurable/firehome/img-3.png);
  58. background-size: auto 100%;
  59. background-position: center;
  60. }
  61. .list-item__title_A {
  62. position: absolute;
  63. left: 41%;
  64. // font-size: 14px;
  65. top: 15px;
  66. }
  67. // .list-item__content_A {
  68. // position: absolute;
  69. // left: 35%;
  70. // top: 55px;
  71. // display: flex;
  72. // justify-content: space-evenly;
  73. // }
  74. .list-item__content_A:nth-of-type(2) {
  75. position: absolute;
  76. top: 15px;
  77. left: 14%;
  78. width: 22%;
  79. text-align: center;
  80. display: block;
  81. .list-item__label {
  82. font-size: 18px;
  83. margin-bottom: 25px;
  84. }
  85. .list-item__info {
  86. display: none;
  87. }
  88. .list-item__value {
  89. font-size: 24px;
  90. }
  91. }
  92. .list-item__content_A:nth-of-type(3) {
  93. position: absolute;
  94. left: 41%;
  95. top: 55px;
  96. .list-item__info {
  97. display: none;
  98. }
  99. .list-item__value {
  100. font-size: 20px;
  101. }
  102. }
  103. .list-item__content_A:nth-of-type(4) {
  104. position: absolute;
  105. left: 66%;
  106. top: 55px;
  107. .list-item__info {
  108. display: none;
  109. }
  110. .list-item__value {
  111. font-size: 20px;
  112. }
  113. }
  114. .list-item__content_A:nth-of-type(5) {
  115. position: absolute;
  116. left: 35%;
  117. bottom: 10px;
  118. display: flex;
  119. align-items: center;
  120. .list-item__info {
  121. display: none;
  122. }
  123. .list-item__value {
  124. font-size: 20px;
  125. margin-left: 5px;
  126. }
  127. }
  128. .list-item_B {
  129. // height: 155px;
  130. background-repeat: no-repeat;
  131. // background-size: 100% 100%;
  132. // background-size: auto 100%;
  133. background-size: 87% auto;
  134. background-position: center;
  135. background-image: url(/@/assets/images/home-container/configurable/firehome/img-7.png);
  136. display: flex;
  137. align-items: center;
  138. justify-content: space-between;
  139. text-align: center;
  140. padding: 0 10%;
  141. margin-top: 5px;
  142. height: 33px;
  143. .list-item__label {
  144. font-size: 11px;
  145. }
  146. .list-item__value {
  147. font-size: 21px;
  148. margin-left: 5px;
  149. }
  150. .list-item__content_B {
  151. height: 100%;
  152. display: flex;
  153. align-items: center;
  154. flex-basis: 100px;
  155. flex-grow: 1;
  156. }
  157. .list-item__title_B {
  158. width: 40px;
  159. text-align: center;
  160. margin-right: 50px
  161. // height: 30px;
  162. // background-size: auto 80%;
  163. // background-position: center;
  164. // background-repeat: no-repeat;
  165. }
  166. .list-item__info {
  167. display: none;
  168. }
  169. }
  170. // .list-item__title_B_O2 {
  171. // background-image: url(/@/assets/images/home-container/configurable/firehome/O₂.png);
  172. // }
  173. // .list-item__title_B_CH4 {
  174. // background-image: url(/@/assets/images/home-container/configurable/firehome/CH₄.png);
  175. // }
  176. // .list-item__title_B_CO {
  177. // background-image: url(/@/assets/images/home-container/configurable/firehome/CO.png);
  178. // }
  179. // .list-item__title_B_CO2 {
  180. // background-image: url(/@/assets/images/home-container/configurable/firehome/CO₂.png);
  181. // }
  182. // .list-item__label {
  183. // flex-basis: 55%;
  184. // }
  185. // .list-item__info {
  186. // flex-grow: 1;
  187. // }
  188. // .list-item__value {
  189. // flex-basis: 30%;
  190. // }
  191. .list-item__value_red {
  192. color: red;
  193. }
  194. .list-item__value_orange {
  195. color: orange;
  196. }
  197. .list-item__value_yellow {
  198. color: yellow;
  199. }
  200. .list-item__value_green {
  201. color: yellowgreen;
  202. }
  203. .list-item__value_blue {
  204. color: #009bff;
  205. }
  206. .list-item__value_white {
  207. color: white;
  208. }
  209. </style>