Browse Source

refactor: 统一替换角色标识banzuzhang为xiaozuzhang

调整了考勤记录和数据大屏页面中的角色关键词,将所有banzuzhang替换为xiaozuzhang,修正角色判断逻辑和接口调用的角色参数
huoyi 1 week ago
parent
commit
64da64c36e

+ 1 - 1
src/views/attendance/postRecord/index.vue

@@ -334,7 +334,7 @@ const handleTeamChange = async (newTeamId) => {
334
     try {
334
     try {
335
       const response = await selectUserListByCondition({
335
       const response = await selectUserListByCondition({
336
         deptId: newTeamId, roleKeyList: [
336
         deptId: newTeamId, roleKeyList: [
337
-          "banzuzhang","SecurityCheck"
337
+          "xiaozuzhang","SecurityCheck"
338
         ],
338
         ],
339
       })
339
       })
340
       // 获取团队成员的用户ID列表
340
       // 获取团队成员的用户ID列表

+ 4 - 4
src/views/dataBigScreen/dashboard/components/pageItems/HomePageSystemStatus.vue

@@ -74,7 +74,7 @@ const dutySectionMaster = ref('')
74
 const fetchDutySectionMaster = async () => {
74
 const fetchDutySectionMaster = async () => {
75
   try {
75
   try {
76
     // 调用接口获取今日上岗用户列表
76
     // 调用接口获取今日上岗用户列表
77
-    const response = await selectUserListByRoleKey(['kezhang']) // 假设角色标识为'kezhang'
77
+    const response = await selectUserListByRoleKey(['banzuzhang']) // 假设角色标识为'banzuzhang'
78
 
78
 
79
     const userList = response.data || []
79
     const userList = response.data || []
80
 
80
 
@@ -105,19 +105,19 @@ const currentUser = computed(() => {
105
 
105
 
106
 // 计算属性:是否为班组视图
106
 // 计算属性:是否为班组视图
107
 const isTeamView = computed(() => {
107
 const isTeamView = computed(() => {
108
-  return role.value.includes('banzuzhang') ? false : role.value.includes('banzuzhang')
108
+  return role.value.includes('xiaozuzhang') ? false : role.value.includes('xiaozuzhang')
109
 })
109
 })
110
 
110
 
111
 // 计算属性:是否为个人视图
111
 // 计算属性:是否为个人视图
112
 const isIndividualView = computed(() => {
112
 const isIndividualView = computed(() => {
113
-  return role.value.includes('banzuzhang') ? false : role.value.includes('SecurityCheck')
113
+  return role.value.includes('xiaozuzhang') ? false : role.value.includes('SecurityCheck')
114
 })
114
 })
115
 
115
 
116
 // 计算属性:出勤信息数组
116
 // 计算属性:出勤信息数组
117
 const attendanceItems = computed(() => {
117
 const attendanceItems = computed(() => {
118
 
118
 
119
   let res = {}
119
   let res = {}
120
-  if (role.value.includes('kezhang') || role.value.includes('test') || role.value.includes('zhijianke') || role.value.includes('admin')) {
120
+  if (role.value.includes('banzuzhang') || role.value.includes('test') || role.value.includes('zhijianke') || role.value.includes('admin')) {
121
     res = attendanceStats.value.stationLeaderStats || {}
121
     res = attendanceStats.value.stationLeaderStats || {}
122
     return [
122
     return [
123
       { id: 1, label: `在岗大队`, value: res?.dutyDeptName, unit: '' },
123
       { id: 1, label: `在岗大队`, value: res?.dutyDeptName, unit: '' },

+ 20 - 20
src/views/dataBigScreen/dashboard/components/pageView/HomePage.vue

@@ -78,7 +78,7 @@ const sortStates = ref({
78
 
78
 
79
 // 角色判断逻辑(移植自home-new页面)
79
 // 角色判断逻辑(移植自home-new页面)
80
 const isTeamView = computed(() => {
80
 const isTeamView = computed(() => {
81
-  return userRole.includes('banzuzhang')
81
+  return userRole.includes('xiaozuzhang')
82
 })
82
 })
83
 
83
 
84
 const isIndividualView = computed(() => {
84
 const isIndividualView = computed(() => {
@@ -86,14 +86,14 @@ const isIndividualView = computed(() => {
86
 })
86
 })
87
 
87
 
88
 // 判断是否为科长角色
88
 // 判断是否为科长角色
89
-const isKezhang = computed(() => {
90
-  return userRole.includes('kezhang')
89
+const isbanzuzhang = computed(() => {
90
+  return userRole.includes('banzuzhang')
91
 })
91
 })
92
 
92
 
93
 // 判断是否为测试角色
93
 // 判断是否为测试角色
94
 const isTestRole = computed(() => {
94
 const isTestRole = computed(() => {
95
 
95
 
96
-  return userRole.includes('test') || userRole.includes('zhijianke') || userRole.includes('kezhang') || userRole.includes('admin')
96
+  return userRole.includes('test') || userRole.includes('zhijianke') || userRole.includes('banzuzhang') || userRole.includes('admin')
97
 })
97
 })
98
 
98
 
99
 // TypeDetail组件数据(移植自home-new页面)
99
 // TypeDetail组件数据(移植自home-new页面)
@@ -102,7 +102,7 @@ const typeDetailData = computed(() => {
102
     {
102
     {
103
       title: '查获上报',
103
       title: '查获上报',
104
       linkText: isTestRole.value ? "" : seizePendingCount.value ? `${seizePendingCount.value}条数据待处理` : '',
104
       linkText: isTestRole.value ? "" : seizePendingCount.value ? `${seizePendingCount.value}条数据待处理` : '',
105
-      // link: isTeamView.value || isKezhang.value ? '/pages/myToDoList/index' : '/pages/voiceSubmissionDraft/index',
105
+      // link: isTeamView.value || isbanzuzhang.value ? '/pages/myToDoList/index' : '/pages/voiceSubmissionDraft/index',
106
       statTitle: '查获数量',
106
       statTitle: '查获数量',
107
       dividerIndex: 0,
107
       dividerIndex: 0,
108
       dataItems: getSeizeDataItems(),
108
       dataItems: getSeizeDataItems(),
@@ -154,7 +154,7 @@ const seizePendingCount = computed(() => {
154
     const { securityCheckerData } = seizeData.value;
154
     const { securityCheckerData } = seizeData.value;
155
     const { pendingCount } = securityCheckerData || {};
155
     const { pendingCount } = securityCheckerData || {};
156
     return pendingCount;
156
     return pendingCount;
157
-  } else if (userRole.includes('kezhang')) {
157
+  } else if (userRole.includes('banzuzhang')) {
158
     const { sectionMasterData } = seizeData.value;
158
     const { sectionMasterData } = seizeData.value;
159
     const { pendingCount } = sectionMasterData || {};
159
     const { pendingCount } = sectionMasterData || {};
160
     return pendingCount;
160
     return pendingCount;
@@ -372,15 +372,15 @@ const getInspectionDataItems = () => {
372
       { label: '本站平均数', value: ((stationPassRate || 0) * 100).toFixed(2) + '%', isImage: false, color: stationPassRate < personalPassRate ? '#00AE41' : '#F96060' }
372
       { label: '本站平均数', value: ((stationPassRate || 0) * 100).toFixed(2) + '%', isImage: false, color: stationPassRate < personalPassRate ? '#00AE41' : '#F96060' }
373
     ];
373
     ];
374
   } else if (isTeamView.value) {
374
   } else if (isTeamView.value) {
375
-    // banzuzhang角色:班组、本科平均数、本站平均数
375
+    // xiaozuzhang角色:班组、本科平均数、本站平均数
376
     return [
376
     return [
377
       { label: '班组', value: ((teamPassRate || 0) * 100).toFixed(2) + '%', isImage: false },
377
       { label: '班组', value: ((teamPassRate || 0) * 100).toFixed(2) + '%', isImage: false },
378
       { label: '本科平均数', value: ((departmentPassRate || 0) * 100).toFixed(2) + '%', isImage: false, color: departmentPassRate < teamPassRate ? '#00AE41' : '#F96060' },
378
       { label: '本科平均数', value: ((departmentPassRate || 0) * 100).toFixed(2) + '%', isImage: false, color: departmentPassRate < teamPassRate ? '#00AE41' : '#F96060' },
379
       { label: '本站平均数', value: ((stationPassRate || 0) * 100).toFixed(2) + '%', isImage: false, color: stationPassRate < teamPassRate ? '#00AE41' : '#F96060' }
379
       { label: '本站平均数', value: ((stationPassRate || 0) * 100).toFixed(2) + '%', isImage: false, color: stationPassRate < teamPassRate ? '#00AE41' : '#F96060' }
380
     ];
380
     ];
381
   } else
381
   } else
382
-    // if (isKezhang.value) {
383
-    //   // kezhang角色:全科、本站平均数、前三名班组(isImage: true)
382
+    // if (isbanzuzhang.value) {
383
+    //   // banzuzhang角色:全科、本站平均数、前三名班组(isImage: true)
384
     //   return [
384
     //   return [
385
     //     { label: '全科', value: ((departmentPassRate || 0) * 100).toFixed(2) + '%', isImage: false },
385
     //     { label: '全科', value: ((departmentPassRate || 0) * 100).toFixed(2) + '%', isImage: false },
386
     //     { label: '本站平均数', value: ((stationPassRate || 0) * 100).toFixed(2) + '%', isImage: false, color: stationPassRate < departmentPassRate ? '#00AE41' : '#F96060' },
386
     //     { label: '本站平均数', value: ((stationPassRate || 0) * 100).toFixed(2) + '%', isImage: false, color: stationPassRate < departmentPassRate ? '#00AE41' : '#F96060' },
@@ -418,15 +418,15 @@ const getQuestionDataItems = () => {
418
       { label: '本站平均数', value: (siteAvgAccuracy || 0) + '%', isImage: false, color: siteAvgAccuracy < personalAccuracy ? '#00AE41' : '#F96060' }
418
       { label: '本站平均数', value: (siteAvgAccuracy || 0) + '%', isImage: false, color: siteAvgAccuracy < personalAccuracy ? '#00AE41' : '#F96060' }
419
     ];
419
     ];
420
   } else if (isTeamView.value) {
420
   } else if (isTeamView.value) {
421
-    // banzuzhang角色:班组、本科平均数、本站平均数
421
+    // xiaozuzhang角色:班组、本科平均数、本站平均数
422
     return [
422
     return [
423
       { label: '班组', value: (teamAvgAccuracy || 0) + '%', isImage: false },
423
       { label: '班组', value: (teamAvgAccuracy || 0) + '%', isImage: false },
424
       { label: '本科平均数', value: (deptAvgAccuracy || 0) + '%', isImage: false, color: deptAvgAccuracy < teamAvgAccuracy ? '#00AE41' : '#F96060' },
424
       { label: '本科平均数', value: (deptAvgAccuracy || 0) + '%', isImage: false, color: deptAvgAccuracy < teamAvgAccuracy ? '#00AE41' : '#F96060' },
425
       { label: '本站平均数', value: (siteAvgAccuracy || 0) + '%', isImage: false, color: siteAvgAccuracy < teamAvgAccuracy ? '#00AE41' : '#F96060' }
425
       { label: '本站平均数', value: (siteAvgAccuracy || 0) + '%', isImage: false, color: siteAvgAccuracy < teamAvgAccuracy ? '#00AE41' : '#F96060' }
426
     ];
426
     ];
427
   } else
427
   } else
428
-    // if (isKezhang.value) {
429
-    //   // kezhang角色:全科、本站平均数、前三名班组(isImage: true)
428
+    // if (isbanzuzhang.value) {
429
+    //   // banzuzhang角色:全科、本站平均数、前三名班组(isImage: true)
430
     //   return [
430
     //   return [
431
     //     { label: '全科', value: (deptAvgAccuracy || 0) + '%', isImage: false, },
431
     //     { label: '全科', value: (deptAvgAccuracy || 0) + '%', isImage: false, },
432
     //     { label: '本站平均数', value: (siteAvgAccuracy || 0) + '%', isImage: false, color: siteAvgAccuracy < deptAvgAccuracy ? '#00AE41' : '#F96060' },
432
     //     { label: '本站平均数', value: (siteAvgAccuracy || 0) + '%', isImage: false, color: siteAvgAccuracy < deptAvgAccuracy ? '#00AE41' : '#F96060' },
@@ -467,22 +467,22 @@ const getSeizeDataItems = () => {
467
       { label: '本站平均数', value: (stationAverage && stationAverage.toFixed(2)) || 0, isImage: false, color: stationAverage < selfSeizureCount ? '#00AE41' : '#F96060' }
467
       { label: '本站平均数', value: (stationAverage && stationAverage.toFixed(2)) || 0, isImage: false, color: stationAverage < selfSeizureCount ? '#00AE41' : '#F96060' }
468
     ];
468
     ];
469
   } else if (isTeamView.value) {
469
   } else if (isTeamView.value) {
470
-    // banzuzhang角色:从teamLeaderData解构
470
+    // xiaozuzhang角色:从teamLeaderData解构
471
     const { teamLeaderData } = seizeData.value;
471
     const { teamLeaderData } = seizeData.value;
472
     const { departmentAverage, stationAverage, teamAverage } = teamLeaderData || {};
472
     const { departmentAverage, stationAverage, teamAverage } = teamLeaderData || {};
473
-    // banzuzhang角色:班组、本科平均数、本站平均数
473
+    // xiaozuzhang角色:班组、本科平均数、本站平均数
474
     return [
474
     return [
475
       { label: '班组', value: teamAverage || 0, isImage: false },
475
       { label: '班组', value: teamAverage || 0, isImage: false },
476
       { label: '本科平均数', value: departmentAverage || 0, isImage: false, color: departmentAverage < teamAverage ? '#00AE41' : '#F96060' },
476
       { label: '本科平均数', value: departmentAverage || 0, isImage: false, color: departmentAverage < teamAverage ? '#00AE41' : '#F96060' },
477
       { label: '本站平均数', value: (stationAverage && stationAverage.toFixed(2)) || 0, isImage: false, color: stationAverage < teamAverage ? '#00AE41' : '#F96060' }
477
       { label: '本站平均数', value: (stationAverage && stationAverage.toFixed(2)) || 0, isImage: false, color: stationAverage < teamAverage ? '#00AE41' : '#F96060' }
478
     ];
478
     ];
479
   } else
479
   } else
480
-    // if (isKezhang.value) {
481
-    //   // kezhang角色:从securityCheckerData解构
480
+    // if (isbanzuzhang.value) {
481
+    //   // banzuzhang角色:从securityCheckerData解构
482
     //   const { sectionMasterData } = seizeData.value;
482
     //   const { sectionMasterData } = seizeData.value;
483
     //   const { stationAverage, topThreeTeams, departmentAverage } = sectionMasterData || {}
483
     //   const { stationAverage, topThreeTeams, departmentAverage } = sectionMasterData || {}
484
 
484
 
485
-    //   // kezhang角色:全科、本站平均数、前三名班组(isImage: true)
485
+    //   // banzuzhang角色:全科、本站平均数、前三名班组(isImage: true)
486
     //   return [
486
     //   return [
487
     //     { label: '全科', value: departmentAverage || 0, isImage: false },
487
     //     { label: '全科', value: departmentAverage || 0, isImage: false },
488
     //     { label: '本站平均数', value: stationAverage?.toFixed(2) || 0, isImage: false, color: stationAverage?.toFixed(2) < departmentAverage ? '#00AE41' : '#F96060' },
488
     //     { label: '本站平均数', value: stationAverage?.toFixed(2) || 0, isImage: false, color: stationAverage?.toFixed(2) < departmentAverage ? '#00AE41' : '#F96060' },
@@ -531,7 +531,7 @@ const getRankList = () => {
531
       { label: '科级排名', current: departmentRanking || 0, total: departmentTotal || 0, percentage: departmentTotal ? ((departmentRanking || 0) / departmentTotal) * 100 : 0 },
531
       { label: '科级排名', current: departmentRanking || 0, total: departmentTotal || 0, percentage: departmentTotal ? ((departmentRanking || 0) / departmentTotal) * 100 : 0 },
532
       { label: '站级排名', current: stationRanking || 0, total: stationTotal || 0, percentage: stationTotal ? ((stationRanking || 0) / stationTotal) * 100 : 0, type: 'station' }
532
       { label: '站级排名', current: stationRanking || 0, total: stationTotal || 0, percentage: stationTotal ? ((stationRanking || 0) / stationTotal) * 100 : 0, type: 'station' }
533
     ];
533
     ];
534
-  } else if (isKezhang.value) {
534
+  } else if (isbanzuzhang.value) {
535
     return [
535
     return [
536
       { label: '站级排名', current: stationRanking || 0, total: stationTotal || 0, percentage: stationTotal ? ((stationRanking || 0) / stationTotal) * 100 : 0, type: 'station' }
536
       { label: '站级排名', current: stationRanking || 0, total: stationTotal || 0, percentage: stationTotal ? ((stationRanking || 0) / stationTotal) * 100 : 0, type: 'station' }
537
     ];
537
     ];
@@ -558,7 +558,7 @@ const getQuestionRankList = () => {
558
       { label: '科级排名', current: deptRanking?.rank || 0, total: deptRanking?.total || 0, percentage: deptRanking?.total ? ((deptRanking.rank || 0) / deptRanking.total) * 100 : 0 },
558
       { label: '科级排名', current: deptRanking?.rank || 0, total: deptRanking?.total || 0, percentage: deptRanking?.total ? ((deptRanking.rank || 0) / deptRanking.total) * 100 : 0 },
559
       { label: '站级排名', current: siteRanking?.rank || 0, total: siteRanking?.total || 0, percentage: siteRanking?.total ? ((siteRanking.rank || 0) / siteRanking.total) * 100 : 0, type: 'station' }
559
       { label: '站级排名', current: siteRanking?.rank || 0, total: siteRanking?.total || 0, percentage: siteRanking?.total ? ((siteRanking.rank || 0) / siteRanking.total) * 100 : 0, type: 'station' }
560
     ];
560
     ];
561
-  } else if (isKezhang.value) {
561
+  } else if (isbanzuzhang.value) {
562
     const { deptInSiteRanking } = accuracyStatistics.value;
562
     const { deptInSiteRanking } = accuracyStatistics.value;
563
     return [
563
     return [
564
       { label: '站级排名', current: deptInSiteRanking?.rank || 0, total: deptInSiteRanking?.total || 0, percentage: deptInSiteRanking?.total ? ((deptInSiteRanking?.rank || 0) / deptInSiteRanking?.total) * 100 : 0, type: 'station' }
564
       { label: '站级排名', current: deptInSiteRanking?.rank || 0, total: deptInSiteRanking?.total || 0, percentage: deptInSiteRanking?.total ? ((deptInSiteRanking?.rank || 0) / deptInSiteRanking?.total) * 100 : 0, type: 'station' }
@@ -588,7 +588,7 @@ const getSeizeRankList = () => {
588
       { label: '科级排名', current: departmentRanking?.currentRank || 0, total: departmentRanking?.totalItems || 0, percentage: departmentRanking?.totalItems ? ((departmentRanking.currentRank || 0) / departmentRanking.totalItems) * 100 : 0 },
588
       { label: '科级排名', current: departmentRanking?.currentRank || 0, total: departmentRanking?.totalItems || 0, percentage: departmentRanking?.totalItems ? ((departmentRanking.currentRank || 0) / departmentRanking.totalItems) * 100 : 0 },
589
       { label: '站级排名', current: stationRanking?.currentRank || 0, total: stationRanking?.totalItems || 0, percentage: stationRanking?.totalItems ? ((stationRanking.currentRank || 0) / stationRanking.totalItems) * 100 : 0, type: 'station' }
589
       { label: '站级排名', current: stationRanking?.currentRank || 0, total: stationRanking?.totalItems || 0, percentage: stationRanking?.totalItems ? ((stationRanking.currentRank || 0) / stationRanking.totalItems) * 100 : 0, type: 'station' }
590
     ];
590
     ];
591
-  } else if (isKezhang.value) {
591
+  } else if (isbanzuzhang.value) {
592
     const { sectionMasterData } = seizeData.value;
592
     const { sectionMasterData } = seizeData.value;
593
     const { stationRanking } = sectionMasterData || {};
593
     const { stationRanking } = sectionMasterData || {};
594
     // 科长、SecurityCheck角色:显示班组、科级和站级排名
594
     // 科长、SecurityCheck角色:显示班组、科级和站级排名