MiniBoard-Warn.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  1. <!-- eslint-disable vue/multi-word-component-names -->
  2. <template>
  3. <div class="mini-board" :class="`mini-board_${type} mini-board_${type}_${getValueDecoClass(value)}`">
  4. <template v-if="layout === 'val-top'">
  5. <slot name="label">
  6. <div class="mini-board__label" :class="`mini-board__label_${type}`">
  7. {{ dw ? `${label}${dw}` : label }}
  8. </div>
  9. </slot>
  10. <slot name="value">
  11. <div class="mini-board__value" :class="`mini-board__value_${type}`">
  12. {{ value }}
  13. </div>
  14. </slot>
  15. </template>
  16. <template v-if="layout === 'label-top'">
  17. <slot name="value">
  18. <div class="mini-board__value" :class="`mini-board__value_${type}`">
  19. {{ value }}
  20. </div>
  21. </slot>
  22. <slot name="label">
  23. <div class="mini-board__label" :class="`mini-board__label_${type}`">
  24. {{ label }}
  25. </div>
  26. </slot>
  27. </template>
  28. </div>
  29. </template>
  30. <script lang="ts" setup>
  31. withDefaults(
  32. defineProps<{
  33. label: string;
  34. value?: string;
  35. dw?: string;
  36. // 告示牌布局,类型为:'val-top' | 'label-top'
  37. layout: string;
  38. // 告示牌类型,类型为:'A' | 'B' | 'C' | 'D' | 'E' | 'F'
  39. type?: string;
  40. }>(),
  41. {
  42. value: '/',
  43. type: 'A',
  44. layout: 'val-top',
  45. }
  46. );
  47. // 获取某些 value 对应的特殊的 装饰用的类名
  48. function getValueDecoClass(value) {
  49. switch (value) {
  50. case '低风险':
  51. return 'low_risk';
  52. case '一般风险':
  53. return 'normal_risk';
  54. case '较大风险':
  55. return 'high_risk';
  56. case '重大风险':
  57. return 'higher_risk';
  58. case '报警':
  59. return 'warning';
  60. default:
  61. return '';
  62. }
  63. }
  64. defineEmits(['click']);
  65. </script>
  66. <style lang="less" scoped>
  67. @import '/@/design/theme.less';
  68. @import '/@/design/theme.less';
  69. @{theme-deepblue} {
  70. .mini-board {
  71. --image-area3: url('/@/assets/images/themify/deepblue/company/area3.png');
  72. // --image-value-bg: url('/@/assets/images/themify/deepblue/vent/value-bg.png');
  73. --image-vent-param-bg: url('/@/assets/images/themify/deepblue/vent/vent-param-bg.png');
  74. // --image-mini-board-1: url('/@/assets/images/themify/deepblue/vent/home/mini-board-1.png');
  75. --image-mini-board-1: url('/@/assets/images/themify/deepblue/vent/home/mini-board-1.png');
  76. --image-board_bg_1: url('/@/assets/images/themify/deepblue/home-container/configurable/board_bg_1.png');
  77. --image-miehuo: url('/@/assets/images/themify/deepblue/home-container/configurable/firehome/miehuo.png');
  78. --image-value-bg-2: url('/@/assets/images/themify/deepblue/vent/value-bg-2.png');
  79. --image-board_bg_3: url('/@/assets/images/themify/deepblue/home-container/configurable/board_bg_3.png');
  80. --image-board_bg_2: url('/@/assets/images/themify/deepblue/home-container/configurable/board_bg_2.png');
  81. --image-board_bg_5: url('/@/assets/images/themify/deepblue/home-container/configurable/board_bg_5.png');
  82. --image-board_bg_4: url('/@/assets/images/themify/deepblue/home-container/configurable/board_bg_4.png');
  83. }
  84. }
  85. .mini-board {
  86. --image-area3: url('/@/assets/images/company/area3.png');
  87. // --image-value-bg: url('/@/assets/images/vent/value-bg.png');
  88. --image-value-bg: url('/@/assets/images/home-green/green-tag.png');
  89. --image-vent-param-bg: url('/@/assets/images/vent/vent-param-bg.png');
  90. // --image-mini-board-1: url('/@/assets/images/vent/home/mini-board-1.png');
  91. --image-mini-board-1: url('/@/assets/images/home-green/green-tag.png');
  92. --image-board_bg_1: url('/@/assets/images/home-container/configurable/board_bg_1.png');
  93. --image-miehuo: url('/@/assets/images/home-container/configurable/firehome/miehuo.png');
  94. --image-value-bg-2: url('/@/assets/images/vent/value-bg-2.png');
  95. --image-board_bg_3: url('/@/assets/images/home-container/configurable/board_bg_3.png');
  96. --image-board_bg_2: url('/@/assets/images/home-container/configurable/board_bg_2.png');
  97. --image-board_bg_5: url('/@/assets/images/home-container/configurable/board_bg_5.png');
  98. --image-board_bg_4: url('/@/assets/images/home-container/configurable/board_bg_4.png');
  99. --image-board_bg_6: url('/@/assets/images/home-container/configurable/board_bg_6.png');
  100. --image-hycd: url(/@/assets/images/home-container/configurable/dusthome/hycd.png);
  101. --image-dyfl: url(/@/assets/images/home-container/configurable/dusthome/dyfl.png);
  102. --image-jdjl: url(/@/assets/images/home-container/configurable/dusthome/jdjl.png);
  103. height: 52px;
  104. line-height: 25px;
  105. width: 110px;
  106. padding: 0 5px 0 5px;
  107. text-align: center;
  108. background-size: 100% 100%;
  109. position: relative;
  110. }
  111. .mini-board_A {
  112. width: 120px;
  113. height: 60px;
  114. background-image: var(--image-area3);
  115. background-size: 100% 100%;
  116. }
  117. .mini-board_B {
  118. width: 115px;
  119. height: 50px;
  120. background-image: var(--image-value-bg);
  121. background-size: auto 40px;
  122. background-position: center bottom;
  123. background-repeat: no-repeat;
  124. background-size: 100% 100%;
  125. }
  126. .mini-board_C {
  127. width: 121px;
  128. height: 69px;
  129. background-image: var(--image-vent-param-bg);
  130. }
  131. .mini-board_D {
  132. // width: 105px;
  133. height: 50px;
  134. background-image: var(--image-mini-board-1);
  135. background-position: center bottom;
  136. background-size: 100% 100%;
  137. background-repeat: no-repeat;
  138. }
  139. .mini-board_E {
  140. width: 30%;
  141. height: 180px;
  142. padding: 20px 5px;
  143. background-image: var(--image-board_bg_1);
  144. background-position: center bottom;
  145. background-repeat: no-repeat;
  146. background-size: 100% 100%;
  147. }
  148. .mini-board_F {
  149. width: 125px;
  150. height: 70px;
  151. background-image: var(--image-miehuo);
  152. background-size: 100% 80%;
  153. background-position: center bottom;
  154. background-repeat: no-repeat;
  155. }
  156. .mini-board_G {
  157. width: 98px;
  158. height: 70px;
  159. background-image: var(--image-value-bg-2);
  160. background-size: 100% auto;
  161. background-position: center bottom;
  162. background-repeat: no-repeat;
  163. }
  164. .mini-board_H {
  165. width: 174px;
  166. height: 104px;
  167. background-image: var(--image-board_bg_3);
  168. background-size: 100% auto;
  169. background-position: center bottom;
  170. background-repeat: no-repeat;
  171. padding: 45px 0 0 0;
  172. }
  173. .mini-board_I {
  174. width: 139px;
  175. height: 67px;
  176. background-image: var(--image-board_bg_6);
  177. background-size: 100% 100%;
  178. }
  179. .mini-board_J {
  180. display: flex;
  181. flex-direction: column;
  182. align-items: center;
  183. width: 121px;
  184. height: 100%;
  185. }
  186. .mini-board_K {
  187. width: 186px;
  188. &::before {
  189. position: absolute;
  190. content: '';
  191. width: 126px;
  192. height: 74px;
  193. left: 27px;
  194. top: -15px;
  195. background: url(@/assets/images/vent/small-bg1.png) no-repeat;
  196. background-size: cover;
  197. }
  198. }
  199. .mini-board__value_A {
  200. color: @vent-gas-primary-text;
  201. font-size: 16px;
  202. font-weight: bold;
  203. height: 30px;
  204. line-height: 30px;
  205. }
  206. .mini-board__value_B {
  207. // color: @vent-gas-primary-text;
  208. color: #3ecca7;
  209. font-size: 12px;
  210. font-family: 'douyuFont';
  211. height: 28px;
  212. line-height: 28px;
  213. }
  214. .mini-board__label_B {
  215. line-height: 16px;
  216. height: 16px;
  217. font-size: 12px;
  218. }
  219. .mini-board__value_C {
  220. color: @vent-gas-primary-text;
  221. height: 40px;
  222. line-height: 40px;
  223. font-size: 20px;
  224. font-weight: bold;
  225. }
  226. .mini-board__value_D {
  227. font-size: 12px;
  228. height: 28px;
  229. line-height: 32px;
  230. color: #3ecca7;
  231. font-family: 'douyuFont';
  232. }
  233. .mini-board__label_D {
  234. line-height: 18px;
  235. height: 18px;
  236. font-size: 12px;
  237. }
  238. .mini-board__value_E {
  239. font-size: 20px;
  240. font-weight: bold;
  241. }
  242. .mini-board__label_E {
  243. line-height: 20px;
  244. height: 90px;
  245. padding-top: 30%;
  246. background-repeat: no-repeat;
  247. background-position: center top;
  248. }
  249. .mini-board__value_F {
  250. font-size: 20px;
  251. font-weight: bold;
  252. color: @vent-gas-primary-text;
  253. }
  254. .mini-board__label_F {
  255. line-height: 34px;
  256. }
  257. .mini-board__value_G {
  258. color: @vent-gas-primary-text;
  259. font-size: 20px;
  260. font-weight: bold;
  261. height: 42px;
  262. line-height: 42px;
  263. }
  264. .mini-board__label_G {
  265. line-height: 20px;
  266. height: 20px;
  267. }
  268. .mini-board_E:nth-child(1) {
  269. .mini-board__label_E {
  270. background-image: var(--image-hycd);
  271. }
  272. }
  273. .mini-board_E:nth-child(2) {
  274. .mini-board__label_E {
  275. background-image: var(--image-dyfl);
  276. }
  277. }
  278. .mini-board_E:nth-child(3) {
  279. .mini-board__label_E {
  280. background-image: var(--image-jdjl);
  281. }
  282. }
  283. .mini-board__label_J {
  284. width: 100%;
  285. padding-top: 10px;
  286. }
  287. .mini-board__value_J {
  288. position: relative;
  289. width: 102px;
  290. height: 45px;
  291. font-family: 'douyuFont';
  292. font-size: 12px;
  293. color: #3afde7;
  294. background: url('@/assets/images/home-green/100.png') no-repeat;
  295. background-size: 100% 100%;
  296. }
  297. .mini-board_U {
  298. display: flex;
  299. flex-direction: column;
  300. align-items: center;
  301. width: 121px;
  302. height: 100%;
  303. background: url('@/assets/images/home-warn/3-1.png') no-repeat;
  304. background-size: 100% 100%;
  305. }
  306. .mini-board__label_U {
  307. width: 100%;
  308. margin-bottom: 15px;
  309. }
  310. .mini-board__value_U {
  311. position: relative;
  312. width: 102px;
  313. height: 45px;
  314. font-family: 'douyuFont';
  315. font-size: 12px;
  316. color: #bbf5ff;
  317. }
  318. .mini-board__label_T {
  319. position: relative;
  320. width: 102px;
  321. height: 45px;
  322. font-size: 14px;
  323. color: #fff;
  324. z-index: 1;
  325. }
  326. .mini-board_T:nth-child(1) {
  327. .mini-board__value_T {
  328. width: 50px;
  329. height: 50px;
  330. margin: auto;
  331. background: url('@/assets/images/home-warn/7-2.png') no-repeat;
  332. background-size: 100% 100%;
  333. }
  334. }
  335. .mini-board_T:nth-child(2) {
  336. .mini-board__value_T {
  337. width: 50px;
  338. height: 50px;
  339. margin: auto;
  340. background: url('@/assets/images/home-warn/7-1.png') no-repeat;
  341. background-size: 100% 100%;
  342. }
  343. }
  344. .mini-board__value_K {
  345. font-size: 18px;
  346. font-family: 'douyuFont';
  347. color: #3afde7;
  348. text-align: center;
  349. margin-bottom: 5px;
  350. }
  351. .mini-board__label_K {
  352. width: 185px;
  353. height: 48px;
  354. text-align: center;
  355. background: url(@/assets/images/vent/plane.png) no-repeat;
  356. background-size: contain;
  357. background-position: bottom;
  358. }
  359. .mini-board_H_low_risk {
  360. background-image: var(--image-board_bg_3);
  361. }
  362. .mini-board_H_risk {
  363. background-image: var(--image-board_bg_2);
  364. }
  365. .mini-board_H_high_risk {
  366. background-image: var(--image-board_bg_5);
  367. }
  368. .mini-board_H_warning {
  369. background-image: var(--image-board_bg_4);
  370. }
  371. </style>