|
|
@@ -533,7 +533,7 @@ export default {
|
|
533
|
533
|
},
|
|
534
|
534
|
processQueryParams(queryParams) {
|
|
535
|
535
|
const processedParams = { ...queryParams }
|
|
536
|
|
-
|
|
|
536
|
+
|
|
537
|
537
|
if (processedParams.dateRangeQueryType === 'YEAR') {
|
|
538
|
538
|
processedParams.yearOnYear = true
|
|
539
|
539
|
} else {
|
|
|
@@ -541,9 +541,9 @@ export default {
|
|
541
|
541
|
processedParams.yearOnYear = true
|
|
542
|
542
|
}
|
|
543
|
543
|
|
|
544
|
|
-
|
|
545
|
|
-
|
|
546
|
|
- processedParams.deptId = ['TEAMS', 'DEPARTMENT', 'BRIGADE','MANAGER'].includes(processedParams.scopedType) ? processedParams.scopedId : '';
|
|
|
544
|
+
|
|
|
545
|
+
|
|
|
546
|
+ processedParams.deptId = ['TEAMS', 'DEPARTMENT', 'BRIGADE', 'MANAGER'].includes(processedParams.scopedType) ? processedParams.scopedId : '';
|
|
547
|
547
|
if (processedParams.scopedType == 'TEAMS') {
|
|
548
|
548
|
delete processedParams.userId;
|
|
549
|
549
|
}
|
|
|
@@ -566,6 +566,30 @@ export default {
|
|
566
|
566
|
|
|
567
|
567
|
|
|
568
|
568
|
try {
|
|
|
569
|
+ // 加载资质等级柱状图数据(如果是STATION类型)
|
|
|
570
|
+ if (this.isStationType) {
|
|
|
571
|
+ const barResponse = await getQualificationBarChart(processedParams)
|
|
|
572
|
+ if (barResponse.code === 200) {
|
|
|
573
|
+ this.qualificationBarData = barResponse.data?.brigades || []
|
|
|
574
|
+ }
|
|
|
575
|
+ }
|
|
|
576
|
+
|
|
|
577
|
+ // 加载班组人员资质等级数据(如果是TEAMS类型)
|
|
|
578
|
+ if (this.isTeamsType) {
|
|
|
579
|
+ const barResponse = await getQualificationBarChart(processedParams)
|
|
|
580
|
+
|
|
|
581
|
+ if (barResponse.code === 200) {
|
|
|
582
|
+ this.teamsQualificationData = barResponse.data?.brigades || []
|
|
|
583
|
+ }
|
|
|
584
|
+ }
|
|
|
585
|
+
|
|
|
586
|
+ if (this.isUserType) {
|
|
|
587
|
+ // 获取资质等级分布柱状图数据
|
|
|
588
|
+ const barResponse = await getQualificationBarChart(processedParams)
|
|
|
589
|
+ console.log('资质等级分布柱状图数据:', barResponse.data.brigades)
|
|
|
590
|
+ this.user = barResponse?.data?.brigades[0]
|
|
|
591
|
+ }
|
|
|
592
|
+
|
|
569
|
593
|
// 加载出勤人次分析数据
|
|
570
|
594
|
const attendanceResponse = await getCalculate(processedParams)
|
|
571
|
595
|
|
|
|
@@ -592,29 +616,6 @@ export default {
|
|
592
|
616
|
}
|
|
593
|
617
|
|
|
594
|
618
|
|
|
595
|
|
- // 加载资质等级柱状图数据(如果是STATION类型)
|
|
596
|
|
- if (this.isStationType) {
|
|
597
|
|
- const barResponse = await getQualificationBarChart(processedParams)
|
|
598
|
|
- if (barResponse.code === 200) {
|
|
599
|
|
- this.qualificationBarData = barResponse.data?.brigades || []
|
|
600
|
|
- }
|
|
601
|
|
- }
|
|
602
|
|
-
|
|
603
|
|
- // 加载班组人员资质等级数据(如果是TEAMS类型)
|
|
604
|
|
- if (this.isTeamsType) {
|
|
605
|
|
- const barResponse = await getQualificationBarChart(processedParams)
|
|
606
|
|
-
|
|
607
|
|
- if (barResponse.code === 200) {
|
|
608
|
|
- this.teamsQualificationData = barResponse.data?.brigades || []
|
|
609
|
|
- }
|
|
610
|
|
- }
|
|
611
|
|
-
|
|
612
|
|
- if (this.isUserType) {
|
|
613
|
|
- // 获取资质等级分布柱状图数据
|
|
614
|
|
- const barResponse = await getQualificationBarChart(processedParams)
|
|
615
|
|
- console.log('资质等级分布柱状图数据:', barResponse.data.brigades)
|
|
616
|
|
- this.user = barResponse?.data?.brigades[0]
|
|
617
|
|
- }
|
|
618
|
619
|
|
|
619
|
620
|
// 检查是否为用户类型
|
|
620
|
621
|
this.checkUserType()
|
|
|
@@ -901,31 +902,32 @@ export default {
|
|
901
|
902
|
|
|
902
|
903
|
// 格式化资质等级描述第二部分
|
|
903
|
904
|
formatQualificationDescriptionPart2(data) {
|
|
904
|
|
- if (!Array.isArray(data)) {
|
|
|
905
|
+ if (this.qualificationBarData.length == 0) {
|
|
905
|
906
|
return ''
|
|
906
|
907
|
}
|
|
907
|
908
|
|
|
908
|
|
- // 从资质柱状图数据中找出"一级"人员最多的主管
|
|
909
|
|
- let topDeptForLevel1 = '旅检三科'
|
|
910
|
|
- let level1Count = 25
|
|
911
|
|
- let totalDeptCount = 395
|
|
|
909
|
+ // 从资质柱状图数据中找出"一级"人员最多的科室
|
|
|
910
|
+ let topDeptForLevel1 = ''
|
|
|
911
|
+ let level1Count = 0
|
|
|
912
|
+ let totalDeptCount = 0
|
|
|
913
|
+ let allDeptNames = []
|
|
912
|
914
|
|
|
913
|
915
|
if (this.qualificationBarData && Array.isArray(this.qualificationBarData)) {
|
|
914
|
|
- const barData = this.qualificationBarData
|
|
915
|
|
-
|
|
916
|
|
- // 找出"一级"人员最多的主管
|
|
|
916
|
+ // 找出"一级"人员最多的科室
|
|
917
|
917
|
let maxLevel1Count = 0
|
|
918
|
|
- let maxDeptName = '旅检三科'
|
|
919
|
|
- let totalCountForDept = 395
|
|
|
918
|
+ let maxDeptName = ''
|
|
|
919
|
+ let totalCountForDept = 0
|
|
920
|
920
|
|
|
921
|
|
- barData.forEach(dept => {
|
|
|
921
|
+
|
|
|
922
|
+ this.qualificationBarData.forEach(dept => {
|
|
|
923
|
+ allDeptNames.push(dept.deptName)
|
|
922
|
924
|
if (dept.levelCounts && Array.isArray(dept.levelCounts)) {
|
|
923
|
925
|
const level1Data = dept.levelCounts.find(level => level.levelName === '高级')
|
|
924
|
926
|
const deptTotalCount = dept.levelCounts.reduce((sum, level) => sum + (level.count || 0), 0)
|
|
925
|
927
|
|
|
926
|
928
|
if (level1Data && level1Data.count > maxLevel1Count) {
|
|
927
|
929
|
maxLevel1Count = level1Data.count
|
|
928
|
|
- maxDeptName = dept.deptName || '未知主管'
|
|
|
930
|
+ maxDeptName = dept.deptName || ''
|
|
929
|
931
|
totalCountForDept = deptTotalCount
|
|
930
|
932
|
}
|
|
931
|
933
|
}
|
|
|
@@ -937,7 +939,7 @@ export default {
|
|
937
|
939
|
}
|
|
938
|
940
|
|
|
939
|
941
|
// 生成第二部分描述文字
|
|
940
|
|
- return `全站资质等级为"高级"的人员集中在${topDeptForLevel1}(${level1Count}人)${topDeptForLevel1}的人员规模(共${totalDeptCount}人)高于一科、二科`
|
|
|
942
|
+ return `全站资质等级为"高级"的人员集中在${topDeptForLevel1}(${level1Count}人)${topDeptForLevel1}的人员规模(共${totalDeptCount}人)高于${allDeptNames.filter(name => name !== topDeptForLevel1).join(', ')}`
|
|
941
|
943
|
},
|
|
942
|
944
|
|
|
943
|
945
|
// 检查是否为用户类型(已废弃,使用computed属性替代)
|