Sfoglia il codice sorgente

feat(eikonStatistics): 添加大队级别支持并优化布局

- 在多个组件中添加对大队(brigade)级别的支持
- 调整顶部信息组件的padding布局
- 优化角色判断逻辑,增加经理(jingli)角色处理
- 统一switch选项的value类型为字符串
- 修复表格数据加载时的空数据问题
huoyi 3 mesi fa
parent
commit
137fb50398

+ 22 - 3
src/pages/eikonStatistics/components/MemberDetails.vue

@@ -37,7 +37,8 @@ export default {
37
           this.memberTableData = [];
37
           this.memberTableData = [];
38
           return;
38
           return;
39
         }
39
         }
40
-        
40
+
41
+
41
         if (this.isBanZuZhang) {
42
         if (this.isBanZuZhang) {
42
           this.handlePersonalData(newVal)
43
           this.handlePersonalData(newVal)
43
         } else {
44
         } else {
@@ -47,6 +48,7 @@ export default {
47
               avgWorkingHours: `${item.avgWorkingHours}H`
48
               avgWorkingHours: `${item.avgWorkingHours}H`
48
             }
49
             }
49
           })
50
           })
51
+          
50
         }
52
         }
51
       },
53
       },
52
     }
54
     }
@@ -56,7 +58,7 @@ export default {
56
       currentLevel: state => state.eikonLevel.currentLevel,
58
       currentLevel: state => state.eikonLevel.currentLevel,
57
       detailData: state => state.eikonLevel.detailData,
59
       detailData: state => state.eikonLevel.detailData,
58
     }),
60
     }),
59
-    ...mapGetters('eikonLevel', ['isBanZuZhang', 'isKeZhang', 'isZhanZhang']),
61
+    ...mapGetters('eikonLevel', ['isBanZuZhang', 'isKeZhang', 'isZhanZhang','isJingLi']),
60
     title() {
62
     title() {
61
       if (this.currentLevel === 'team') {
63
       if (this.currentLevel === 'team') {
62
         return '成员明细'
64
         return '成员明细'
@@ -67,6 +69,9 @@ export default {
67
       if (this.currentLevel === 'station') {
69
       if (this.currentLevel === 'station') {
68
         return '科室明细'
70
         return '科室明细'
69
       }
71
       }
72
+      if (this.currentLevel === 'brigade') {
73
+        return '大队明细'
74
+      }
70
     },
75
     },
71
     memberTableColumns() {
76
     memberTableColumns() {
72
       if (this.currentLevel === 'team') {
77
       if (this.currentLevel === 'team') {
@@ -102,6 +107,17 @@ export default {
102
           { props: 'testScore', title: '测试平均分' },
107
           { props: 'testScore', title: '测试平均分' },
103
         ]
108
         ]
104
       }
109
       }
110
+      if (this.currentLevel === 'brigade') {
111
+        return [
112
+          { props: 'name', title: '主管', slot: true },
113
+          { props: 'qualificationLevel', title: '资质等级1级' },
114
+          { props: 'avgWorkingDays', title: '人均出勤天数' },
115
+          { props: 'avgWorkingHours', title: '人均上岗时长' },
116
+          { props: 'avgSeizureCount', title: '人均查获数量' },
117
+          { props: 'checkCount', title: '人均巡检问题数' },
118
+          { props: 'testScore', title: '测试平均分' },
119
+        ]
120
+      }
105
     }
121
     }
106
   },
122
   },
107
   methods: {
123
   methods: {
@@ -113,7 +129,7 @@ export default {
113
         this.memberTableData = [];
129
         this.memberTableData = [];
114
         return;
130
         return;
115
       }
131
       }
116
-      
132
+
117
       const res = [...newVal]
133
       const res = [...newVal]
118
 
134
 
119
       // 批量获取资质等级字典数据
135
       // 批量获取资质等级字典数据
@@ -146,6 +162,9 @@ export default {
146
       if (this.isZhanZhang) {
162
       if (this.isZhanZhang) {
147
         this.changeLevel({ level: 'department', levelId: row.id })
163
         this.changeLevel({ level: 'department', levelId: row.id })
148
       }
164
       }
165
+      if (this.isJingLi) {
166
+        this.changeLevel({ level: 'brigade', levelId: row.id })
167
+      }
149
       await this.loadData()
168
       await this.loadData()
150
       this.$emit('nameClick', row)
169
       this.$emit('nameClick', row)
151
     }
170
     }

+ 15 - 6
src/pages/eikonStatistics/components/WorkOutput.vue

@@ -16,7 +16,7 @@
16
                 <text class="progress-text">
16
                 <text class="progress-text">
17
                   <text class="progress-rank">第{{ extraData.rank || 0 }}名</text>
17
                   <text class="progress-rank">第{{ extraData.rank || 0 }}名</text>
18
                   /
18
                   /
19
-                  <text class="progress-count">{{extraData.rankCount || 0 }}</text>
19
+                  <text class="progress-count">{{ extraData.rankCount || 0 }}</text>
20
                 </text>
20
                 </text>
21
               </h-rank-line>
21
               </h-rank-line>
22
             </div>
22
             </div>
@@ -69,21 +69,29 @@ export default {
69
       currentLevel: state => state.eikonLevel.currentLevel,
69
       currentLevel: state => state.eikonLevel.currentLevel,
70
       currentLevelId: state => state.eikonLevel.currentLevelId,
70
       currentLevelId: state => state.eikonLevel.currentLevelId,
71
     }),
71
     }),
72
-    ...mapGetters('eikonLevel', ['isZhanZhang', 'isPersonal', 'isBanZuZhang']),
72
+    ...mapGetters('eikonLevel', ['isZhanZhang', 'isKeZhang', 'isPersonal', 'isBanZuZhang', 'isJingLi']),
73
     switchOptions() {
73
     switchOptions() {
74
-      if (this.isPersonal) {
74
+      if (this.isKeZhang) {
75
         return [
75
         return [
76
           { value: 'station', label: '全站' },
76
           { value: 'station', label: '全站' },
77
-          { value: 'department', label: '本科' },
78
-          { value: 'team', label: '本班' }
77
+          { value: 'brigade', label: '本大队' },
79
         ]
78
         ]
80
       }
79
       }
81
       if (this.isBanZuZhang) {
80
       if (this.isBanZuZhang) {
82
         return [
81
         return [
83
           { value: 'station', label: '全站' },
82
           { value: 'station', label: '全站' },
84
-          { value: 'department', label: '本科' },
83
+          { value: 'brigade', label: '本大队' },
84
+        ]
85
+      }
86
+      if (this.isPersonal) {
87
+        return [
88
+          { value: 'station', label: '全站' },
89
+          { value: 'brigade', label: '本大队' },
90
+          { value: 'department', label: '本主管' },
91
+          { value: 'team', label: '本班' }
85
         ]
92
         ]
86
       }
93
       }
94
+
87
       return []
95
       return []
88
     },
96
     },
89
   },
97
   },
@@ -216,6 +224,7 @@ export default {
216
   color: #333333;
224
   color: #333333;
217
   line-height: 1.5;
225
   line-height: 1.5;
218
 }
226
 }
227
+
219
 .progress-count {
228
 .progress-count {
220
   font-size: 26rpx;
229
   font-size: 26rpx;
221
   font-weight: 500;
230
   font-weight: 500;

+ 40 - 27
src/pages/eikonStatistics/components/standard-execution.vue

@@ -112,8 +112,8 @@ export default {
112
         rankCount: 0
112
         rankCount: 0
113
       },
113
       },
114
       // switch-tab配置
114
       // switch-tab配置
115
-      inspectionSwitchValue: 0,
116
-      testSwitchValue: 0,
115
+      inspectionSwitchValue: 'station',
116
+      testSwitchValue: 'station',
117
 
117
 
118
       // 测试排名数据
118
       // 测试排名数据
119
       testRanking: {
119
       testRanking: {
@@ -136,22 +136,29 @@ export default {
136
       isZhanZhang: state => state.eikonLevel.isZhanZhang,
136
       isZhanZhang: state => state.eikonLevel.isZhanZhang,
137
       currentLevel: state => state.eikonLevel.currentLevel,
137
       currentLevel: state => state.eikonLevel.currentLevel,
138
     }),
138
     }),
139
-    ...mapGetters('eikonLevel', ['isZhanZhang', 'isPersonal']),
139
+    ...mapGetters('eikonLevel', ['isZhanZhang', 'isPersonal', 'isJingLi', 'isKeZhang', 'isBanZuZhang']),
140
     switchOptions() {
140
     switchOptions() {
141
-      if (this.isPersonal) {
141
+      if (this.isKeZhang) {
142
         return [
142
         return [
143
-          { value: 0, label: '全站' },
144
-          { value: 1, label: '本科' },
145
-          { value: 2, label: '本班' }
143
+          { value: 'station', label: '全站' },
144
+          { value: 'brigade', label: '本大队' },
146
         ]
145
         ]
147
       }
146
       }
148
       if (this.isBanZuZhang) {
147
       if (this.isBanZuZhang) {
149
         return [
148
         return [
150
-          { value: 0, label: '全站' },
151
-          { value: 1, label: '本科' },
152
-
149
+          { value: 'station', label: '全站' },
150
+          { value: 'brigade', label: '本大队' },
151
+        ]
152
+      }
153
+      if (this.isPersonal) {
154
+        return [
155
+          { value: 'station', label: '全站' },
156
+          { value: 'brigade', label: '本大队' },
157
+          { value: 'department', label: '本主管' },
158
+          { value: 'team', label: '本班' }
153
         ]
159
         ]
154
       }
160
       }
161
+
155
       return []
162
       return []
156
     },
163
     },
157
     percentage() {
164
     percentage() {
@@ -224,9 +231,9 @@ export default {
224
       ]
231
       ]
225
       this.rectificationTotal = onTimeCompletedCount + overTimeCompletedCount
232
       this.rectificationTotal = onTimeCompletedCount + overTimeCompletedCount
226
     },
233
     },
227
-    
228
 
234
 
229
-   
235
+
236
+
230
 
237
 
231
     // 初始化问题分布雷达图
238
     // 初始化问题分布雷达图
232
     initIssueRadarChart() {
239
     initIssueRadarChart() {
@@ -449,10 +456,10 @@ export default {
449
           return {
456
           return {
450
             value: values,
457
             value: values,
451
             name: dept.deptName,
458
             name: dept.deptName,
452
-           
459
+
453
             // lineStyle: {
460
             // lineStyle: {
454
             //   color: color.line,
461
             //   color: color.line,
455
-           
462
+
456
             // },
463
             // },
457
             // itemStyle: {
464
             // itemStyle: {
458
             //   color: color.line
465
             //   color: color.line
@@ -598,25 +605,30 @@ export default {
598
       const departmentTotal = portraitData.departmentTotal || 0;
605
       const departmentTotal = portraitData.departmentTotal || 0;
599
       const teamRanking = portraitData.teamRanking || 0;
606
       const teamRanking = portraitData.teamRanking || 0;
600
       const teamTotal = portraitData.teamTotal || 0;
607
       const teamTotal = portraitData.teamTotal || 0;
601
-
602
-      if (this.inspectionSwitchValue == 0) {
608
+      const brigadeTotal = portraitData.brigadeTotal || 0;
609
+      const brigadeRanking = portraitData.brigadeRanking || 0;
610
+      console.log('portraitData:', this.portraitData);
611
+      if (this.inspectionSwitchValue == 'station') {
603
         this.rankData = {
612
         this.rankData = {
604
           rank: stationRanking,
613
           rank: stationRanking,
605
           rankCount: stationTotal
614
           rankCount: stationTotal
606
         }
615
         }
607
-      } else if (this.inspectionSwitchValue == 1) {
616
+      } else if (this.inspectionSwitchValue == 'brigade') {
617
+        this.rankData = {
618
+          rank: brigadeRanking,
619
+          rankCount: brigadeTotal
620
+        }
621
+      } else if (this.inspectionSwitchValue == 'department') {
608
         this.rankData = {
622
         this.rankData = {
609
           rank: departmentRanking,
623
           rank: departmentRanking,
610
           rankCount: departmentTotal
624
           rankCount: departmentTotal
611
         }
625
         }
612
-      } else if (this.inspectionSwitchValue == 2) {
626
+      } else if (this.inspectionSwitchValue == 'team') {
613
         this.rankData = {
627
         this.rankData = {
614
           rank: teamRanking,
628
           rank: teamRanking,
615
           rankCount: teamTotal
629
           rankCount: teamTotal
616
         }
630
         }
617
       }
631
       }
618
-
619
-
620
     },
632
     },
621
 
633
 
622
     // 测试排名切换处理
634
     // 测试排名切换处理
@@ -626,27 +638,28 @@ export default {
626
       const { rankingStats } = this.profileData || {};
638
       const { rankingStats } = this.profileData || {};
627
 
639
 
628
 
640
 
629
-      if (this.testSwitchValue == 0) {
641
+      if (this.testSwitchValue == 'station') {
630
         this.testRankData = {
642
         this.testRankData = {
631
           rank: rankingStats?.siteRanking || 0,
643
           rank: rankingStats?.siteRanking || 0,
632
           rankCount: this.isKeZhang ? rankingStats?.siteTotalDepts || 0 : rankingStats?.siteTotalUsers || 0
644
           rankCount: this.isKeZhang ? rankingStats?.siteTotalDepts || 0 : rankingStats?.siteTotalUsers || 0
633
         }
645
         }
634
-      } else if (this.testSwitchValue == 1) {
646
+      } else if (this.testSwitchValue == 'brigade') {
647
+        this.testRankData = {
648
+          rank: rankingStats?.deptRanking || 0,
649
+          rankCount: rankingStats?.deptTotalTeams || 0
650
+        }
651
+      } else if (this.testSwitchValue == 'department') {
635
         this.testRankData = {
652
         this.testRankData = {
636
           rank: rankingStats?.deptRanking || 0,
653
           rank: rankingStats?.deptRanking || 0,
637
           rankCount: rankingStats?.deptTotalUsers || 0
654
           rankCount: rankingStats?.deptTotalUsers || 0
638
         }
655
         }
639
-      } else if (this.testSwitchValue == 2) {
656
+      } else if (this.testSwitchValue == 'team') {
640
         this.testRankData = {
657
         this.testRankData = {
641
           rank: rankingStats?.teamRanking || 0,
658
           rank: rankingStats?.teamRanking || 0,
642
           rankCount: rankingStats?.teamTotalUsers || 0
659
           rankCount: rankingStats?.teamTotalUsers || 0
643
         }
660
         }
644
       }
661
       }
645
     },
662
     },
646
-
647
-
648
-
649
-
650
   }
663
   }
651
 }
664
 }
652
 </script>
665
 </script>

+ 1 - 1
src/pages/eikonStatistics/components/topInfo.vue

@@ -256,7 +256,7 @@ export default {
256
 <style lang="scss" scoped>
256
 <style lang="scss" scoped>
257
 .top-info-wrapper {
257
 .top-info-wrapper {
258
     width: 100%;
258
     width: 100%;
259
-    padding: 40rpx;
259
+    padding: 40rpx 40rpx 0 40rpx ;
260
 }
260
 }
261
 
261
 
262
 .top-info-container {
262
 .top-info-container {

+ 11 - 8
src/pages/eikonStatistics/index.vue

@@ -3,14 +3,15 @@
3
     @scroll-end="handleScrollEnd">
3
     @scroll-end="handleScrollEnd">
4
     <div class="eikon-statistics-container">
4
     <div class="eikon-statistics-container">
5
       <!-- 个人模式显示选项卡 -->
5
       <!-- 个人模式显示选项卡 -->
6
-      <h-tabs v-if="hasTabs" v-model="currentTab" :tabs="tabList" value-key="type" label-key="title"
6
+      <h-tabs v-if="hasTabs && !hasOldLevel" v-model="currentTab" :tabs="tabList" value-key="type" label-key="title"
7
         @change="handleTabChange" class="h-tabs-fixed" />
7
         @change="handleTabChange" class="h-tabs-fixed" />
8
 
8
 
9
       <topInfo @department-change="handleDepartmentChange"
9
       <topInfo @department-change="handleDepartmentChange"
10
-        :class="['top-info-fixed', hasTabs ? 'with-tabs' : 'without-tabs']" :currentTab="currentTab" />
10
+        :class="['top-info-fixed', (hasTabs && !hasOldLevel) ? 'with-tabs' : 'without-tabs']"
11
+        :currentTab="currentTab" />
11
 
12
 
12
       <!-- 总体概览和详细内容区域 -->
13
       <!-- 总体概览和详细内容区域 -->
13
-      <div class="content-section" :class="hasTabs ? 'with-tabs' : 'without-tabs'">
14
+      <div class="content-section" :class="(hasTabs && !hasOldLevel) ? 'with-tabs' : 'without-tabs'">
14
         <!-- 总体概览 -->
15
         <!-- 总体概览 -->
15
         <div class="overview-section">
16
         <div class="overview-section">
16
           <div class="section-title">总体概览</div>
17
           <div class="section-title">总体概览</div>
@@ -148,9 +149,11 @@ export default {
148
       let isZhanZhang = this.userRoles && this.userRoles.includes('test')
149
       let isZhanZhang = this.userRoles && this.userRoles.includes('test')
149
       let isKeZhang = this.userRoles && this.userRoles.includes('kezhang')
150
       let isKeZhang = this.userRoles && this.userRoles.includes('kezhang')
150
       let isZhiJian = this.userRoles && this.userRoles.includes('zhijianke')
151
       let isZhiJian = this.userRoles && this.userRoles.includes('zhijianke')
151
-
152
-      if (isKeZhang || isZhanZhang ||isZhiJian) {
153
-        this.initLevel({ level: isKeZhang ? 'department' : 'station', levelId: isKeZhang ? this.userInfo.departmentId : this.userInfo.stationId })
152
+      let isJingLi = this.userRoles && this.userRoles.includes('jingli')
153
+      let level = isKeZhang ? 'department' : isJingLi ? 'brigade' : 'station';
154
+      let levelId = isKeZhang ? this.userInfo.departmentId : isJingLi ? this.userInfo.brigadeId : this.userInfo.stationId;
155
+      if (isKeZhang || isZhanZhang || isZhiJian || isJingLi) {
156
+        this.initLevel({ level: level, levelId: levelId })
154
       } else {
157
       } else {
155
         this.initLevel({ level: 'personal', levelId: this.userInfo.userId })
158
         this.initLevel({ level: 'personal', levelId: this.userInfo.userId })
156
       }
159
       }
@@ -265,7 +268,7 @@ export default {
265
   right: 0;
268
   right: 0;
266
   z-index: 998;
269
   z-index: 998;
267
   background: #ffffff;
270
   background: #ffffff;
268
- 
271
+
269
 }
272
 }
270
 
273
 
271
 // 当h-tabs显示时,topInfo的top位置
274
 // 当h-tabs显示时,topInfo的top位置
@@ -286,7 +289,7 @@ export default {
286
 
289
 
287
 // 当h-tabs显示时,content-section的margin-top
290
 // 当h-tabs显示时,content-section的margin-top
288
 .content-section.with-tabs {
291
 .content-section.with-tabs {
289
-  margin-top: 290rpx;
292
+  margin-top: 320rpx;
290
 }
293
 }
291
 
294
 
292
 // 当h-tabs不显示时,content-section的margin-top
295
 // 当h-tabs不显示时,content-section的margin-top