TopStats.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <template>
  2. <div class="top-count-card">
  3. <div v-for="(item, index) in statsData" :key="index" class="count-card">
  4. <div class="count-card-icon" :class="'icon-' + item.icon"></div>
  5. <div class="count-card-content">
  6. <div class="count-card-title">
  7. <div class="title-zh">{{ item.zh }}</div>
  8. </div>
  9. <div class="count-card-value">
  10. <div class="value">{{ item.value }}</div>
  11. <div class="unit">{{ item.unit }}</div>
  12. </div>
  13. </div>
  14. </div>
  15. </div>
  16. </template>
  17. <script setup>
  18. import { ref } from "vue"
  19. // 统计数据
  20. const statsData = ref([
  21. {
  22. icon: "xiaoshoujine",
  23. zh: "圩区监测覆盖率",
  24. value: 98.5,
  25. unit: "%"
  26. },
  27. {
  28. icon: "zongxiaoliang",
  29. zh: "河道水质达标率",
  30. value: 92.3,
  31. unit: "%"
  32. },
  33. {
  34. icon: "xiaoshoujine",
  35. zh: "出入境监测覆盖率",
  36. value: 100,
  37. unit: "%"
  38. },
  39. {
  40. icon: "zongxiaoliang",
  41. zh: "预警数量",
  42. value: 12,
  43. unit: "个"
  44. },
  45. {
  46. icon: "xiaoshoujine",
  47. zh: "处置完成率",
  48. value: 95.8,
  49. unit: "%"
  50. }
  51. ])
  52. </script>
  53. <style lang="scss">
  54. .top-count-card {
  55. position: absolute;
  56. left: 0;
  57. right: 0;
  58. top: 130px;
  59. display: flex;
  60. justify-content: center;
  61. z-index: 10;
  62. & > div {
  63. padding: 0 35px;
  64. }
  65. }
  66. .count-card {
  67. display: flex;
  68. align-items: center;
  69. padding: 10px;
  70. transform: translateY(150%);
  71. opacity: 0;
  72. &-icon {
  73. width: 48px;
  74. height: 48px;
  75. margin-right: 15px;
  76. background-repeat: no-repeat;
  77. background-position: center center;
  78. background-size: 100%;
  79. &.icon-xiaoshoujine {
  80. background-image: url("~@/assets/images/icon1.png");
  81. }
  82. &.icon-zongxiaoliang {
  83. background-image: url("~@/assets/images/icon2.png");
  84. }
  85. }
  86. &-content {
  87. display: flex;
  88. flex-direction: column;
  89. }
  90. &-title {
  91. margin-bottom: 5px;
  92. .title-zh {
  93. font-weight: bold;
  94. font-size: 16px;
  95. color: #ffffff;
  96. white-space: nowrap;
  97. }
  98. }
  99. &-value {
  100. display: flex;
  101. align-items: baseline;
  102. .value {
  103. font-family: D-DIN;
  104. font-weight: bold;
  105. font-size: 24px;
  106. color: #ffffff;
  107. letter-spacing: 1px;
  108. margin-right: 5px;
  109. text-shadow: 0px 0px 18px rgba(255, 255, 255, 0.7);
  110. white-space: nowrap;
  111. }
  112. .unit {
  113. font-weight: 500;
  114. font-size: 12px;
  115. color: #ffffff;
  116. opacity: 0.5;
  117. white-space: nowrap;
  118. }
  119. }
  120. }
  121. </style>