Sfoglia il codice sorgente

refactor(home-new): 更新准确率统计显示逻辑和变量命名

- 将topTeamsInDept重命名为topKezhangInBrigade以更准确反映数据含义
- 添加大队平均准确率显示逻辑
- 修复大队排名数据来源变量名错误
- 优化团队视图中的排名显示逻辑
huoyi 2 mesi fa
parent
commit
22c7564083
1 ha cambiato i file con 9 aggiunte e 8 eliminazioni
  1. 9 8
      src/pages/home-new/index.vue

+ 9 - 8
src/pages/home-new/index.vue

@@ -887,14 +887,14 @@ export default {
887 887
         },
888 888
         //获取抽问抽答
889 889
         getQuestionDataItems() {
890
-            const { personalAccuracy, teamAvgAccuracy, deptAvgAccuracy, siteAvgAccuracy, topDepts, topTeamsInDept, brigadeAvgAccuracy, brigadeRankingList } = this.accuracyStatistics;
890
+            const { personalAccuracy, teamAvgAccuracy, deptAvgAccuracy, siteAvgAccuracy, topDepts, topKezhangInBrigade, brigadeAvgAccuracy, brigadeRankingList } = this.accuracyStatistics;
891 891
             if (this.isIndividualView) {
892 892
                 // SecurityCheck角色:本人、班平均、主管平均、站平均
893 893
                 return [
894 894
                     { label: '本人', value: (personalAccuracy || 0), isImage: false },
895 895
                     { label: '班平均', value: (teamAvgAccuracy || 0), isImage: false, color: teamAvgAccuracy < personalAccuracy ? '#00AE41' : '#F96060' },
896 896
                     { label: '主管平均', value: (deptAvgAccuracy || 0), isImage: false, color: deptAvgAccuracy < personalAccuracy ? '#00AE41' : '#F96060' },
897
-                    { label: '大队平均', value: 0, isImage: false, color: deptAvgAccuracy < personalAccuracy ? '#00AE41' : '#F96060' },
897
+                    { label: '大队平均', value: (brigadeAvgAccuracy || 0), isImage: false, color: deptAvgAccuracy < personalAccuracy ? '#00AE41' : '#F96060' },
898 898
                     { label: '站平均', value: (siteAvgAccuracy || 0), isImage: false, color: siteAvgAccuracy < personalAccuracy ? '#00AE41' : '#F96060' }
899 899
                 ];
900 900
             } else if (this.isTeamView) {
@@ -902,6 +902,7 @@ export default {
902 902
                 return [
903 903
                     { label: '班组', value: (teamAvgAccuracy || 0), isImage: false },
904 904
                     { label: '主管平均', value: (deptAvgAccuracy || 0), isImage: false, color: deptAvgAccuracy < teamAvgAccuracy ? '#00AE41' : '#F96060' },
905
+                    { label: '大队平均', value: (brigadeAvgAccuracy || 0), isImage: false, color: brigadeAvgAccuracy < teamAvgAccuracy ? '#00AE41' : '#F96060' },
905 906
                     { label: '站平均', value: (siteAvgAccuracy || 0), isImage: false, color: siteAvgAccuracy < teamAvgAccuracy ? '#00AE41' : '#F96060' }
906 907
                 ];
907 908
             } else if (this.role.includes('kezhang')) {
@@ -917,9 +918,9 @@ export default {
917 918
                 return [
918 919
                     { label: '大队', value: (brigadeAvgAccuracy || 0), isImage: false, },
919 920
                     { label: '站平均', value: (siteAvgAccuracy || 0), isImage: false, color: siteAvgAccuracy < deptAvgAccuracy ? '#00AE41' : '#F96060' },
920
-                    { label: this.getObjByRank(topTeamsInDept, 1).teamName, value: '/static/images/icon/one.png', isImage: true },
921
-                    { label: this.getObjByRank(topTeamsInDept, 2).teamName, value: '/static/images/icon/two.png', isImage: true },
922
-                    { label: this.getObjByRank(topTeamsInDept, 3).teamName, value: '/static/images/icon/three.png', isImage: true }
921
+                    { label: this.getObjByRank(topKezhangInBrigade, 1).name, value: '/static/images/icon/one.png', isImage: true },
922
+                    { label: this.getObjByRank(topKezhangInBrigade, 2).name, value: '/static/images/icon/two.png', isImage: true },
923
+                    { label: this.getObjByRank(topKezhangInBrigade, 3).name, value: '/static/images/icon/three.png', isImage: true }
923 924
                 ];
924 925
             } else if (this.isZhanZhang) {
925 926
 
@@ -1083,7 +1084,7 @@ export default {
1083 1084
                     { label: '站级排名', current: brigadeInSiteRanking?.rank || 0, total: brigadeInSiteRanking?.total || 0, percentage: brigadeInSiteRanking?.total ? ((brigadeInSiteRanking?.rank || 0) / brigadeInSiteRanking?.total) * 100 : 0, type: 'station' }
1084 1085
                 ];
1085 1086
             } else if (this.isTeamView) {
1086
-                const { teamInDeptRanking, deptRanking, teamInSiteRanking,teamInBrigadeRanking } = this.accuracyStatistics;
1087
+                const { teamInDeptRanking, deptRanking, teamInSiteRanking, teamInBrigadeRanking } = this.accuracyStatistics;
1087 1088
                 // 班组长角色:显示科级和站级排名
1088 1089
                 return [
1089 1090
                     { label: '主管排名', current: teamInDeptRanking?.rank || 0, total: teamInDeptRanking?.total || 0, percentage: teamInDeptRanking?.total ? ((teamInDeptRanking.rank || 0) / teamInDeptRanking.total) * 100 : 0 },
@@ -1117,8 +1118,8 @@ export default {
1117 1118
                     { label: '站级排名', current: stationRanking?.currentRank || 0, total: stationRanking?.totalItems || 0, percentage: stationRanking?.totalItems ? ((stationRanking.currentRank || 0) / stationRanking.totalItems) * 100 : 0, type: 'station' }
1118 1119
                 ];
1119 1120
             } else if (this.isBrigade) {
1120
-                const { sectionMasterData } = this.seizeData;
1121
-                const { stationRanking } = sectionMasterData || {};
1121
+                const { brigadeMasterData } = this.seizeData;
1122
+                const { stationRanking } = brigadeMasterData || {};
1122 1123
                 // brigade角色:显示站级排名
1123 1124
                 return [
1124 1125