DangerInvestigation.vue 2.7 KB

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