CustomList.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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 in listConfig" :key="item.prop" class="flex items-center" :class="`list-item_${type}`">
  10. <!-- 列表项前面的图标 -->
  11. <div :class="`list-item__icon_${type}`"></div>
  12. <!-- 列表项的具体内容填充剩余宽度 -->
  13. <div class="flex-grow" :class="`list-item__content_${type}`">
  14. <div class="list-item__label">{{ item.label }}</div>
  15. <div class="list-item__info" :class="`list-item__info_${item.color}`">{{ item.info }}</div>
  16. <div class="list-item__value" :class="`list-item__value_${item.color} list-item__value_${type}`">{{ item.value }}</div>
  17. </div>
  18. </div>
  19. </div>
  20. </div>
  21. </template>
  22. <script lang="ts" setup>
  23. withDefaults(
  24. defineProps<{
  25. listConfig: {
  26. value: string;
  27. color: string;
  28. label: string;
  29. prop: string;
  30. info: string;
  31. }[];
  32. /** A B C D E */
  33. type: string;
  34. }>(),
  35. {
  36. listConfig: () => [],
  37. type: 'A',
  38. }
  39. );
  40. // defineEmits(['click']);
  41. </script>
  42. <style lang="less" scoped>
  43. @import '@/design/vent/color.less';
  44. /* Timeline 相关的样式 */
  45. .list {
  46. padding: 5px 20px;
  47. position: relative;
  48. background-repeat: no-repeat;
  49. width: 100%;
  50. height: 100%;
  51. background-size: auto 100%;
  52. background-image: url(/@/assets/images/home-container/configurable/list_bg_default.png);
  53. }
  54. .list_A {
  55. padding-left: 5px;
  56. }
  57. .list-item__content_A {
  58. background-repeat: no-repeat;
  59. background-image: @vent-gas-list-item-bg-img;
  60. padding: 5px 10px;
  61. display: flex;
  62. }
  63. .list-item__icon_A {
  64. background-repeat: no-repeat;
  65. width: 25px;
  66. height: 29px;
  67. background-image: url(/@/assets/images/home-container/configurable/triangle_icon.png);
  68. }
  69. .list-item__content_B {
  70. background-repeat: no-repeat;
  71. padding: 5px 10px 10px 10px;
  72. display: flex;
  73. background-position: left bottom;
  74. background-size: 100% auto;
  75. background-image: url(/@/assets/images/home-container/configurable/list_bg_b.png);
  76. }
  77. .list__image_B {
  78. width: 77px;
  79. height: 77px;
  80. background-repeat: no-repeat;
  81. background-image: url(/@/assets/images/home-container/configurable/deco_1.png);
  82. background-size: auto;
  83. margin-right: 20px;
  84. }
  85. .list_C {
  86. background: none;
  87. }
  88. .list-item__content_C {
  89. height: 60px;
  90. background-repeat: no-repeat;
  91. padding: 25px 50px 0 50px;
  92. display: flex;
  93. background-position: center;
  94. background-size: 100% 100%;
  95. background-image: url(/@/assets/images/home-container/configurable/list_bg_c.png);
  96. margin-bottom: 10px;
  97. text-align: center;
  98. }
  99. .list-item__content_C > div {
  100. flex-basis: 33.3%;
  101. }
  102. .list_D {
  103. background-size: 100% auto;
  104. background-image: url(/@/assets/images/home-container/configurable/list_bg_defflip.png);
  105. }
  106. .list__wrapper_D {
  107. display: flex;
  108. flex-wrap: wrap;
  109. }
  110. .list-item__icon_D {
  111. display: none;
  112. }
  113. .list-item_D {
  114. flex-basis: 25%;
  115. // width: 80px;
  116. height: 60px;
  117. background-repeat: no-repeat;
  118. // padding: 25px 50px 0 50px;
  119. // display: flex;
  120. background-position: center;
  121. background-size: auto 100%;
  122. background-image: url(/@/assets/images/home-container/configurable/list_bg_d.png);
  123. // margin-bottom: 10px;
  124. text-align: center;
  125. margin-bottom: 10px;
  126. }
  127. .list-item__content_D {
  128. line-height: 30px;
  129. }
  130. .list-item__value_D {
  131. font-weight: bold;
  132. }
  133. .list_E {
  134. background-image: url(/@/assets/images/home-container/configurable/list_bg_defflip.png);
  135. }
  136. .list__wrapper_E {
  137. display: flex;
  138. flex-wrap: wrap;
  139. }
  140. .list-item__icon_E {
  141. display: none;
  142. }
  143. .list-item_E {
  144. flex-basis: 25%;
  145. // width: 80px;
  146. height: 70px;
  147. background-repeat: no-repeat;
  148. // padding: 25px 50px 0 50px;
  149. // display: flex;
  150. background-position: center;
  151. background-size: auto 100%;
  152. background-image: url(/@/assets/images/home-container/configurable/list_bg_e.png);
  153. // margin-bottom: 10px;
  154. text-align: center;
  155. margin: 5px 0px;
  156. padding-top: 32px;
  157. font-size: 12px;
  158. }
  159. // .list-item__icon_red {
  160. // background-image: url('@/assets/images/home-container/configurable/warn_icon_5.png');
  161. // }
  162. // .list-item__icon_orange {
  163. // background-image: url('@/assets/images/home-container/configurable/warn_icon_4.png');
  164. // }
  165. // .list-item__icon_yellow {
  166. // background-image: url('@/assets/images/home-container/configurable/warn_icon_3.png');
  167. // }
  168. // .list-item__icon_green {
  169. // background-image: url('@/assets/images/home-container/configurable/warn_icon_2.png');
  170. // }
  171. // .list-item__icon_blue {
  172. // background-image: url('@/assets/images/home-container/configurable/warn_icon_1.png');
  173. // }
  174. // .list-item__icon {
  175. // width: 33px;
  176. // height: 35px;
  177. // margin-left: 50px;
  178. // background-repeat: no-repeat;
  179. // background-position: center center;
  180. // }
  181. // .list-item__dot {
  182. // width: 10px;
  183. // height: 10px;
  184. // margin-left: 70px;
  185. // background-color: @vent-gas-primary-bg;
  186. // border-radius: 5px;
  187. // position: relative;
  188. // }
  189. // .list-item__dot::before {
  190. // content: '';
  191. // position: absolute;
  192. // top: -3px;
  193. // left: -3px;
  194. // width: 16px;
  195. // height: 16px;
  196. // border-radius: 8px;
  197. // border: 1px solid @vent-gas-tab-border;
  198. // }
  199. .list-item__label {
  200. flex-basis: 55%;
  201. }
  202. .list-item__info {
  203. flex-grow: 1;
  204. }
  205. .list-item__value {
  206. flex-basis: 30%;
  207. }
  208. .list-item__value_red {
  209. color: red;
  210. }
  211. .list-item__value_orange {
  212. color: orange;
  213. }
  214. .list-item__value_yellow {
  215. color: yellow;
  216. }
  217. .list-item__value_green {
  218. color: yellowgreen;
  219. }
  220. .list-item__value_blue {
  221. color: lightblue;
  222. }
  223. .list-item__value_white {
  224. color: white;
  225. }
  226. </style>