ソースを参照

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

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

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

@@ -37,7 +37,8 @@ export default {
37 37
           this.memberTableData = [];
38 38
           return;
39 39
         }
40
-        
40
+
41
+
41 42
         if (this.isBanZuZhang) {
42 43
           this.handlePersonalData(newVal)
43 44
         } else {
@@ -47,6 +48,7 @@ export default {
47 48
               avgWorkingHours: `${item.avgWorkingHours}H`
48 49
             }
49 50
           })
51
+          
50 52
         }
51 53
       },
52 54
     }
@@ -56,7 +58,7 @@ export default {
56 58
       currentLevel: state => state.eikonLevel.currentLevel,
57 59
       detailData: state => state.eikonLevel.detailData,
58 60
     }),
59
-    ...mapGetters('eikonLevel', ['isBanZuZhang', 'isKeZhang', 'isZhanZhang']),
61
+    ...mapGetters('eikonLevel', ['isBanZuZhang', 'isKeZhang', 'isZhanZhang','isJingLi']),
60 62
     title() {
61 63
       if (this.currentLevel === 'team') {
62 64
         return '成员明细'
@@ -67,6 +69,9 @@ export default {
67 69
       if (this.currentLevel === 'station') {
68 70
         return '科室明细'
69 71
       }
72
+      if (this.currentLevel === 'brigade') {
73
+        return '大队明细'
74
+      }
70 75
     },
71 76
     memberTableColumns() {
72 77
       if (this.currentLevel === 'team') {
@@ -102,6 +107,17 @@ export default {
102 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 123
   methods: {
@@ -113,7 +129,7 @@ export default {
113 129
         this.memberTableData = [];
114 130
         return;
115 131
       }
116
-      
132
+
117 133
       const res = [...newVal]
118 134
 
119 135
       // 批量获取资质等级字典数据
@@ -146,6 +162,9 @@ export default {
146 162
       if (this.isZhanZhang) {
147 163
         this.changeLevel({ level: 'department', levelId: row.id })
148 164
       }
165
+      if (this.isJingLi) {
166
+        this.changeLevel({ level: 'brigade', levelId: row.id })
167
+      }
149 168
       await this.loadData()
150 169
       this.$emit('nameClick', row)
151 170
     }

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

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

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

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

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

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

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

@@ -3,14 +3,15 @@
3 3
     @scroll-end="handleScrollEnd">
4 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 7
         @change="handleTabChange" class="h-tabs-fixed" />
8 8
 
9 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 16
         <div class="overview-section">
16 17
           <div class="section-title">总体概览</div>
@@ -148,9 +149,11 @@ export default {
148 149
       let isZhanZhang = this.userRoles && this.userRoles.includes('test')
149 150
       let isKeZhang = this.userRoles && this.userRoles.includes('kezhang')
150 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 157
       } else {
155 158
         this.initLevel({ level: 'personal', levelId: this.userInfo.userId })
156 159
       }
@@ -265,7 +268,7 @@ export default {
265 268
   right: 0;
266 269
   z-index: 998;
267 270
   background: #ffffff;
268
- 
271
+
269 272
 }
270 273
 
271 274
 // 当h-tabs显示时,topInfo的top位置
@@ -286,7 +289,7 @@ export default {
286 289
 
287 290
 // 当h-tabs显示时,content-section的margin-top
288 291
 .content-section.with-tabs {
289
-  margin-top: 290rpx;
292
+  margin-top: 320rpx;
290 293
 }
291 294
 
292 295
 // 当h-tabs不显示时,content-section的margin-top