DangerInvestigation.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <template>
  2. <div class="danger-investigation">
  3. <div class="title">
  4. <span class="line"></span>
  5. <span class="text">隐患的排查与治理</span>
  6. </div>
  7. <div class="danger-investigation__content">
  8. <div class="content-item" :class="item.type" v-for="item in itemList" :key="item.name">
  9. <span class="name">{{ item.name }}</span>
  10. <span class="value">{{ item.value }}</span>
  11. </div>
  12. </div>
  13. </div>
  14. </template>
  15. <script setup lang="ts">
  16. import { computed, onMounted, ref } from 'vue';
  17. const hiddenDangerCount = ref<number>(0);
  18. const rectificationCount = ref<number>(0);
  19. const closedCount = ref<number>(0);
  20. const itemList = computed(() => [
  21. { name: '隐患数', value: hiddenDangerCount.value, type: 'error' },
  22. { name: '整改数', value: rectificationCount.value, type: 'warning' },
  23. { name: '闭环', value: closedCount.value, type: 'success' },
  24. ]);
  25. onMounted(() => {
  26. hiddenDangerCount.value = 124;
  27. rectificationCount.value = 0;
  28. closedCount.value = 124;
  29. });
  30. </script>
  31. <style scoped lang="scss">
  32. .title {
  33. display: flex;
  34. align-items: center;
  35. gap: 10px;
  36. margin-bottom: 16px;
  37. .line {
  38. width: 3px;
  39. height: 16px;
  40. background: #1777ff;
  41. }
  42. .text {
  43. font-weight: 500;
  44. font-size: 16px;
  45. color: #000000;
  46. line-height: 22px;
  47. }
  48. }
  49. .danger-investigation__content {
  50. display: flex;
  51. align-items: center;
  52. justify-content: center;
  53. gap: 9px;
  54. padding: 0 12px;
  55. .content-item {
  56. width: 96px;
  57. height: 92px;
  58. border-radius: 0px 4px 4px 0px;
  59. padding: 19px 22px;
  60. display: flex;
  61. flex-direction: column;
  62. gap: 8px;
  63. .name {
  64. font-weight: 400;
  65. font-size: 14px;
  66. color: #666666;
  67. line-height: 20px;
  68. }
  69. .value {
  70. font-family: DINAlternate;
  71. font-weight: 600;
  72. font-size: 22px;
  73. line-height: 26px;
  74. }
  75. }
  76. .error {
  77. border-left: 3px solid #ff0000;
  78. background: linear-gradient(180deg, rgba(255, 77, 79, 0.15) 0%, rgba(255, 77, 79, 0.3) 100%);
  79. .value {
  80. color: #ff0000;
  81. }
  82. }
  83. .warning {
  84. border-left: 3px solid #ffd300;
  85. background: linear-gradient(180deg, rgba(250, 173, 20, 0.15) 0%, rgba(250, 173, 20, 0.3) 100%);
  86. .value {
  87. color: #cdaa00;
  88. }
  89. }
  90. .success {
  91. border-left: 3px solid #1777ff;
  92. background: linear-gradient(180deg, rgba(227, 239, 255, 0.4) 0%, rgba(185, 209, 255, 0.38) 100%);
  93. .value {
  94. color: #1777ff;
  95. }
  96. }
  97. }
  98. </style>