Explorar o código

fix(home-new): 修复部门排名显示错误并优化抽问抽答数据展示

修复部门排名中显示deptName而不是name的问题,并调整抽问抽答数据展示逻辑,添加大队平均数据展示。同时修复了部门排名排序错误的问题。
huoyi hai 2 meses
pai
achega
99520ad628
Modificáronse 1 ficheiros con 10 adicións e 11 borrados
  1. 10 11
      src/pages/home-new/index.vue

+ 10 - 11
src/pages/home-new/index.vue

@@ -177,7 +177,7 @@ export default {
177 177
         },
178 178
         // TypeDetail组件数据
179 179
         typeDetailData() {
180
-            console.log('this.seizeData', this.seizeData,this.seizeData.stationMasterData)
180
+            console.log('this.seizeData', this.seizeData, this.seizeData.stationMasterData)
181 181
             return [
182 182
                 {
183 183
                     title: '查获上报',
@@ -204,8 +204,8 @@ export default {
204 204
                     dividerIndex: this.isBrigade ? 1 : 0,
205 205
                     dataItems: this.getQuestionDataItems(),
206 206
                     rankList: this.getQuestionRankList(),
207
-                    departmentRank: this.accuracyStatistics.topDepts && this.accuracyStatistics.topDepts.map(item => ({ ...item, passRate: item.accuracy.toFixed(2), name: item.deptName })),
208
-                    bottomDepartmentRank: this.accuracyStatistics.topDepts && [...this.accuracyStatistics.topDepts].sort((a, b) => (a.accuracy || 0) - (b.accuracy || 0)).map(item => ({ ...item, passRate: item.accuracy.toFixed(2), name: item.deptName })),
207
+                    departmentRank: this.accuracyStatistics.topDepts && this.accuracyStatistics.topDepts.map(item => ({ ...item, passRate: item.accuracy.toFixed(2), name: item.name })),
208
+                    bottomDepartmentRank: this.accuracyStatistics.bottomDepts && [...this.accuracyStatistics.topDepts].sort((a, b) => (a.accuracy || 0) - (b.accuracy || 0)).map(item => ({ ...item, passRate: item.accuracy.toFixed(2), name: item.name })),
209 209
                     teamRank: this.accuracyStatistics.topTeamsInSite && this.accuracyStatistics.topTeamsInSite.map(item => ({ ...item, passRate: item.accuracy.toFixed(2), name: item.name })),
210 210
                     bottomTeamRank: this.accuracyStatistics.bottomTeamsInSite && this.accuracyStatistics.bottomTeamsInSite.map(item => ({ ...item, passRate: item.accuracy.toFixed(2), name: item.name })),
211 211
                 },
@@ -884,7 +884,7 @@ export default {
884 884
         },
885 885
         //获取抽问抽答
886 886
         getQuestionDataItems() {
887
-            const { personalAccuracy, teamAvgAccuracy, deptAvgAccuracy, siteAvgAccuracy, topDepts, topTeamsInDept } = this.accuracyStatistics;
887
+            const { personalAccuracy, teamAvgAccuracy, deptAvgAccuracy, siteAvgAccuracy, topDepts, topTeamsInDept,brigadeAvgAccuracy } = this.accuracyStatistics;
888 888
             if (this.isIndividualView) {
889 889
                 // SecurityCheck角色:本人、班平均、主管平均、站平均
890 890
                 return [
@@ -905,22 +905,21 @@ export default {
905 905
                 // kezhang角色:主管、站平均、前三名班组(isImage: true)
906 906
                 return [
907 907
                     { label: '主管', value: (deptAvgAccuracy || 0), isImage: false, },
908
+                    { label: '大队平均', value: (brigadeAvgAccuracy || 0), isImage: false, color: brigadeAvgAccuracy < deptAvgAccuracy ? '#00AE41' : '#F96060' },
908 909
                     { label: '站平均', value: (siteAvgAccuracy || 0), isImage: false, color: siteAvgAccuracy < deptAvgAccuracy ? '#00AE41' : '#F96060' },
909
-                    { label: this.getObjByRank(topTeamsInDept, 1).teamName, value: '/static/images/icon/one.png', isImage: true },
910
-                    { label: this.getObjByRank(topTeamsInDept, 2).teamName, value: '/static/images/icon/two.png', isImage: true },
911
-                    { label: this.getObjByRank(topTeamsInDept, 3).teamName, value: '/static/images/icon/three.png', isImage: true }
910
+
912 911
                 ];
913 912
             } else if (this.isBrigade) {
914 913
                 // brigade角色:主管、站平均、前三名班组(isImage: true)
915 914
                 return [
916
-                    { label: '主管', value: (deptAvgAccuracy || 0), isImage: false, },
917
-                    { label: '大队平均', value: (siteAvgAccuracy || 0), isImage: false, color: siteAvgAccuracy < deptAvgAccuracy ? '#00AE41' : '#F96060' },
915
+                    { label: '大队', value: (brigadeAvgAccuracy || 0), isImage: false, },
916
+                    { label: '平均', value: (siteAvgAccuracy || 0), isImage: false, color: siteAvgAccuracy < deptAvgAccuracy ? '#00AE41' : '#F96060' },
918 917
                     { label: this.getObjByRank(topTeamsInDept, 1).teamName, value: '/static/images/icon/one.png', isImage: true },
919 918
                     { label: this.getObjByRank(topTeamsInDept, 2).teamName, value: '/static/images/icon/two.png', isImage: true },
920 919
                     { label: this.getObjByRank(topTeamsInDept, 3).teamName, value: '/static/images/icon/three.png', isImage: true }
921 920
                 ];
922 921
             } else if (this.isZhanZhang) {
923
-                 console.log(this.accuracyStatistics,"topDepts")
922
+                console.log(this.accuracyStatistics, "topDepts")
924 923
                 // test/zhijianke角色:全站、前三名的科室(isImage: true)
925 924
                 return [
926 925
                     { label: '全站', value: (siteAvgAccuracy || 0), isImage: false },
@@ -1042,7 +1041,7 @@ export default {
1042 1041
                 ];
1043 1042
             } else if (this.isBrigade) {
1044 1043
                 return [
1045
-                   
1044
+
1046 1045
                     { label: '站级排名', current: stationRanking || 0, total: stationTotal || 0, percentage: stationTotal ? ((stationRanking || 0) / stationTotal) * 100 : 0, type: 'station' }
1047 1046
                 ];
1048 1047
             } else if (this.isTeamView) {