CustomGallery.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. <!-- eslint-disable vue/multi-word-component-names -->
  2. <template>
  3. <!-- 基准的画廊模块,通过不同的 type 展示不同的样式 -->
  4. <div class="gallery" :class="`gallery_${type}`">
  5. <!-- 部分类型的画廊需要加一张图片 -->
  6. <div :class="`gallery-item_center_${type}`"></div>
  7. <div v-for="item in galleryConfig" :key="item.prop" :class="`gallery-item_${type}`">
  8. <!-- 画廊项的具体内容填充剩余宽度 -->
  9. <div class="gallery-item__label">{{ item.label }}</div>
  10. <div class="gallery-item__value" :class="`gallery-item__value_${item.color}`">{{ item.value }}</div>
  11. </div>
  12. </div>
  13. </template>
  14. <script lang="ts" setup>
  15. // import { get } from 'lodash-es';
  16. // import { computed } from 'vue';
  17. withDefaults(
  18. defineProps<{
  19. galleryConfig: {
  20. value: string;
  21. color: string;
  22. label: string;
  23. prop: string;
  24. }[];
  25. /** A | B | C | D */
  26. type: string;
  27. }>(),
  28. {
  29. galleryConfig: () => [],
  30. type: 'A',
  31. }
  32. );
  33. // defineEmits(['click']);
  34. </script>
  35. <style lang="less" scoped>
  36. @import '@/design/vent/color.less';
  37. /* Timeline 相关的样式 */
  38. .gallery {
  39. position: relative;
  40. width: 100%;
  41. height: 100%;
  42. }
  43. .gallery-item_center_A {
  44. background: url(@/assets/images/home-container/configurable/gallery_center.png) no-repeat;
  45. width: 144px;
  46. height: 126px;
  47. left: calc(50% - 72px);
  48. top: calc(50% - 63px);
  49. position: absolute;
  50. background-size: 100% 100%;
  51. }
  52. .gallery > .gallery-item_A {
  53. background: url(@/assets/images/home-container/configurable/gallery_1.png) no-repeat;
  54. width: 90px;
  55. height: 90px;
  56. position: absolute;
  57. text-align: center;
  58. }
  59. .gallery > .gallery-item_A:nth-child(2) {
  60. top: 20px;
  61. left: 60px;
  62. }
  63. .gallery > .gallery-item_A:nth-child(3) {
  64. top: 20px;
  65. right: 60px;
  66. }
  67. .gallery > .gallery-item_A:nth-child(4) {
  68. bottom: 20px;
  69. left: 60px;
  70. }
  71. .gallery > .gallery-item_A:nth-child(5) {
  72. bottom: 20px;
  73. right: 60px;
  74. }
  75. .gallery-item_center_B {
  76. background: url(/@/assets/images/home-container/configurable/deco_2.png) no-repeat;
  77. width: 100%;
  78. height: 90%;
  79. top: 5%;
  80. position: absolute;
  81. background-position: center;
  82. background-size: auto 100%;
  83. }
  84. // .gallery .gallery-item__value {
  85. // display: none;
  86. // }
  87. .gallery > .gallery-item_B {
  88. background: url(/@/assets/images/home-container/configurable/deco_3.png) no-repeat;
  89. position: absolute;
  90. text-align: center;
  91. background-position: center;
  92. background-size: auto 100%;
  93. }
  94. .gallery > .gallery-item_B:nth-child(2) {
  95. width: 70px;
  96. height: 70px;
  97. line-height: 70px;
  98. top: 20px;
  99. left: calc(50% - 70px);
  100. }
  101. .gallery > .gallery-item_B:nth-child(3) {
  102. width: 60px;
  103. height: 60px;
  104. line-height: 60px;
  105. top: 50px;
  106. // right: 34%;
  107. right: calc(50% - 70px);
  108. }
  109. .gallery > .gallery-item_B:nth-child(4) {
  110. width: 55px;
  111. height: 55px;
  112. line-height: 55px;
  113. bottom: 90px;
  114. left: calc(50% - 55px);
  115. }
  116. .gallery > .gallery-item_B:nth-child(5) {
  117. width: 50px;
  118. height: 50px;
  119. line-height: 50px;
  120. bottom: 70px;
  121. right: calc(50% - 50px);
  122. }
  123. .gallery-item_B > .gallery-item__label {
  124. display: none;
  125. }
  126. .gallery-item_center_C {
  127. background: url(/@/assets/images/home-container/configurable/deco_4.png) no-repeat;
  128. width: 100%;
  129. height: 100%;
  130. // top: 5%;
  131. position: absolute;
  132. background-position: center;
  133. background-size: auto 100%;
  134. }
  135. .gallery_C {
  136. display: flex;
  137. flex-direction: column;
  138. align-items: center;
  139. justify-content: space-around;
  140. text-align: center;
  141. }
  142. .gallery-item_C > .gallery-item__value {
  143. font-size: 20px;
  144. }
  145. .gallery_D {
  146. display: flex;
  147. align-items: center;
  148. justify-content: center;
  149. height: 100px;
  150. }
  151. .gallery-item_center_D {
  152. background: url(/@/assets/images/home-container/configurable/firehome/img-2.png) no-repeat;
  153. background-size: auto 100%;
  154. width: 100px;
  155. height: 100px;
  156. }
  157. .gallery > .gallery-item_D {
  158. background-image: url(/@/assets/images/home-container/configurable/firehome/img-1.png);
  159. background-size: 100% auto;
  160. width: 213px;
  161. height: 87px;
  162. text-align: center;
  163. // line-height: 35px;
  164. padding-top: 17px;
  165. padding-left: 40px;
  166. display: none;
  167. .gallery-item__value {
  168. font-size: 24px;
  169. }
  170. }
  171. .gallery > .gallery-item_D:nth-child(2) {
  172. display: block;
  173. }
  174. .gallery-item_center_E {
  175. background: url(/@/assets/images/home-container/configurable/dusthome/img-8.png) no-repeat;
  176. width: 200px;
  177. height: 200px;
  178. left: calc(50% - 100px);
  179. top: calc(50% - 110px);
  180. position: absolute;
  181. background-size: 100% auto;
  182. }
  183. .gallery > .gallery-item_E {
  184. background: url(/@/assets/images/home-container/configurable/dusthome/img-9.png) no-repeat;
  185. width: 100px;
  186. height: 90px;
  187. position: absolute;
  188. text-align: center;
  189. background-size: 100% 100%;
  190. .gallery-item__label {
  191. height: 60px;
  192. text-align: center;
  193. background-size: 30px 30px;
  194. background-position: center top;
  195. background-repeat: no-repeat;
  196. padding-top: 30px;
  197. }
  198. }
  199. .gallery > .gallery-item_E:nth-child(2) {
  200. top: 20px;
  201. left: 80px;
  202. .gallery-item__label {
  203. background-image: url(/@/assets/images/home-container/configurable/dusthome/sbzs.png);
  204. }
  205. }
  206. .gallery > .gallery-item_E:nth-child(3) {
  207. top: 20px;
  208. right: 80px;
  209. .gallery-item__label {
  210. background-image: url(/@/assets/images/home-container/configurable/dusthome/pwkqs.png);
  211. }
  212. }
  213. .gallery > .gallery-item_E:nth-child(4) {
  214. bottom: 20px;
  215. left: 80px;
  216. .gallery-item__label {
  217. background-image: url(/@/assets/images/home-container/configurable/dusthome/lwsl.png);
  218. }
  219. }
  220. .gallery > .gallery-item_E:nth-child(5) {
  221. bottom: 20px;
  222. right: 80px;
  223. .gallery-item__label {
  224. background-image: url(/@/assets/images/home-container/configurable/dusthome/dwsl.png);
  225. }
  226. }
  227. // .gallery-item_center_F {
  228. // }
  229. .gallery > .gallery-item_F {
  230. width: 120px;
  231. height: 60px;
  232. position: absolute;
  233. text-align: center;
  234. padding-left: 20px;
  235. background-size: 100% 100%;
  236. background-repeat: no-repeat;
  237. background-position: center;
  238. background-image: url(/@/assets/images/home-container/configurable/firehome/img-1.png);
  239. .gallery-item__value {
  240. font-size: 20px;
  241. }
  242. }
  243. .gallery > .gallery-item_F:nth-child(2) {
  244. top: 10px;
  245. left: 30px;
  246. width: 130px;
  247. height: 130px;
  248. line-height: 130px;
  249. padding: 0;
  250. background-image: url(/@/assets/images/home-container/configurable/dusthome/img-7.png);
  251. .gallery-item__label {
  252. display: none;
  253. }
  254. }
  255. .gallery > .gallery-item_F:nth-child(3) {
  256. top: 15px;
  257. left: 160px;
  258. padding-top: 5px;
  259. }
  260. .gallery > .gallery-item_F:nth-child(4) {
  261. top: 15px;
  262. left: 280px;
  263. padding-top: 5px;
  264. }
  265. .gallery > .gallery-item_F:nth-child(5) {
  266. top: 80px;
  267. left: 160px;
  268. padding-top: 5px;
  269. }
  270. .gallery > .gallery-item_F:nth-child(6) {
  271. top: 80px;
  272. left: 280px;
  273. padding-top: 5px;
  274. }
  275. .gallery > .gallery-item_G {
  276. width: 120px;
  277. height: 120px;
  278. position: absolute;
  279. text-align: center;
  280. padding-top: 34px;
  281. background-size: 100% 100%;
  282. background-repeat: no-repeat;
  283. background-position: center;
  284. background-image: url(/@/assets/images/home-container/configurable/firehome/img-4.png);
  285. .gallery-item__value {
  286. font-size: 20px;
  287. }
  288. }
  289. .gallery > .gallery-item_G:nth-child(2) {
  290. top: calc(50% - 60px);
  291. left: calc(50% - 60px);
  292. }
  293. .gallery > .gallery-item_G:nth-child(3) {
  294. top: calc(50% - 60px);
  295. left: 60px;
  296. transform: scale(0.7);
  297. }
  298. .gallery > .gallery-item_G:nth-child(4) {
  299. top: calc(50% - 60px);
  300. right: 60px;
  301. transform: scale(0.7);
  302. }
  303. .gallery > .gallery-item_G:nth-child(5) {
  304. top: 10px;
  305. left: 0px;
  306. transform: scale(0.5);
  307. }
  308. .gallery > .gallery-item_G:nth-child(6) {
  309. bottom: 10px;
  310. left: 0px;
  311. transform: scale(0.5);
  312. }
  313. .gallery > .gallery-item_G:nth-child(7) {
  314. top: 10px;
  315. right: 0px;
  316. transform: scale(0.5);
  317. }
  318. .gallery > .gallery-item_G:nth-child(8) {
  319. bottom: 10px;
  320. right: 0px;
  321. transform: scale(0.5);
  322. }
  323. .gallery-item__value_red {
  324. color: red;
  325. }
  326. .gallery-item__value_orange {
  327. color: orange;
  328. }
  329. .gallery-item__value_yellow {
  330. color: yellow;
  331. }
  332. .gallery-item__value_green {
  333. color: yellowgreen;
  334. }
  335. .gallery-item__value_blue {
  336. color: #009bff;
  337. }
  338. .gallery-item__value_white {
  339. color: white;
  340. }
  341. </style>