Browse Source

fix: update audit api and update workbench

hi-cactus! 2 years ago
parent
commit
29994caad8

+ 20 - 34
app/containers/DataGovernanceAuaitAnalysis/index.tsx

@@ -38,62 +38,48 @@ export default function DataGovernanceAuaitAnalysis(
   const [detailRange, setDetailRange] = useState<[string, string]>(['', ''])
 
   const workbench = useMemo(() => {
-    const total = reports
-      .map(
-        (item) =>
-          item.accuracyCorrect ??
-          item.accuracyError ??
-          item.integrityCorrect ??
-          item.integrityError ??
-          item.normativeCorrect ??
-          item.normativeError ??
-          item.uniformityCorrect ??
-          item.uniformityError ??
-          0
-      )
-      .reduce((c, n) => c + n, 0)
-
-    const totalCorrect = reports
-      .map(
-        (item) =>
-          item.accuracyCorrect ??
-          item.integrityCorrect ??
-          item.normativeCorrect ??
-          item.uniformityCorrect ??
-          0
-      )
-      .reduce((c, n) => c + n, 0)
-
     // 完整性
     const integrityCorrect = reports
       .map((item) => item.integrityCorrect ?? 0)
       .reduce((c, n) => c + n, 0)
-    const integrityTotal = reports
-      .map((item) => item.integrityCorrect ?? item.integrityError)
+    const integrityError = reports
+      .map((item) => item.integrityError ?? 0)
       .reduce((c, n) => c + n, 0)
+    const integrityTotal = integrityError + integrityCorrect
 
     // 一致性
     const uniformityCorrect = reports
       .map((item) => item.uniformityCorrect ?? 0)
       .reduce((c, n) => c + n, 0)
-    const uniformityTotal = reports
-      .map((item) => item.uniformityCorrect ?? item.uniformityError)
+    const uniformityError = reports
+      .map((item) => item.uniformityError ?? 0)
       .reduce((c, n) => c + n, 0)
+    const uniformityTotal = uniformityError + uniformityCorrect
 
     // 规范性
     const normativeCorrect = reports
       .map((item) => item.normativeCorrect ?? 0)
       .reduce((c, n) => c + n, 0)
-    const normativeTotal = reports
-      .map((item) => item.normativeCorrect ?? item.normativeError)
+    const normativeError = reports
+      .map((item) => item.normativeError ?? 0)
       .reduce((c, n) => c + n, 0)
+    const normativeTotal = normativeError + normativeCorrect
+
     // 准确性
     const accuracyCorrect = reports
       .map((item) => item.accuracyCorrect ?? 0)
       .reduce((c, n) => c + n, 0)
-    const accuracyTotal = reports
-      .map((item) => item.accuracyCorrect ?? item.accuracyError)
+    const accuracyError = reports
+      .map((item) => item.accuracyError ?? 0)
       .reduce((c, n) => c + n, 0)
+    const accuracyTotal = accuracyError + accuracyCorrect
+
+    const total =
+      integrityTotal + uniformityTotal + normativeTotal + accuracyTotal
+
+    const totalCorrect =
+      integrityCorrect + uniformityCorrect + normativeCorrect + accuracyCorrect
+
     return [
       {
         title: '总概率',

+ 1 - 1
app/containers/DataGovernanceQualityAudit/index.tsx

@@ -143,7 +143,7 @@ function DataGovernanceQualityAudit(
   const handleDeleteTreeItem = async (c: IClassification) => {
     try {
       setTreeLoading(true)
-      const data = await request(`${api.deleteDataRules}${c.id}`, {
+      const data = await request(`${api.deleteAuditClassification}${c.id}`, {
         method: 'DELETE'
       })
       // @ts-ignore