Quellcode durchsuchen

fix(home-new): 修复排名数据展示问题并统一字段名

- 移除bottomDepartmentRank的切片限制以显示完整排名
- 统一使用name字段替代deptName和teamName
- 添加调试日志用于检查accuracyStatistics数据
huoyi vor 2 Monaten
Ursprung
Commit
71bb0a1480
1 geänderte Dateien mit 7 neuen und 7 gelöschten Zeilen
  1. 7 7
      src/pages/home-new/index.vue

+ 7 - 7
src/pages/home-new/index.vue

@@ -205,9 +205,9 @@ export default {
205 205
                     dataItems: this.getQuestionDataItems(),
206 206
                     rankList: this.getQuestionRankList(),
207 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)).slice(0, 5).map(item => ({ ...item, passRate: item.accuracy.toFixed(2), name: item.deptName })),
209
-                    teamRank: this.accuracyStatistics.topTeamsInSite && this.accuracyStatistics.topTeamsInSite.map(item => ({ ...item, passRate: item.accuracy.toFixed(2), name: item.teamName })),
210
-                    bottomTeamRank: this.accuracyStatistics.bottomTeamsInSite && this.accuracyStatistics.bottomTeamsInSite.map(item => ({ ...item, passRate: item.accuracy.toFixed(2), name: item.teamName })),
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 })),
209
+                    teamRank: this.accuracyStatistics.topTeamsInSite && this.accuracyStatistics.topTeamsInSite.map(item => ({ ...item, passRate: item.accuracy.toFixed(2), name: item.name })),
210
+                    bottomTeamRank: this.accuracyStatistics.bottomTeamsInSite && this.accuracyStatistics.bottomTeamsInSite.map(item => ({ ...item, passRate: item.accuracy.toFixed(2), name: item.name })),
211 211
                 },
212 212
                 {
213 213
                     title: '巡检',
@@ -920,13 +920,13 @@ export default {
920 920
                     { label: this.getObjByRank(topTeamsInDept, 3).teamName, value: '/static/images/icon/three.png', isImage: true }
921 921
                 ];
922 922
             } else if (this.isZhanZhang) {
923
-                
923
+                 console.log(this.accuracyStatistics,"topDepts")
924 924
                 // test/zhijianke角色:全站、前三名的科室(isImage: true)
925 925
                 return [
926 926
                     { label: '全站', value: (siteAvgAccuracy || 0), isImage: false },
927
-                    { label: this.getObjByRank(topDepts, 1).deptName, value: '/static/images/icon/one.png', isImage: true },
928
-                    { label: this.getObjByRank(topDepts, 2).deptName, value: '/static/images/icon/two.png', isImage: true },
929
-                    { label: this.getObjByRank(topDepts, 3).deptName, value: '/static/images/icon/three.png', isImage: true }
927
+                    { label: this.getObjByRank(topDepts, 1).name, value: '/static/images/icon/one.png', isImage: true },
928
+                    { label: this.getObjByRank(topDepts, 2).name, value: '/static/images/icon/two.png', isImage: true },
929
+                    { label: this.getObjByRank(topDepts, 3).name, value: '/static/images/icon/three.png', isImage: true }
930 930
                 ];
931 931
             } else {
932 932
                 // 默认角色:检查项、完成率