MiniBoard-FireNew.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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 === 'new-top'">
  5. <slot name="label">
  6. <div class="mini-board__label" :class="`mini-board__label_${type}`">{{ label }}</div>
  7. </slot>
  8. <slot name="value">
  9. <div class="mini-board__value" :class="`mini-board__value_${type}`">{{ value }}</div>
  10. </slot>
  11. </template>
  12. <template v-if="layout === 'val-top'">
  13. <slot name="value">
  14. <div class="mini-board__value" :class="`mini-board__value_${type}`">
  15. {{ value }}
  16. </div>
  17. </slot>
  18. <slot name="label">
  19. <div class="mini-board__label" :class="`mini-board__label_${type}`">
  20. {{ label }}
  21. </div>
  22. </slot>
  23. </template>
  24. <template v-if="layout === 'label-top'">
  25. <slot name="label">
  26. <div class="mini-board__label" :class="`mini-board__label_${type}`">
  27. {{ label }}
  28. </div>
  29. </slot>
  30. <slot name="value">
  31. <div class="mini-board__value" :class="`mini-board__value_${type}`">
  32. {{ value }}
  33. </div>
  34. </slot>
  35. </template>
  36. </div>
  37. </template>
  38. <script lang="ts" setup>
  39. withDefaults(
  40. defineProps<{
  41. label: string;
  42. value?: string;
  43. // 告示牌布局,类型为:'val-top' | 'label-top'
  44. layout: string;
  45. // 告示牌类型,类型为:'A' | 'B' | 'C' | 'D' | 'E' | 'F' |'New' | 'localFannew'
  46. type?: string;
  47. }>(),
  48. {
  49. value: '/',
  50. type: 'A',
  51. layout: 'val-top',
  52. }
  53. );
  54. // 获取某些 value 对应的特殊的 装饰用的类名
  55. function getValueDecoClass(value) {
  56. switch (value) {
  57. case '低风险':
  58. return 'low_risk';
  59. case '一般风险':
  60. return 'risk';
  61. case '较大风险':
  62. return 'high_risk';
  63. case '报警':
  64. return 'warning';
  65. default:
  66. return '';
  67. }
  68. }
  69. defineEmits(['click']);
  70. </script>
  71. <style lang="less" scoped>
  72. @import '/@/design/theme.less';
  73. @import '/@/design/theme.less';
  74. @font-face {
  75. font-family: 'douyuFont';
  76. src: url('/@/assets/font/douyuFont.otf');
  77. }
  78. @{theme-deepblue} {
  79. .mini-board {
  80. --image-areaNew: url('/@/assets/images/fireNew/6-1.png');
  81. --image-areaNew1: url('/@/assets/images/fireNew/6-2.png');
  82. --image-areaNew2: url('/@/assets/images/fireNew/8.png');
  83. }
  84. }
  85. .mini-board {
  86. --image-areaNew: url('/@/assets/images/fireNew/6-1.png');
  87. --image-areaNew1: url('/@/assets/images/fireNew/6-2.png');
  88. --image-areaNew2: url('/@/assets/images/fireNew/8.png');
  89. height: 50px;
  90. line-height: 25px;
  91. width: 130px;
  92. padding: 0 5px 0 5px;
  93. text-align: center;
  94. background-size: 100% 100%;
  95. position: relative;
  96. }
  97. .mini-board_H {
  98. width: 174px;
  99. height: 104px;
  100. background-image: var(--image-areaNew);
  101. background-size: 100% auto;
  102. background-position: center bottom;
  103. background-repeat: no-repeat;
  104. padding: 33px 0 0 82px;
  105. }
  106. .mini-board__value_H {
  107. font-size: 16px;
  108. font-weight: bold;
  109. height: 23px;
  110. line-height: 50px;
  111. margin-top: 2px;
  112. font-family: 'douyuFont';
  113. }
  114. .mini-board__label_H {
  115. line-height: 20px;
  116. height: 20px;
  117. }
  118. .mini-board_E:nth-child(1) {
  119. .mini-board__label_E {
  120. background-image: var(--image-hycd);
  121. }
  122. }
  123. .mini-board_E:nth-child(2) {
  124. .mini-board__label_E {
  125. background-image: var(--image-dyfl);
  126. }
  127. }
  128. .mini-board_E:nth-child(3) {
  129. .mini-board__label_E {
  130. background-image: var(--image-jdjl);
  131. }
  132. }
  133. .mini-board_H_low_risk:nth-child(1) {
  134. background-image: var(--image-areaNew);
  135. }
  136. .mini-board_H_low_risk:nth-child(2) {
  137. background-image: var(--image-areaNew1);
  138. }
  139. .mini-board_F {
  140. width: 100px;
  141. height: 60px;
  142. background-image: var(--image-areaNew2);
  143. background-size: 100% 100%;
  144. background-position: center bottom;
  145. background-repeat: no-repeat;
  146. }
  147. .mini-board__value_F {
  148. font-size: 15px;
  149. color: @vent-gas-primary-text;
  150. }
  151. .mini-board__label_F {
  152. line-height: 17px;
  153. }
  154. </style>