Просмотр исходного кода

Merge branch 'new-homePage' into dev

huoyi недель назад: 3
Родитель
Сommit
6eb0bc9da6
2 измененных файлов с 65 добавлено и 5 удалено
  1. 48 0
      src/pages/home-new/components/type-detail.vue
  2. 17 5
      src/pages/home-new/index.vue

+ 48 - 0
src/pages/home-new/components/type-detail.vue

@@ -69,6 +69,52 @@
69
 
69
 
70
                 <!-- test角色特殊显示:主管合格率排行和班组合格率排行 -->
70
                 <!-- test角色特殊显示:主管合格率排行和班组合格率排行 -->
71
                 <div class="rank-section" v-if="role && (role.includes('test') || role.includes('zhijianke'))">
71
                 <div class="rank-section" v-if="role && (role.includes('test') || role.includes('zhijianke'))">
72
+
73
+                    <!-- 大队合格率排行 -->
74
+                    <div class="rank-header">
75
+                        <div class="rank-title">{{ item.title === '查获上报' ? '大队查获总数排名' : item.title == '抽问抽答' ? '大队正确率排名'
76
+                            :
77
+                            '大队合格率排名' }}</div>
78
+                        <div class="sort-buttons">
79
+                            <div :class="['sort-btn', { 'active': item.brigadeSortType === 'asc' }]"
80
+                                @click="$emit('sort-change', item.title, 'brigade', 'asc')">正序</div>
81
+                            <div :class="['sort-btn', { 'active': item.brigadeSortType === 'desc' }]"
82
+                                @click="$emit('sort-change', item.title, 'brigade', 'desc')">倒序</div>
83
+                        </div>
84
+                    </div>
85
+
86
+                    <!-- 大队排名显示 -->
87
+                    <template v-if="item.brigadeSortType === 'asc'">
88
+                        <div v-for="(brigade, i) in (item.brigadeRank || []).slice(0, 5)" :key="'brigade-asc-' + i"
89
+                            class="rank-item">
90
+                            <div class="rank-label">{{ brigade.name }}</div>
91
+                            <div class="rank-progress">
92
+                                <h-rank-line
93
+                                    :percentage="item.title !== '查获上报' ? Number(brigade.passRate || 0) : getPercentage(brigade.passRate, item.brigadeRank)"
94
+                                    endType="round" :height="10" :color="['#A8E6CF', '#4CAF50']">
95
+                                    <div class="rank-info"><span style="color: #999999">{{ brigade.passRate || 0
96
+                                            }}</span>
97
+                                    </div>
98
+                                </h-rank-line>
99
+                            </div>
100
+                        </div>
101
+                    </template>
102
+                    <template v-else>
103
+                        <div v-for="(brigade, i) in (item.bottomBrigadeRank || []).slice(0, 5)"
104
+                            :key="'brigade-desc-' + i" class="rank-item">
105
+                            <div class="rank-label">{{ brigade.name }}</div>
106
+                            <div class="rank-progress">
107
+                                <h-rank-line
108
+                                    :percentage="item.title !== '查获上报' ? Number(brigade.passRate || 0) : getPercentage(brigade.passRate, item.bottomBrigadeRank)"
109
+                                    endType="round" :height="10" :color="['#A8E6CF', '#4CAF50']">
110
+                                    <div class="rank-info"><span style="color: #999999">{{ brigade.passRate || 0
111
+                                            }}</span>
112
+                                    </div>
113
+                                </h-rank-line>
114
+                            </div>
115
+                        </div>
116
+                    </template>
117
+
72
                     <!-- 主管合格率排行 -->
118
                     <!-- 主管合格率排行 -->
73
                     <div class="rank-header">
119
                     <div class="rank-header">
74
                         <div class="rank-title">{{ item.title === '查获上报' ? '主管查获总数排名' : item.title == '抽问抽答' ? '主管正确率排名'
120
                         <div class="rank-title">{{ item.title === '查获上报' ? '主管查获总数排名' : item.title == '抽问抽答' ? '主管正确率排名'
@@ -153,6 +199,8 @@
153
                             </div>
199
                             </div>
154
                         </div>
200
                         </div>
155
                     </template>
201
                     </template>
202
+
203
+
156
                 </div>
204
                 </div>
157
 
205
 
158
             </div>
206
             </div>

+ 17 - 5
src/pages/home-new/index.vue

@@ -118,9 +118,9 @@ export default {
118
             ],
118
             ],
119
             // 排序状态管理
119
             // 排序状态管理
120
             sortStates: {
120
             sortStates: {
121
-                '查获上报': { teamSortType: 'asc', deptSortType: 'asc' },
122
-                '抽问抽答': { teamSortType: 'asc', deptSortType: 'asc' },
123
-                '巡检': { teamSortType: 'asc', deptSortType: 'asc' }
121
+                '查获上报': { teamSortType: 'asc', deptSortType: 'asc', brigadeSortType: 'asc' },
122
+                '抽问抽答': { teamSortType: 'asc', deptSortType: 'asc', brigadeSortType: 'asc' },
123
+                '巡检': { teamSortType: 'asc', deptSortType: 'asc', brigadeSortType: 'asc' }
124
             },
124
             },
125
             // 排名数据
125
             // 排名数据
126
             rankData: {
126
             rankData: {
@@ -211,13 +211,16 @@ export default {
211
                     statTitle: '查获数量',
211
                     statTitle: '查获数量',
212
                     teamSortType: this.sortStates['查获上报'].teamSortType,
212
                     teamSortType: this.sortStates['查获上报'].teamSortType,
213
                     deptSortType: this.sortStates['查获上报'].deptSortType,
213
                     deptSortType: this.sortStates['查获上报'].deptSortType,
214
+                    brigadeSortType: this.sortStates['查获上报'].brigadeSortType,
214
                     dividerIndex: this.isBrigade ? 1 : 0,
215
                     dividerIndex: this.isBrigade ? 1 : 0,
215
                     dataItems: this.getSeizeDataItems(),
216
                     dataItems: this.getSeizeDataItems(),
216
                     rankList: this.getSeizeRankList(),
217
                     rankList: this.getSeizeRankList(),
217
                     departmentRank: this.seizeData.stationMasterData && this.seizeData.stationMasterData.topThreeDepartmentRankings ? this.seizeData.stationMasterData.topThreeDepartmentRankings.map(item => ({ ...item, passRate: item.seizureCount.toFixed(2), name: item.departmentName })) : [],
218
                     departmentRank: this.seizeData.stationMasterData && this.seizeData.stationMasterData.topThreeDepartmentRankings ? this.seizeData.stationMasterData.topThreeDepartmentRankings.map(item => ({ ...item, passRate: item.seizureCount.toFixed(2), name: item.departmentName })) : [],
218
-                    bottomDepartmentRank: this.seizeData.stationMasterData && this.seizeData.stationMasterData.botomThreeDepartmentRankings && this.seizeData.stationMasterData.departmentRankings ? [...this.seizeData.stationMasterData.departmentRankings].sort((a, b) => (a.seizureCount || 0) - (b.seizureCount || 0)).slice(0, 3).map(item => ({ ...item, passRate: item.seizureCount.toFixed(2), name: item.departmentName })) : [],
219
+                    bottomDepartmentRank: this.seizeData.stationMasterData && this.seizeData.stationMasterData.botomThreeDepartmentRankings ? [...this.seizeData.stationMasterData.botomThreeDepartmentRankings].sort((a, b) => (a.seizureCount || 0) - (b.seizureCount || 0)).slice(0, 3).map(item => ({ ...item, passRate: item.seizureCount.toFixed(2), name: item.departmentName })) : [],
219
                     teamRank: this.seizeData.stationMasterData && this.seizeData.stationMasterData.topThreeTeamRankings ? this.seizeData.stationMasterData.topThreeTeamRankings.map(item => ({ ...item, passRate: item.seizureCount.toFixed(2), name: item.teamName })) : [],
220
                     teamRank: this.seizeData.stationMasterData && this.seizeData.stationMasterData.topThreeTeamRankings ? this.seizeData.stationMasterData.topThreeTeamRankings.map(item => ({ ...item, passRate: item.seizureCount.toFixed(2), name: item.teamName })) : [],
220
                     bottomTeamRank: this.seizeData.stationMasterData && this.seizeData.stationMasterData.botomThreeTeamRankings ? this.seizeData.stationMasterData.botomThreeTeamRankings.map(item => ({ ...item, passRate: item.seizureCount.toFixed(2), name: item.teamName })) : [],
221
                     bottomTeamRank: this.seizeData.stationMasterData && this.seizeData.stationMasterData.botomThreeTeamRankings ? this.seizeData.stationMasterData.botomThreeTeamRankings.map(item => ({ ...item, passRate: item.seizureCount.toFixed(2), name: item.teamName })) : [],
222
+                    brigadeRank: this.seizeData.stationMasterData && this.seizeData.stationMasterData.brigadeRankings ? [...this.seizeData.stationMasterData.brigadeRankings].sort((a, b) => (b.seizureCount || 0) - (a.seizureCount || 0)).slice(0, 5).map(item => ({ ...item, passRate: item.seizureCount.toFixed(2), name: item.brigadeName })) : [],
223
+                    bottomBrigadeRank: this.seizeData.stationMasterData && this.seizeData.stationMasterData.brigadeRankings ? [...this.seizeData.stationMasterData.brigadeRankings].sort((a, b) => (a.seizureCount || 0) - (b.seizureCount || 0)).slice(0, 5).map(item => ({ ...item, passRate: item.seizureCount.toFixed(2), name: item.brigadeName })) : [],
221
                 },
224
                 },
222
                 {
225
                 {
223
                     title: '抽问抽答',
226
                     title: '抽问抽答',
@@ -226,6 +229,7 @@ export default {
226
                     statTitle: '正确率(%)',
229
                     statTitle: '正确率(%)',
227
                     teamSortType: this.sortStates['抽问抽答'].teamSortType,
230
                     teamSortType: this.sortStates['抽问抽答'].teamSortType,
228
                     deptSortType: this.sortStates['抽问抽答'].deptSortType,
231
                     deptSortType: this.sortStates['抽问抽答'].deptSortType,
232
+                    brigadeSortType: this.sortStates['抽问抽答'].brigadeSortType,
229
                     dividerIndex: this.isBrigade ? 1 : 0,
233
                     dividerIndex: this.isBrigade ? 1 : 0,
230
                     dataItems: this.getQuestionDataItems(),
234
                     dataItems: this.getQuestionDataItems(),
231
                     rankList: this.getQuestionRankList(),
235
                     rankList: this.getQuestionRankList(),
@@ -233,6 +237,8 @@ export default {
233
                     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 })),
237
                     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 })),
234
                     teamRank: this.accuracyStatistics.topTeamsInSite && this.accuracyStatistics.topTeamsInSite.map(item => ({ ...item, passRate: item.accuracy.toFixed(2), name: item.name })),
238
                     teamRank: this.accuracyStatistics.topTeamsInSite && this.accuracyStatistics.topTeamsInSite.map(item => ({ ...item, passRate: item.accuracy.toFixed(2), name: item.name })),
235
                     bottomTeamRank: this.accuracyStatistics.bottomTeamsInSite && this.accuracyStatistics.bottomTeamsInSite.map(item => ({ ...item, passRate: item.accuracy.toFixed(2), name: item.name })),
239
                     bottomTeamRank: this.accuracyStatistics.bottomTeamsInSite && this.accuracyStatistics.bottomTeamsInSite.map(item => ({ ...item, passRate: item.accuracy.toFixed(2), name: item.name })),
240
+                    brigadeRank: this.accuracyStatistics.brigadeRankingList && [...this.accuracyStatistics.brigadeRankingList].sort((a, b) => (b.accuracy || 0) - (a.accuracy || 0)).slice(0, 5).map(item => ({ ...item, passRate: item.accuracy.toFixed(2), name: item.name })),
241
+                    bottomBrigadeRank: this.accuracyStatistics.brigadeRankingList && [...this.accuracyStatistics.brigadeRankingList].sort((a, b) => (a.accuracy || 0) - (b.accuracy || 0)).slice(0, 5).map(item => ({ ...item, passRate: item.accuracy.toFixed(2), name: item.name })),
236
                 },
242
                 },
237
                 {
243
                 {
238
                     title: '巡检',
244
                     title: '巡检',
@@ -241,6 +247,7 @@ export default {
241
                     statTitle: '合格率(%)',
247
                     statTitle: '合格率(%)',
242
                     teamSortType: this.sortStates['巡检'].teamSortType,
248
                     teamSortType: this.sortStates['巡检'].teamSortType,
243
                     deptSortType: this.sortStates['巡检'].deptSortType,
249
                     deptSortType: this.sortStates['巡检'].deptSortType,
250
+                    brigadeSortType: this.sortStates['巡检'].brigadeSortType,
244
                     dividerIndex: this.isBrigade ? 1 : 0,
251
                     dividerIndex: this.isBrigade ? 1 : 0,
245
                     dataItems: this.getInspectionDataItems(),
252
                     dataItems: this.getInspectionDataItems(),
246
                     completed: this.inspectionData.doneNumber,
253
                     completed: this.inspectionData.doneNumber,
@@ -250,6 +257,8 @@ export default {
250
                     bottomDepartmentRank: this.inspectionData.reverseDepartmentRankingList && [...this.inspectionData.reverseDepartmentRankingList].sort((a, b) => (a.passRate || 0) - (b.passRate || 0)).slice(0, 5).map(item => ({ ...item, passRate: (item.passRate * 100).toFixed(2) })),
257
                     bottomDepartmentRank: this.inspectionData.reverseDepartmentRankingList && [...this.inspectionData.reverseDepartmentRankingList].sort((a, b) => (a.passRate || 0) - (b.passRate || 0)).slice(0, 5).map(item => ({ ...item, passRate: (item.passRate * 100).toFixed(2) })),
251
                     teamRank: this.inspectionData.teamRankingList && this.inspectionData.teamRankingList.map(item => ({ ...item, passRate: (item.passRate * 100).toFixed(2) })),
258
                     teamRank: this.inspectionData.teamRankingList && this.inspectionData.teamRankingList.map(item => ({ ...item, passRate: (item.passRate * 100).toFixed(2) })),
252
                     bottomTeamRank: this.inspectionData.reverseTeamRankingList && this.inspectionData.reverseTeamRankingList.map(item => ({ ...item, passRate: (item.passRate * 100).toFixed(2) })),
259
                     bottomTeamRank: this.inspectionData.reverseTeamRankingList && this.inspectionData.reverseTeamRankingList.map(item => ({ ...item, passRate: (item.passRate * 100).toFixed(2) })),
260
+                    brigadeRank: this.inspectionData.brigadeRankingList && [...this.inspectionData.brigadeRankingList].sort((a, b) => (a.rank || 0) - (b.rank || 0)).slice(0, 5).map(item => ({ ...item, passRate: (item.passRate * 100).toFixed(2), name: item.name })),
261
+                    bottomBrigadeRank: this.inspectionData.brigadeRankingList && [...this.inspectionData.brigadeRankingList].sort((a, b) => (b.rank || 0) - (a.rank || 0)).slice(0, 5).map(item => ({ ...item, passRate: (item.passRate * 100).toFixed(2), name: item.name })),
253
                 }
262
                 }
254
             ]
263
             ]
255
         },
264
         },
@@ -523,13 +532,14 @@ export default {
523
                     startTime: startDate,
532
                     startTime: startDate,
524
                     endTime: endDate,
533
                     endTime: endDate,
525
                     sortField: 'totalScore',
534
                     sortField: 'totalScore',
526
-                    dimension: '3'
535
+                    dimension: '4'
527
                 };
536
                 };
528
 
537
 
529
                 getMetrics(params).then(res => {
538
                 getMetrics(params).then(res => {
530
 
539
 
531
                     if (res && res.data) {
540
                     if (res && res.data) {
532
                         this.performanceData = res.data;
541
                         this.performanceData = res.data;
542
+
533
                         resolve(res.data);
543
                         resolve(res.data);
534
                     } else {
544
                     } else {
535
                         resolve([]);
545
                         resolve([]);
@@ -900,6 +910,8 @@ export default {
900
                     this.sortStates[title].teamSortType = sortType;
910
                     this.sortStates[title].teamSortType = sortType;
901
                 } else if (type === 'dept') {
911
                 } else if (type === 'dept') {
902
                     this.sortStates[title].deptSortType = sortType;
912
                     this.sortStates[title].deptSortType = sortType;
913
+                } else if (type === 'brigade') {
914
+                    this.sortStates[title].brigadeSortType = sortType;
903
                 }
915
                 }
904
             }
916
             }
905
         },
917
         },