CustomGallery.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  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/theme.less';
  37. @import '@/design/theme.less';
  38. @{theme-deepblue} {
  39. .gallery {
  40. --image-gallery_center: url(/@/assets/images/themify/deepblue/configurable/gallery_center.png);
  41. --image-gallery_1: url(/@/assets/images/themify/deepblue/configurable/gallery_1.png);
  42. --image-deco_2: url(/@/assets/images/themify/deepblue/configurable/deco_2.png);
  43. --image-deco_3: url(/@/assets/images/themify/deepblue/configurable/deco_3.png);
  44. --image-deco_4: url(/@/assets/images/themify/deepblue/configurable/deco_4.png);
  45. --image-img-2: url(/@/assets/images/themify/deepblue/configurable/firehome/img-2.png);
  46. --image-img-1: url(/@/assets/images/themify/deepblue/configurable/firehome/img-1.png);
  47. --image-img-8: url(/@/assets/images/themify/deepblue/configurable/dusthome/img-8.png);
  48. --image-img-9: url(/@/assets/images/themify/deepblue/configurable/dusthome/img-9.png);
  49. --image-sbzs: url(/@/assets/images/themify/deepblue/configurable/dusthome/sbzs.png);
  50. --image-pwkqs: url(/@/assets/images/themify/deepblue/configurable/dusthome/pwkqs.png);
  51. --image-lwsl: url(/@/assets/images/themify/deepblue/configurable/dusthome/lwsl.png);
  52. --image-dwsl: url(/@/assets/images/themify/deepblue/configurable/dusthome/dwsl.png);
  53. --image-img-1: url(/@/assets/images/themify/deepblue/configurable/firehome/img-1.png);
  54. --image-img-7: url(/@/assets/images/themify/deepblue/configurable/dusthome/img-7.png);
  55. --image-img-4: url(/@/assets/images/themify/deepblue/configurable/firehome/img-4.png);
  56. --image-bottom1: url('/@/assets/images/themify/deepblue/alarm/bottom1.png');
  57. --image-center-bg: url('/@/assets/images/themify/deepblue/alarm/center-bg.png');
  58. --image-warning-icon-bg1: url(/@/assets/images/themify/deepblue/alarm/warning-icon-bg1.png);
  59. --image-warning-icon-bg-a1: url(/@/assets/images/themify/deepblue/alarm/warning-icon-bg-a1.png);
  60. --image-data-bg: url(/@/assets/images/themify/deepblue/alarm/data-bg.png);
  61. --image-icon-vent: url(/@/assets/images/themify/deepblue/alarm/icon-vent.svg);
  62. --image-icon-bg: url(/@/assets/images/themify/deepblue/alarm/icon-bg.png);
  63. --image-icon-device: url(/@/assets/images/themify/deepblue/alarm/icon-device.svg);
  64. --image-icon-dust: url(/@/assets/images/themify/deepblue/alarm/icon-dust.svg);
  65. --image-icon-gas: url(/@/assets/images/themify/deepblue/alarm/icon-gas.svg);
  66. --image-gallery_I_2: url(/@/assets/images/themify/deepblue/configurable/dusthome/gallery_I_2.png);
  67. --image-gallery_I_1: url(/@/assets/images/themify/deepblue/configurable/dusthome/gallery_I_1.png);
  68. }
  69. }
  70. .gallery {
  71. --image-gallery_center: url(/@/assets/images/home-container/configurable/gallery_center.png);
  72. --image-gallery_1: url(/@/assets/images/home-container/configurable/gallery_1.png);
  73. --image-deco_2: url(/@/assets/images/home-container/configurable/deco_2.png);
  74. --image-deco_3: url(/@/assets/images/home-container/configurable/deco_3.png);
  75. --image-deco_4: url(/@/assets/images/home-container/configurable/deco_4.png);
  76. --image-img-2: url(/@/assets/images/home-container/configurable/firehome/img-2.png);
  77. --image-img-1: url(/@/assets/images/home-container/configurable/firehome/img-1.png);
  78. --image-img-8: url(/@/assets/images/home-container/configurable/dusthome/img-8.png);
  79. --image-img-9: url(/@/assets/images/home-container/configurable/dusthome/img-9.png);
  80. --image-sbzs: url(/@/assets/images/home-container/configurable/dusthome/sbzs.png);
  81. --image-pwkqs: url(/@/assets/images/home-container/configurable/dusthome/pwkqs.png);
  82. --image-lwsl: url(/@/assets/images/home-container/configurable/dusthome/lwsl.png);
  83. --image-dwsl: url(/@/assets/images/home-container/configurable/dusthome/dwsl.png);
  84. --image-img-1: url(/@/assets/images/home-container/configurable/firehome/img-1.png);
  85. --image-img-7: url(/@/assets/images/home-container/configurable/dusthome/img-7.png);
  86. --image-img-4: url(/@/assets/images/home-container/configurable/firehome/img-4.png);
  87. --image-bottom1: url('/@/assets/images/vent/alarm/bottom1.png');
  88. --image-center-bg: url('/@/assets/images/vent/alarm/center-bg.png');
  89. --image-warning-icon-bg1: url(/@/assets/images/vent/alarm/warning-icon-bg1.png);
  90. --image-warning-icon-bg-a1: url(/@/assets/images/vent/alarm/warning-icon-bg-a1.png);
  91. --image-data-bg: url(/@/assets/images/vent/alarm/data-bg.png);
  92. --image-icon-vent: url(/@/assets/images/vent/alarm/icon-vent.svg);
  93. --image-icon-bg: url(/@/assets/images/vent/alarm/icon-bg.png);
  94. --image-icon-device: url(/@/assets/images/vent/alarm/icon-device.svg);
  95. --image-icon-dust: url(/@/assets/images/vent/alarm/icon-dust.svg);
  96. --image-icon-gas: url(/@/assets/images/vent/alarm/icon-gas.svg);
  97. --image-gallery_I_2: url(/@/assets/images/home-container/configurable/dusthome/gallery_I_2.png);
  98. --image-gallery_I_1: url(/@/assets/images/home-container/configurable/dusthome/gallery_I_1.png);
  99. position: relative;
  100. width: 100%;
  101. height: 100%;
  102. }
  103. .gallery-item_center_A {
  104. background: var(--image-gallery_center) no-repeat;
  105. width: 144px;
  106. height: 126px;
  107. left: calc(50% - 72px);
  108. top: calc(50% - 63px);
  109. position: absolute;
  110. background-size: 100% 100%;
  111. }
  112. .gallery > .gallery-item_A {
  113. background: var(--image-gallery_1) no-repeat;
  114. width: 90px;
  115. height: 90px;
  116. position: absolute;
  117. text-align: center;
  118. background-size: 100% 90px;
  119. }
  120. .gallery > .gallery-item_A:nth-child(2) {
  121. top: 20px;
  122. left: 60px;
  123. }
  124. .gallery > .gallery-item_A:nth-child(3) {
  125. top: 20px;
  126. right: 60px;
  127. }
  128. .gallery > .gallery-item_A:nth-child(4) {
  129. bottom: 20px;
  130. left: 60px;
  131. }
  132. .gallery > .gallery-item_A:nth-child(5) {
  133. bottom: 20px;
  134. right: 60px;
  135. }
  136. .gallery-item_center_B {
  137. background: var(--image-deco_2) no-repeat;
  138. width: 100%;
  139. height: 90%;
  140. top: 5%;
  141. position: absolute;
  142. background-position: center;
  143. background-size: auto 100%;
  144. }
  145. .gallery > .gallery-item_B {
  146. background: var(--image-deco_3) no-repeat;
  147. position: absolute;
  148. text-align: center;
  149. background-position: center;
  150. background-size: auto 100%;
  151. }
  152. .gallery > .gallery-item_B:nth-child(2) {
  153. width: 70px;
  154. height: 70px;
  155. line-height: 70px;
  156. top: 20px;
  157. left: calc(50% - 70px);
  158. }
  159. .gallery > .gallery-item_B:nth-child(3) {
  160. width: 60px;
  161. height: 60px;
  162. line-height: 60px;
  163. top: 50px;
  164. right: calc(50% - 70px);
  165. }
  166. .gallery > .gallery-item_B:nth-child(4) {
  167. width: 55px;
  168. height: 55px;
  169. line-height: 55px;
  170. bottom: 90px;
  171. left: calc(50% - 55px);
  172. }
  173. .gallery > .gallery-item_B:nth-child(5) {
  174. width: 50px;
  175. height: 50px;
  176. line-height: 50px;
  177. bottom: 70px;
  178. right: calc(50% - 50px);
  179. }
  180. .gallery-item_B > .gallery-item__label {
  181. display: none;
  182. }
  183. .gallery-item_center_C {
  184. background: var(--image-deco_4) no-repeat;
  185. width: 100%;
  186. height: 100%;
  187. position: absolute;
  188. background-position: center;
  189. background-size: auto 100%;
  190. z-index: -1;
  191. }
  192. .gallery_C {
  193. display: flex;
  194. flex-direction: column;
  195. align-items: center;
  196. justify-content: space-around;
  197. text-align: center;
  198. }
  199. .gallery-item_C > .gallery-item__value {
  200. font-size: 20px;
  201. }
  202. .gallery_D {
  203. display: flex;
  204. align-items: center;
  205. justify-content: center;
  206. }
  207. .gallery-item_center_D {
  208. background: var(--image-img-2) no-repeat;
  209. background-size: auto 100%;
  210. width: 100px;
  211. height: 100px;
  212. }
  213. .gallery > .gallery-item_D {
  214. background-image: var(--image-img-1);
  215. background-size: 100% auto;
  216. width: 213px;
  217. height: 87px;
  218. text-align: center;
  219. padding-top: 17px;
  220. padding-left: 40px;
  221. display: none;
  222. .gallery-item__value {
  223. font-size: 24px;
  224. }
  225. }
  226. .gallery > .gallery-item_D:nth-child(2) {
  227. display: block;
  228. }
  229. .gallery-item_center_E {
  230. background: var(--image-img-8) no-repeat;
  231. width: 200px;
  232. height: 200px;
  233. left: calc(50% - 100px);
  234. top: calc(50% - 100px);
  235. position: absolute;
  236. background-size: 100% auto;
  237. }
  238. .gallery > .gallery-item_E {
  239. background: var(--image-img-9) no-repeat;
  240. width: 100px;
  241. height: 90px;
  242. position: absolute;
  243. text-align: center;
  244. background-size: 100% 100%;
  245. .gallery-item__label {
  246. height: 60px;
  247. text-align: center;
  248. background-size: 30px 30px;
  249. background-position: center top;
  250. background-repeat: no-repeat;
  251. padding-top: 30px;
  252. }
  253. }
  254. .gallery > .gallery-item_E:nth-child(2) {
  255. top: calc(50% - 100px);
  256. left: calc(50% - 150px);
  257. .gallery-item__label {
  258. background-image: var(--image-sbzs);
  259. }
  260. }
  261. .gallery > .gallery-item_E:nth-child(3) {
  262. top: calc(50% - 100px);
  263. right: calc(50% - 150px);
  264. .gallery-item__label {
  265. background-image: var(--image-pwkqs);
  266. }
  267. }
  268. .gallery > .gallery-item_E:nth-child(4) {
  269. bottom: calc(50% - 100px);
  270. left: calc(50% - 150px);
  271. .gallery-item__label {
  272. background-image: var(--image-lwsl);
  273. }
  274. }
  275. .gallery > .gallery-item_E:nth-child(5) {
  276. bottom: calc(50% - 100px);
  277. right: calc(50% - 150px);
  278. .gallery-item__label {
  279. background-image: var(--image-dwsl);
  280. }
  281. }
  282. .gallery > .gallery-item_F {
  283. width: 120px;
  284. height: 60px;
  285. position: absolute;
  286. text-align: center;
  287. padding-left: 20px;
  288. padding-top: 5px;
  289. background-size: 100% 100%;
  290. background-repeat: no-repeat;
  291. background-position: center;
  292. background-image: var(--image-img-1);
  293. .gallery-item__value {
  294. font-size: 20px;
  295. }
  296. }
  297. .gallery > .gallery-item_F:nth-child(2) {
  298. top: calc(50% - 60px);
  299. left: calc(50% - 180px);
  300. width: 120px;
  301. height: 120px;
  302. line-height: 120px;
  303. padding: 0;
  304. background-image: var(--image-img-7);
  305. .gallery-item__label {
  306. display: none;
  307. }
  308. }
  309. .gallery > .gallery-item_F:nth-child(3) {
  310. top: calc(50% - 62px);
  311. left: calc(50% - 60px);
  312. }
  313. .gallery > .gallery-item_F:nth-child(4) {
  314. top: calc(50% - 62px);
  315. left: calc(50% + 60px);
  316. }
  317. .gallery > .gallery-item_F:nth-child(5) {
  318. bottom: calc(50% - 62px);
  319. left: calc(50% - 60px);
  320. }
  321. .gallery > .gallery-item_F:nth-child(6) {
  322. bottom: calc(50% - 62px);
  323. left: calc(50% + 60px);
  324. }
  325. .gallery > .gallery-item_G {
  326. width: 120px;
  327. height: 120px;
  328. position: absolute;
  329. text-align: center;
  330. padding-top: 34px;
  331. background-size: 100% 100%;
  332. background-repeat: no-repeat;
  333. background-position: center;
  334. background-image: var(--image-img-4);
  335. .gallery-item__value {
  336. font-size: 20px;
  337. }
  338. }
  339. .gallery > .gallery-item_G:nth-child(2) {
  340. top: calc(50% - 60px);
  341. left: calc(50% - 60px);
  342. }
  343. .gallery > .gallery-item_G:nth-child(3) {
  344. top: calc(50% - 60px);
  345. left: calc(50% - 160px);
  346. transform: scale(0.8);
  347. }
  348. .gallery > .gallery-item_G:nth-child(4) {
  349. top: calc(50% - 60px);
  350. right: calc(50% - 160px);
  351. transform: scale(0.8);
  352. }
  353. .gallery > .gallery-item_G:nth-child(5) {
  354. top: calc(50% - 110px);
  355. left: calc(50% - 230px);
  356. transform: scale(0.7);
  357. }
  358. .gallery > .gallery-item_G:nth-child(6) {
  359. bottom: calc(50% - 110px);
  360. left: calc(50% - 230px);
  361. transform: scale(0.7);
  362. }
  363. .gallery > .gallery-item_G:nth-child(7) {
  364. top: calc(50% - 110px);
  365. right: calc(50% - 230px);
  366. transform: scale(0.7);
  367. }
  368. .gallery > .gallery-item_G:nth-child(8) {
  369. bottom: calc(50% - 110px);
  370. right: calc(50% - 230px);
  371. transform: scale(0.7);
  372. }
  373. .gallery_H {
  374. background-image: var(--image-bottom1), var(--image-center-bg);
  375. background-repeat: no-repeat, no-repeat;
  376. background-size:
  377. auto 90%,
  378. auto 90%;
  379. background-position: center, center;
  380. position: relative;
  381. }
  382. .gallery > .gallery-item_H {
  383. width: 100px;
  384. height: 70px;
  385. display: flex;
  386. position: absolute;
  387. text-align: center;
  388. justify-content: space-evenly;
  389. background-repeat: no-repeat;
  390. }
  391. .gallery > .gallery-item_H:nth-child(2) {
  392. top: 0%;
  393. left: calc(50% - 150px);
  394. width: 300px;
  395. height: 200px;
  396. padding-top: 50px;
  397. background-image: var(--image-warning-icon-bg1), var(--image-warning-icon-bg-a1);
  398. background-size:
  399. auto 100%,
  400. auto 46%;
  401. background-position:
  402. center top,
  403. center 28%;
  404. display: block;
  405. }
  406. .gallery > .gallery-item_H:nth-child(3) {
  407. top: calc(50% - 60px);
  408. left: calc(50% - 170px);
  409. background-image: var(--image-data-bg), var(--image-icon-vent), var(--image-icon-bg);
  410. background-size:
  411. 100% auto,
  412. auto 46%,
  413. 50% 20%;
  414. background-position:
  415. center top,
  416. center 80%,
  417. center bottom;
  418. }
  419. .gallery > .gallery-item_H:nth-child(4) {
  420. top: calc(50% + 10px);
  421. left: calc(50% - 170px);
  422. background-image: var(--image-data-bg), var(--image-icon-device), var(--image-icon-bg);
  423. background-size:
  424. 100% auto,
  425. auto 46%,
  426. 50% 20%;
  427. background-position:
  428. center top,
  429. center 80%,
  430. center bottom;
  431. }
  432. .gallery > .gallery-item_H:nth-child(5) {
  433. top: calc(50% - 60px);
  434. right: calc(50% - 170px);
  435. background-image: var(--image-data-bg), var(--image-icon-dust), var(--image-icon-bg);
  436. background-size:
  437. 100% auto,
  438. auto 46%,
  439. 50% 20%;
  440. background-position:
  441. center top,
  442. center 80%,
  443. center bottom;
  444. }
  445. .gallery > .gallery-item_H:nth-child(6) {
  446. top: calc(50% + 10px);
  447. right: calc(50% - 170px);
  448. background-image: var(--image-data-bg), var(--image-icon-gas), var(--image-icon-bg);
  449. background-size:
  450. 100% auto,
  451. auto 46%,
  452. 50% 20%;
  453. background-position:
  454. center top,
  455. center 80%,
  456. center bottom;
  457. }
  458. .gallery > .gallery-item_I {
  459. width: 120px;
  460. height: 30px;
  461. position: absolute;
  462. background-size: 100% auto;
  463. background-repeat: no-repeat;
  464. background-position: bottom;
  465. background-image: var(--image-gallery_I_2);
  466. display: flex;
  467. justify-content: space-between;
  468. align-items: center;
  469. padding: 0 10px;
  470. .gallery-item__value {
  471. font-size: 20px;
  472. }
  473. }
  474. .gallery > .gallery-item_I:nth-child(2) {
  475. top: calc(50% - 51px);
  476. left: calc(50% - 200px);
  477. width: 110px;
  478. height: 102px;
  479. line-height: 102px;
  480. padding: 0;
  481. background-image: var(--image-gallery_I_1);
  482. .gallery-item__label {
  483. display: none;
  484. }
  485. .gallery-item__value {
  486. width: 100%;
  487. text-align: center;
  488. font-size: 24px;
  489. }
  490. }
  491. .gallery > .gallery-item_I:nth-child(3) {
  492. top: calc(50% - 35px);
  493. left: calc(50% - 70px);
  494. }
  495. .gallery > .gallery-item_I:nth-child(4) {
  496. top: calc(50% - 35px);
  497. left: calc(50% + 70px);
  498. }
  499. .gallery > .gallery-item_I:nth-child(5) {
  500. bottom: calc(50% - 35px);
  501. left: calc(50% - 70px);
  502. }
  503. .gallery > .gallery-item_I:nth-child(6) {
  504. bottom: calc(50% - 35px);
  505. left: calc(50% + 70px);
  506. }
  507. .gallery-item__value_red {
  508. color: red;
  509. }
  510. .gallery-item__value_orange {
  511. color: orange;
  512. }
  513. .gallery-item__value_yellow {
  514. color: yellow;
  515. }
  516. .gallery-item__value_green {
  517. color: yellowgreen;
  518. }
  519. .gallery-item__value_blue {
  520. color: @vent-table-action-link;
  521. }
  522. .gallery-item__value_white {
  523. color: white;
  524. }
  525. .gallery-item__value_lightblue {
  526. color: @vent-configurable-home-light-border;
  527. }
  528. </style>