From 55bd7fb6365909a0cbcf0957333c7876bd791bb9 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期四, 21 十一月 2024 16:35:12 +0800
Subject: [PATCH] 问题整改界面 1. 优化各项状态展示效果 2. 新增左侧关键字筛选功能

---
 src/views/fysp/check/ProCheckProxy.js |  200 +++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 148 insertions(+), 52 deletions(-)

diff --git a/src/views/fysp/check/ProCheckProxy.js b/src/views/fysp/check/ProCheckProxy.js
index be0f719..533d9d6 100644
--- a/src/views/fysp/check/ProCheckProxy.js
+++ b/src/views/fysp/check/ProCheckProxy.js
@@ -1,4 +1,4 @@
-import { $fysp } from '@/api/index'
+import { $fysp } from '@/api/index';
 
 //闂鐘舵��
 const proStatus = {
@@ -8,7 +8,7 @@
   change_unCheck: 'change_unCheck',
   change_fail: 'change_fail',
   change_pass: 'change_pass'
-}
+};
 
 export default {
   //缁熻闂
@@ -16,8 +16,12 @@
     const status = {
       //闂鏁伴噺
       proNum: proList.length,
+      // 闂瀹℃牳鏁�
+      proCheckedNum: 0,
       //鏁存敼鏁伴噺
       changeNum: 0,
+      //鏁存敼瀹℃牳鏁伴噺
+      changeCheckedNum: 0,
       //寰呭鏍告暟閲�
       uncheckNum: 0,
       //宸插鏍搁�氳繃鏁伴噺
@@ -30,56 +34,98 @@
       passPer: '0%',
       //瀹℃牳鐜�
       checkPer: '0%'
-    }
+    };
 
     proList.forEach((p) => {
-      if (p.ischanged) status.changeNum++
+      if (p.ischanged) status.changeNum++;
 
-      if (p.extension3 == 'fail' || p.extension3 == 'change_fail') status.unpassNum++
+      if (p.extension3 == 'fail' || p.extension3 == 'change_fail')
+        status.unpassNum++;
       else if (
         p.extension3 == 'unCheck' ||
         p.extension3 == 'change_unCheck' ||
         (p.extension3 == 'pass' && p.ischanged)
       )
-        status.uncheckNum++
-      else status.passNum++
+        status.uncheckNum++;
+      else status.passNum++;
+
+      if (p.extension3 == proStatus.pass) {
+        status.proCheckedNum++;
+      }
+      if (p.extension3 == proStatus.change_pass) {
+        status.changeCheckedNum++;
+      }
 
       status.changePer =
         String(
           (status.changeNum / status.proNum) * 100
             ? ((status.changeNum / status.proNum) * 100).toFixed(1)
             : 0
-        ) + '%'
+        ) + '%';
       status.passPer =
         String(
           (status.passNum / status.proNum) * 100
             ? ((status.passNum / status.proNum) * 100).toFixed(1)
             : 0
-        ) + '%'
+        ) + '%';
       status.checkPer =
         String(
           ((status.passNum + status.unpassNum) / status.proNum) * 100
-            ? (((status.passNum + status.unpassNum) / status.proNum) * 100).toFixed(1)
+            ? (
+                ((status.passNum + status.unpassNum) / status.proNum) *
+                100
+              ).toFixed(1)
             : 0
-        ) + '%'
-    })
+        ) + '%';
+    });
 
-    return status
+    return status;
   },
 
   //缁熻闂锛岃繑鍥炴暟缁勫舰寮�
   proStatusArray(proList) {
-    const status = this.calProStatus(proList)
+    const status = this.calProStatus(proList);
     return [
-      { name: '闂鏁�', value: status.proNum },
-      { name: '鏁存敼鏁�', value: status.changeNum },
-      { name: '寰呭鏍�', value: status.uncheckNum },
-      { name: '宸插鏍�', value: status.passNum },
-      { name: '鏈�氳繃', value: status.unpassNum },
-      { name: '鏁存敼鐜�', value: status.changePer },
-      { name: '閫氳繃鐜�', value: status.passPer },
-      { name: '瀹℃牳鐜�', value: status.checkPer }
-    ]
+      { name: '闂鏁�', value: status.proNum, type: 'info' },
+      {
+        name: '鏁存敼鏁�',
+        value: status.changeNum,
+        type: status.changeNum < status.proNum ? 'danger' : 'info'
+      },
+      {
+        name: '寰呭鏍�',
+        value: status.uncheckNum,
+        type: status.uncheckNum > 0 ? 'danger' : 'info'
+      },
+      { name: '宸插鏍�', value: status.passNum, type: 'info' },
+      // {
+      //   name: '鏈�氳繃',
+      //   value: status.unpassNum,
+      //   type: status.unpassNum > 0 ? 'danger' : 'info'
+      // },
+      {
+        name: '鏁存敼鐜�',
+        value: status.changePer,
+        type:
+          status.proNum > 0 && status.changePer != '100.0%'
+            ? 'danger'
+            : 'success'
+      },
+      // {
+      //   name: '閫氳繃鐜�',
+      //   value: status.passPer,
+      //   type:
+      //     status.proNum > 0 && status.passPer != '100.0%' ? 'danger' : 'success'
+      // },
+      {
+        name: '瀹℃牳鐜�',
+        value: status.checkPer,
+        type:
+          status.proNum > 0 && status.checkPer != '100.0%'
+            ? 'danger'
+            : 'success'
+      }
+    ];
   },
 
   //闂鍥剧墖鍜屾暣鏀瑰浘鐗�
@@ -93,33 +139,83 @@
         title: '鏁存敼鍥剧墖',
         path: []
       }
-    ]
+    ];
     if (pro.mediafileList) {
       pro.mediafileList.forEach((m) => {
-        pics[m.ischanged ? 1 : 0].path.push(`${$fysp.imgUrl}${m.extension1}${m.guid}.jpg`)
-      })
+        pics[m.ischanged ? 1 : 0].path.push(
+          `${$fysp.imgUrl}${m.extension1}${m.guid}.jpg`
+        );
+      });
     }
 
-    return pics
+    return pics;
   },
 
   //闂瀹℃牳鐘舵�佽浆鎹腑鏂�
   proStatusMap(p) {
     switch (p) {
       case proStatus.unCheck:
-        return { name: '闂鏈鏍�', type: 'warning', index: 0, checkable: true, deletable: true, changeable: false }
+        return {
+          name: '闂鏈鏍�',
+          type: 'warning',
+          index: 0,
+          checkable: true,
+          deletable: true,
+          changeable: false
+        };
       case proStatus.pass:
-        return { name: '闂閫氳繃', type: 'success', index: 1, checkable: false, deletable: true, changeable: false }
+        return {
+          name: '闂閫氳繃',
+          type: 'success',
+          index: 1,
+          checkable: false,
+          deletable: true,
+          changeable: false
+        };
       case proStatus.fail:
-        return { name: '闂涓嶉�氳繃', type: 'danger', index: 1, checkable: false, deletable: true, changeable: false }
+        return {
+          name: '闂涓嶉�氳繃',
+          type: 'danger',
+          index: 1,
+          checkable: false,
+          deletable: true,
+          changeable: false
+        };
       case proStatus.change_unCheck:
-        return { name: '鏁存敼鏈鏍�', type: 'warning', index: 2, checkable: true, deletable: false, changeable: true }
+        return {
+          name: '鏁存敼鏈鏍�',
+          type: 'warning',
+          index: 2,
+          checkable: true,
+          deletable: false,
+          changeable: true
+        };
       case proStatus.change_fail:
-        return { name: '鏁存敼涓嶉�氳繃', type: 'danger', index: 3, checkable: false, deletable: false, changeable: true }
+        return {
+          name: '鏁存敼涓嶉�氳繃',
+          type: 'danger',
+          index: 3,
+          checkable: false,
+          deletable: false,
+          changeable: true
+        };
       case proStatus.change_pass:
-        return { name: '鏁存敼閫氳繃', type: 'success', index: 3, checkable: false, deletable: false, changeable: true }
+        return {
+          name: '鏁存敼閫氳繃',
+          type: 'success',
+          index: 3,
+          checkable: false,
+          deletable: false,
+          changeable: true
+        };
       default:
-        return { name: '闂鏈鏍�', type: 'warning', index: 0, checkable: true, deletable: true }
+        return {
+          name: '闂鏈鏍�',
+          type: 'warning',
+          index: 0,
+          checkable: true,
+          deletable: true
+        };
     }
   },
 
@@ -130,18 +226,18 @@
    * @returns 涓嬩竴涓棶棰樼姸鎬�
    */
   proNextStatus(s, isPass) {
-    let status, action
+    let status, action;
     switch (s) {
       case proStatus.unCheck:
-        status = isPass ? proStatus.pass : proStatus.fail
-        action = isPass ? 0 : 1
-        break
+        status = isPass ? proStatus.pass : proStatus.fail;
+        action = isPass ? 0 : 1;
+        break;
       case proStatus.change_unCheck:
-        status = isPass ? proStatus.change_pass : proStatus.change_fail
-        action = isPass ? 2 : 3
-        break
+        status = isPass ? proStatus.change_pass : proStatus.change_fail;
+        action = isPass ? 2 : 3;
+        break;
     }
-    return { status: status, action: action }
+    return { status: status, action: action };
   },
 
   /**
@@ -150,19 +246,19 @@
    * @returns 涓嬩竴涓棶棰樼姸鎬�
    */
   proBeforeStatus(s) {
-    let status, action
+    let status, action;
     switch (s) {
       case proStatus.fail:
       case proStatus.pass:
-        status = proStatus.unCheck
-        action = 4
-        break
-      case proStatus.change_fail:  
+        status = proStatus.unCheck;
+        action = 4;
+        break;
+      case proStatus.change_fail:
       case proStatus.change_pass:
-        status = proStatus.change_unCheck
-        action = 5
-        break
+        status = proStatus.change_unCheck;
+        action = 5;
+        break;
     }
-    return { status: status, action: action }
+    return { status: status, action: action };
   }
-}
+};

--
Gitblit v1.9.3