From 505798927f75c84693cc51becf16aa525503fc92 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期四, 11 七月 2024 17:23:38 +0800
Subject: [PATCH] 2024.7.11

---
 src/views/inspection/problem/component/ProblemSummary.vue |   36 +++++++++++++++++++++++++++++++++---
 1 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/src/views/inspection/problem/component/ProblemSummary.vue b/src/views/inspection/problem/component/ProblemSummary.vue
index 71c3684..5d75bc9 100644
--- a/src/views/inspection/problem/component/ProblemSummary.vue
+++ b/src/views/inspection/problem/component/ProblemSummary.vue
@@ -1,7 +1,9 @@
 <template>
-  <div>
-    闂鏁�: {{ summary.proNum }}锛屾暣鏀规暟: {{ summary.changeNum }}锛屾暣鏀圭巼: {{ summary.changePer }}
+  <div class="font-small">
+    浠婃棩缁熻锛氶棶棰樻暟: {{ summary.proNum }}锛屾暣鏀规暟: {{ summary.changeNum }}锛屾暣鏀圭巼:
+    {{ summary.changePer }}
   </div>
+  <div class="font-small">绐佸嚭闂锛氳矾闈㈢Н灏橈紝闂鏁帮細13锛屽崰姣旓細81%</div>
 </template>
 <script setup>
 import { computed, ref } from 'vue'
@@ -23,9 +25,37 @@
   })
 
   if (proNum > 0) {
-    changePer = Math.round((changeNum / proNum) * 100) / 100 + '%'
+    changePer = Math.round((changeNum / proNum) * 100) + '%'
   }
 
   return { proNum, changeNum, changePer }
 })
+
+const mainPro = computed(() => {
+  let res
+  let total = 0,
+    max = 0
+  props.data.forEach((d) => {
+    total += d.proNum
+  })
+  props.data.forEach((d) => {
+    if (total > 0) {
+      const per = d.proNum / total
+      if (per >= max) {
+        max = per
+        // res.push({
+        //   name: d.name,
+        //   count: d.count,
+        //   per: Math.round(per * 100) + '%'
+        // })
+        res = {
+          name: d.name,
+          count: d.count,
+          per: Math.round(per * 100) + '%'
+        }
+      }
+    }
+  })
+  return res
+})
 </script>

--
Gitblit v1.9.3