MiniBoard.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <!-- eslint-disable vue/multi-word-component-names -->
  2. <template>
  3. <div class="mini-board" :class="`mini-board_${type}`">
  4. <template v-if="layout === 'val-top'">
  5. <slot name="value">
  6. <div class="mini-board__value" :class="`mini-board__value_${type}`">
  7. {{ value }}
  8. </div>
  9. </slot>
  10. <slot name="label">
  11. <div class="mini-board__label" :class="`mini-board__label_${type}`">
  12. {{ label }}
  13. </div>
  14. </slot>
  15. </template>
  16. <template v-if="layout === 'label-top'">
  17. <slot name="label">
  18. <div class="mini-board__label" :class="`mini-board__label_${type}`">
  19. {{ label }}
  20. </div>
  21. </slot>
  22. <slot name="value">
  23. <div class="mini-board__value" :class="`mini-board__value_${type}`">
  24. {{ value }}
  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. // 告示牌布局,类型为:'val-top' | 'label-top'
  36. layout: string;
  37. // 告示牌类型,类型为:'A' | 'B' | 'C' | 'D'
  38. type?: string;
  39. }>(),
  40. {
  41. value: '/',
  42. type: 'A',
  43. layout: 'val-top',
  44. }
  45. );
  46. defineEmits(['click']);
  47. </script>
  48. <style lang="less" scoped>
  49. @import '@/design/vent/color.less';
  50. .mini-board {
  51. height: 50px;
  52. line-height: 25px;
  53. width: 130px;
  54. padding: 0 5px 0 5px;
  55. // box-sizing: border-box;
  56. text-align: center;
  57. background-size: 100% 100%;
  58. position: relative;
  59. }
  60. .mini-board_A {
  61. width: 120px;
  62. height: 60px;
  63. background-image: url('@/assets/images/company/area3.png');
  64. background-size: 100% 100%;
  65. }
  66. .mini-board_B {
  67. width: 131px;
  68. height: 64px;
  69. background-image: url('@/assets/images/vent/value-bg.png');
  70. background-size: 100% auto;
  71. background-position: center bottom;
  72. background-repeat: no-repeat;
  73. }
  74. .mini-board_C {
  75. width: 121px;
  76. height: 69px;
  77. background-image: url('@/assets/images/vent/vent-param-bg.png');
  78. }
  79. .mini-board_D {
  80. width: 105px;
  81. height: 58px;
  82. background-image: url('@/assets/images/vent/home/mini-board-1.png');
  83. background-position: center bottom;
  84. background-repeat: no-repeat;
  85. }
  86. .mini-board__value_A {
  87. color: @vent-gas-primary-text;
  88. font-size: 20px;
  89. font-weight: bold;
  90. height: 30px;
  91. line-height: 30px;
  92. }
  93. // .mini-board__label_A {
  94. // }
  95. .mini-board__value_B {
  96. color: @vent-gas-primary-text;
  97. font-size: 20px;
  98. font-weight: bold;
  99. height: 40px;
  100. line-height: 40px;
  101. }
  102. .mini-board__label_B {
  103. line-height: 24px;
  104. height: 24px;
  105. }
  106. .mini-board__value_C {
  107. color: @vent-gas-primary-text;
  108. height: 40px;
  109. line-height: 40px;
  110. font-size: 20px;
  111. font-weight: bold;
  112. }
  113. // .mini-board__label_C {
  114. // }
  115. .mini-board__value_D {
  116. font-size: 20px;
  117. font-weight: bold;
  118. height: 40px;
  119. line-height: 40px;
  120. }
  121. .mini-board__label_D {
  122. line-height: 17px;
  123. height: 17px;
  124. }
  125. </style>