CustomList-fire.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  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="`customlist${i}`" class="flex items-center" :class="`list-item_${type}`">
  10. <!-- 列表项前面的图标 -->
  11. <div v-if="type === 'I'" :class="`list-item__icon list-item__icon_${type}`" :style="{ backgroundImage: `url(${getIconPath(item)})` }"> </div>
  12. <div v-else-if="type === 'H'" :class="`list-item__icon list-item__icon_${type}`" :style="{ backgroundImage: `url(${getIconPath1(item)})` }">
  13. </div>
  14. <!-- 列表项的具体内容填充剩余宽度 -->
  15. <div class="flex-grow" :class="`list-item__content_${type}`">
  16. <div class="list-item__label" v-if="type !== 'I'">{{ item.label }}</div>
  17. <div class="list-item__info" :class="`list-item__info_${item.color}`">{{ item.info }}</div>
  18. <div class="list-item__value" :class="`list-item__value_${item.color} list-item__value_${type}`">{{ item.value }}</div>
  19. </div>
  20. </div>
  21. </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. info: string;
  32. }[];
  33. /** A B C D E F G */
  34. type: string;
  35. }>(),
  36. {
  37. listConfig: () => [],
  38. type: 'A',
  39. }
  40. );
  41. // function getIconPath(item) {
  42. // // 根据item.iconType返回对应图标路径
  43. // return require(`@/assets/images/fireNew/${item.label}.svg`);
  44. // }
  45. function getIconPath(item) {
  46. return new URL(`/src/assets/images/fireNew/${item.label}.png`, import.meta.url).href;
  47. }
  48. function getIconPath1(item) {
  49. switch (item.label) {
  50. case '光纤预警':
  51. return new URL('/src/assets/images/fireNew/9-3.png', import.meta.url).href;
  52. case '温度预警':
  53. return new URL('/src/assets/images/fireNew/9-3.png', import.meta.url).href;
  54. case '一氧化碳预警':
  55. return new URL('/src/assets/images/fireNew/9-4.png', import.meta.url).href;
  56. case '烟雾预警':
  57. return new URL('/src/assets/images/fireNew/9-5.png', import.meta.url).href;
  58. case '火焰预警':
  59. return new URL('/src/assets/images/fireNew/9-6.png', import.meta.url).href;
  60. default:
  61. return new URL('', import.meta.url).href;
  62. }
  63. }
  64. // defineEmits(['click']);
  65. </script>
  66. <style lang="less" scoped>
  67. @import '/@/design/theme.less';
  68. @import '/@/design/theme.less';
  69. /* Timeline 相关的样式 */
  70. @{theme-deepblue} {
  71. .list {
  72. --image-list_bg_default: url(/@/assets/images/themify/deepblue/home-container/configurable/list_bg_default.png);
  73. --image-triangle_icon: url(/@/assets/images/themify/deepblue/home-container/configurable/triangle_icon.png);
  74. --image-list_bg_b: url(/@/assets/images/themify/deepblue/home-container/configurable/list_bg_b.png);
  75. --image-deco_1: url(/@/assets/images/themify/deepblue/home-container/configurable/deco_1.png);
  76. --image-list_bg_c: url(/@/assets/images/themify/deepblue/home-container/configurable/list_bg_c.png);
  77. --image-list_bg_defflip: url(/@/assets/images/themify/deepblue/home-container/configurable/list_bg_defflip.png);
  78. --image-list_bg_d: url(/@/assets/images/themify/deepblue/home-container/configurable/list_bg_d.png);
  79. --image-list_bg_e: url(/@/assets/images/themify/deepblue/home-container/configurable/list_bg_e.png);
  80. --image-list: url(/@/assets/images/themify/deepblue/home-container/configurable/firehome/list.png);
  81. --image-list_bg_h: url('/@/assets/images/fireNew/9-1.png');
  82. --image-list_bg_h1: url('/@/assets/images/fireNew/9-2.png');
  83. --image-list_bg_i: url('/@/assets/images/fireNew/10-1.png');
  84. --image-list_bg_i1: url('/@/assets/images/fireNew/10-2.png');
  85. }
  86. }
  87. .list {
  88. --image-list_bg_default: url(/@/assets/images/home-container/configurable/list_bg_default.png);
  89. --image-triangle_icon: url(/@/assets/images/home-container/configurable/triangle_icon.png);
  90. --image-list_bg_b: url(/@/assets/images/home-container/configurable/list_bg_b.png);
  91. --image-deco_1: url(/@/assets/images/home-container/configurable/deco_1.png);
  92. --image-list_bg_c: url(/@/assets/images/home-container/configurable/list_bg_c.png);
  93. --image-list_bg_defflip: url(/@/assets/images/home-container/configurable/list_bg_defflip.png);
  94. --image-list_bg_d: url(/@/assets/images/home-container/configurable/list_bg_d.png);
  95. --image-list_bg_e: url(/@/assets/images/home-container/configurable/list_bg_e.png);
  96. --image-list: url(/@/assets/images/home-container/configurable/firehome/list.png);
  97. --image-list_bg_h: url('/@/assets/images/fireNew/9-1.png');
  98. --image-list_bg_h1: url('/@/assets/images/fireNew/9-2.png');
  99. --image-list_bg_i: url('/@/assets/images/fireNew/10-1.png');
  100. --image-list_bg_i1: url('/@/assets/images/fireNew/10-2.png');
  101. --image-list_bg_j: url('/@/assets/images/home-container/configurable/list_bg_j.png');
  102. --image-linear-gradient-3: linear-gradient(to right, #39deff15, #3977e500);
  103. padding: 5px 20px;
  104. position: relative;
  105. background-repeat: no-repeat;
  106. width: 100%;
  107. height: 100%;
  108. background-size: 100% 100%;
  109. background-image: var(--image-list_bg_default);
  110. }
  111. .list_A {
  112. padding-left: 5px;
  113. }
  114. .list-item__content_A {
  115. background-repeat: no-repeat;
  116. background-image: @vent-gas-list-item-bg-img;
  117. // padding: 5px 10px;
  118. display: flex;
  119. }
  120. .list-item__icon_A {
  121. background-repeat: no-repeat;
  122. width: 25px;
  123. height: 29px;
  124. background-image: var(--image-triangle_icon);
  125. }
  126. .list-item__content_B {
  127. background-repeat: no-repeat;
  128. padding: 5px 10px 10px 10px;
  129. display: flex;
  130. background-position: left bottom;
  131. background-size: 100% auto;
  132. background-image: var(--image-list_bg_b);
  133. }
  134. .list__image_B {
  135. width: 77px;
  136. height: 77px;
  137. background-repeat: no-repeat;
  138. background-image: var(--image-deco_1);
  139. background-size: auto;
  140. margin-right: 20px;
  141. }
  142. .list_C {
  143. background: none;
  144. }
  145. .list-item__content_C {
  146. height: 60px;
  147. background-repeat: no-repeat;
  148. padding: 25px 50px 0 50px;
  149. display: flex;
  150. background-position: center;
  151. background-size: 100% 100%;
  152. background-image: var(--image-list_bg_c);
  153. margin-bottom: 10px;
  154. text-align: center;
  155. }
  156. .list-item__content_C > div {
  157. flex-basis: 33.3%;
  158. }
  159. .list_D {
  160. background-image: var(--image-list_bg_defflip);
  161. }
  162. .list__wrapper_D {
  163. display: flex;
  164. flex-wrap: wrap;
  165. }
  166. .list-item__icon_D {
  167. display: none;
  168. }
  169. .list-item_D {
  170. flex-basis: 25%;
  171. height: 60px;
  172. background-repeat: no-repeat;
  173. background-position: center;
  174. background-size: auto 100%;
  175. background-image: var(--image-list_bg_d);
  176. text-align: center;
  177. margin-bottom: 10px;
  178. }
  179. .list-item__content_D {
  180. line-height: 30px;
  181. }
  182. .list-item__value_D {
  183. font-weight: bold;
  184. }
  185. .list_E {
  186. background-image: var(--image-list_bg_defflip);
  187. }
  188. .list__wrapper_E {
  189. display: flex;
  190. flex-wrap: wrap;
  191. }
  192. .list-item__icon_E {
  193. display: none;
  194. }
  195. .list-item_E {
  196. flex-basis: 25%;
  197. height: 70px;
  198. background-repeat: no-repeat;
  199. background-position: center;
  200. background-size: auto 100%;
  201. background-image: var(--image-list_bg_e);
  202. text-align: center;
  203. margin: 5px 0px;
  204. padding-top: 32px;
  205. font-size: 12px;
  206. }
  207. .list_F {
  208. background: none;
  209. }
  210. .list-item__content_F {
  211. height: 40px;
  212. background-repeat: no-repeat;
  213. padding: 0 50px 0 50px;
  214. display: flex;
  215. background-position: center;
  216. background-size: 100% auto;
  217. background-image: var(--image-list);
  218. margin-top: 10px;
  219. text-align: center;
  220. }
  221. .list-item__content_F > div {
  222. flex-basis: 33.3%;
  223. }
  224. .list_G {
  225. background: none;
  226. }
  227. .list__wrapper_G {
  228. display: flex;
  229. flex-wrap: wrap;
  230. justify-content: space-between;
  231. }
  232. .list-item_G {
  233. width: 130px;
  234. height: 80px;
  235. align-items: center;
  236. text-align: center;
  237. border: 1px solid rgba(25, 237, 255, 0.4);
  238. box-shadow: inset 0 0 10px rgba(0, 197, 255, 0.6);
  239. background: rgba(0, 0, 0, 0.1);
  240. margin: 5px 10px;
  241. }
  242. .list-item__content_G {
  243. position: relative;
  244. width: 100%;
  245. height: 100%;
  246. }
  247. .list-item__content_G > .list-item__label {
  248. width: 60px;
  249. height: 100%;
  250. left: 0;
  251. position: absolute;
  252. font-size: 20px;
  253. line-height: 80px;
  254. }
  255. .list-item__content_G > .list-item__info {
  256. width: 70px;
  257. height: 30px;
  258. line-height: 30px;
  259. right: 0;
  260. position: absolute;
  261. }
  262. .list-item__content_G > .list-item__value {
  263. width: 70px;
  264. height: 50px;
  265. line-height: 50px;
  266. top: 30px;
  267. right: 0;
  268. position: absolute;
  269. text-shadow: 0 0 25px #00fbfe;
  270. background: linear-gradient(0deg, #45d3fd, #45d3fd, #61ddb1, #61ddb1);
  271. font-style: normal;
  272. background-size: cover;
  273. font-family: electronicFont;
  274. font-size: 30px;
  275. -webkit-background-clip: text;
  276. background-clip: text;
  277. -webkit-text-fill-color: transparent;
  278. font-family: Arial, Helvetica, sans-serif;
  279. font-size: 18px;
  280. color: aliceblue;
  281. }
  282. .list_H {
  283. background: none;
  284. padding-bottom: 60px;
  285. }
  286. .list-item__icon_H {
  287. width: 15px;
  288. height: 15px;
  289. margin-left: 12px;
  290. background-size: 100% 100%;
  291. }
  292. .list-item_H {
  293. align-items: center;
  294. text-align: center;
  295. margin: 5px 10px;
  296. &:nth-child(2n) {
  297. background-repeat: no-repeat;
  298. background-size: 100% 100%;
  299. background-image: var(--image-list_bg_h);
  300. }
  301. &:nth-child(2n + 1) {
  302. background-repeat: no-repeat;
  303. background-size: 100% 100%;
  304. background-image: var(--image-list_bg_h1);
  305. }
  306. }
  307. .list-item__content_H {
  308. height: 40px;
  309. display: flex;
  310. align-items: center;
  311. width: 100%;
  312. line-height: 68px;
  313. }
  314. .list-item__content_H > div {
  315. flex-basis: 33%;
  316. }
  317. .list-item__content_H > .list-item__label {
  318. flex-basis: 33%;
  319. }
  320. .list-item__content_H > .list-item__info {
  321. flex-basis: 22%;
  322. }
  323. .list-item__content_H > .list-item__value {
  324. flex-basis: 45%;
  325. }
  326. .list-item__value_H {
  327. font-size: 16px;
  328. font-weight: bold;
  329. color: #bbffff;
  330. }
  331. .list_fireList {
  332. background: none;
  333. }
  334. .list__wrapper_fireList {
  335. display: flex;
  336. flex-wrap: wrap;
  337. justify-content: flex-start;
  338. margin-left: 86px;
  339. }
  340. .list-item_fireList {
  341. width: 167px;
  342. height: 58px;
  343. align-items: center;
  344. text-align: center;
  345. background-image: var(--image-list_bg_i);
  346. background-repeat: no-repeat;
  347. background-size: auto 100%;
  348. margin: 5px 10px;
  349. }
  350. .list-item__content_fireList {
  351. position: relative;
  352. width: 100%;
  353. height: 100%;
  354. }
  355. .list-item__content_fireList > .list-item__label {
  356. width: 60px;
  357. height: 100%;
  358. left: 0;
  359. position: absolute;
  360. font-size: 20px;
  361. line-height: 63px;
  362. color: #009bff;
  363. }
  364. .list-item__content_fireList > .list-item__info {
  365. height: 50%;
  366. left: 70px;
  367. position: absolute;
  368. }
  369. .list-item__content_fireList > .list-item__value {
  370. top: 50%;
  371. height: 50%;
  372. left: 70px;
  373. position: absolute;
  374. font-size: 18px;
  375. }
  376. .list_I {
  377. background: none;
  378. }
  379. .list__wrapper_I {
  380. display: flex;
  381. flex-wrap: wrap;
  382. justify-content: space-between;
  383. }
  384. .list-item__icon_I {
  385. background-repeat: no-repeat;
  386. width: 50px;
  387. height: 20px;
  388. margin-left: 6px;
  389. }
  390. .list-item_I {
  391. width: 230px;
  392. height: 35px;
  393. align-items: center;
  394. text-align: center;
  395. margin: 15px 20px;
  396. /* 背景组合A(1,4,5,8) */
  397. &:nth-child(1),
  398. &:nth-child(4),
  399. &:nth-child(5),
  400. &:nth-child(8) {
  401. background-image: var(--image-list_bg_i1);
  402. background-repeat: no-repeat;
  403. background-size: 100% 100%;
  404. }
  405. /* 背景组合B(2,3,6,7) */
  406. &:nth-child(2),
  407. &:nth-child(3),
  408. &:nth-child(6),
  409. &:nth-child(7) {
  410. background-image: var(--image-list_bg_i);
  411. background-repeat: no-repeat;
  412. background-size: 100% 100%;
  413. }
  414. }
  415. .list-item__content_I {
  416. width: 100%;
  417. display: flex;
  418. }
  419. .list-item__content_I > .list-item__info {
  420. font-size: 15px;
  421. font-weight: bold;
  422. color: #ddd;
  423. flex-basis: 60%;
  424. }
  425. .list-item__content_I > .list-item__value {
  426. font-size: 15px;
  427. font-weight: bold;
  428. flex-basis: 30%;
  429. }
  430. .list_J {
  431. background: unset;
  432. padding: 0 5px 0 10px;
  433. }
  434. .list-item_J {
  435. width: 312px;
  436. height: 57px;
  437. align-items: center;
  438. text-align: center;
  439. background-image: var(--image-list_bg_j);
  440. background-repeat: no-repeat;
  441. background-size: auto 100%;
  442. margin: 5px 10px;
  443. }
  444. .list-item__content_J {
  445. display: flex;
  446. justify-content: space-between;
  447. align-items: center;
  448. padding: 0 20px 0 15px;
  449. }
  450. .list_K {
  451. background: unset;
  452. padding: 0 5px 0 10px;
  453. }
  454. .list__wrapper_K {
  455. height: 100%;
  456. }
  457. .list-item__content_K {
  458. display: flex;
  459. justify-content: space-between;
  460. align-items: center;
  461. padding: 5px;
  462. margin: 4px 0;
  463. background-image: var(--image-linear-gradient-3);
  464. .list-item__value {
  465. flex-basis: unset;
  466. }
  467. .list-item__label {
  468. flex-basis: unset;
  469. }
  470. .list-item__info {
  471. display: none;
  472. }
  473. }
  474. .list-item__label {
  475. flex-basis: 55%;
  476. }
  477. .list-item__info {
  478. flex-grow: 1;
  479. }
  480. .list-item__value {
  481. flex-basis: 30%;
  482. }
  483. .list-item__value_red {
  484. color: red;
  485. }
  486. .list-item__value_orange {
  487. color: orange;
  488. }
  489. .list-item__value_yellow {
  490. color: yellow;
  491. }
  492. .list-item__value_green {
  493. color: yellowgreen;
  494. }
  495. .list-item__value_blue {
  496. color: @vent-table-action-link;
  497. }
  498. .list-item__value_white {
  499. color: white;
  500. }
  501. .gallery-item__value_lightblue {
  502. color: @vent-configurable-home-light-border;
  503. }
  504. </style>