|
|
@@ -57,6 +57,17 @@
|
|
57
|
57
|
<!-- TotalDetail组件 -->
|
|
58
|
58
|
<TotalDetail :homePageWholeData="homePageWholeData" :start-date="startDate" :end-date="endDate"
|
|
59
|
59
|
:time-range="selectedTimeRange" :selectedRole="selectedRole" />
|
|
|
60
|
+
|
|
|
61
|
+
|
|
|
62
|
+ <!-- QualityControlAnalysis组件 -->
|
|
|
63
|
+ <QualityControlAnalysis v-if="role.includes('zhijianke') || role.includes('test')"
|
|
|
64
|
+ :checkProblemDistributionData="checkProblemDistributionData"
|
|
|
65
|
+ :accuracyAnalysisData="accuracyAnalysisData" :prohibitedTop3Data="prohibitedTop3Data"
|
|
|
66
|
+ :concealmentPositionTop1Data="concealmentPositionTop1Data" />
|
|
|
67
|
+
|
|
|
68
|
+ <!-- PerformanceAnalysis组件 -->
|
|
|
69
|
+ <PerformanceAnalysis v-if="role.includes('zhijianke') || role.includes('test')"
|
|
|
70
|
+ :performanceData="performanceData" />
|
|
60
|
71
|
</div>
|
|
61
|
72
|
</view>
|
|
62
|
73
|
</template>
|
|
|
@@ -64,6 +75,8 @@
|
|
64
|
75
|
<script>
|
|
65
|
76
|
import HomeContainer from "@/components/HomeContainer.vue";
|
|
66
|
77
|
import UserInfo from "@/components/UserInfo.vue";
|
|
|
78
|
+import QualityControlAnalysis from "@/pages/home-new/components/qualityControlAnalysis.vue";
|
|
|
79
|
+import PerformanceAnalysis from "@/pages/home-new/components/performanceAnalysis.vue";
|
|
67
|
80
|
import HeadTitle from "@/components/HeadTitle.vue";
|
|
68
|
81
|
import Notice from "@/pages/home/components/notice.vue";
|
|
69
|
82
|
import SelectTag from "@/components/select-tag/select-tag.vue";
|
|
|
@@ -73,7 +86,7 @@ import { getUserProfile, getAppListByRoleId, getAppList } from "@/api/system/use
|
|
73
|
86
|
import { getAttendanceList } from "@/api/attendance/attendance"
|
|
74
|
87
|
import { getUnreadCount } from "@/api/check/checkTask"
|
|
75
|
88
|
import { checkRolePermission } from "@/utils/common.js";
|
|
76
|
|
-import { getHomePage, getSeizureReport, getAttendanceStats, getAccuracyStatistics, getSeizureRanking, getCheckRanking, getHomePageWhole, selectUserListByRoleKey } from "@/api/home-new/home-new";
|
|
|
89
|
+import { getHomePage, getSeizureReport, getAttendanceStats, getAccuracyStatistics, getSeizureRanking, getCheckRanking, getHomePageWhole, selectUserListByRoleKey, getMetrics, getCheckProblemDistribution, getAccuracyAnalysis, getProhibitedTop3, getConcealmentPositionTop1 } from "@/api/home-new/home-new";
|
|
77
|
90
|
// 导入uni-datetime-picker组件
|
|
78
|
91
|
import uniDatetimePicker from "@/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue";
|
|
79
|
92
|
|
|
|
@@ -86,6 +99,8 @@ export default {
|
|
86
|
99
|
SelectTag,
|
|
87
|
100
|
TypeDetail,
|
|
88
|
101
|
TotalDetail,
|
|
|
102
|
+ QualityControlAnalysis,
|
|
|
103
|
+ PerformanceAnalysis,
|
|
89
|
104
|
uniDatetimePicker
|
|
90
|
105
|
},
|
|
91
|
106
|
data() {
|
|
|
@@ -140,6 +155,16 @@ export default {
|
|
140
|
155
|
accuracyStatistics: {},
|
|
141
|
156
|
homePageWholeData: [],
|
|
142
|
157
|
subTitleText: '',
|
|
|
158
|
+ // 绩效分析数据
|
|
|
159
|
+ performanceData: [],
|
|
|
160
|
+ // 检查问题分布数据
|
|
|
161
|
+ checkProblemDistributionData: {},
|
|
|
162
|
+ // 类型详情数据
|
|
|
163
|
+ accuracyAnalysisData: {},
|
|
|
164
|
+ // 违禁品TOP3数据
|
|
|
165
|
+ prohibitedTop3Data: [],
|
|
|
166
|
+ // 隐匿重点部位TOP1数据
|
|
|
167
|
+ concealmentPositionTop1Data: [],
|
|
143
|
168
|
}
|
|
144
|
169
|
},
|
|
145
|
170
|
computed: {
|
|
|
@@ -400,7 +425,12 @@ export default {
|
|
400
|
425
|
this.fetchAccuracyStatistics(), // 抽问抽答数据
|
|
401
|
426
|
this.getRank(), // 排名数据
|
|
402
|
427
|
this.getHomePageWholeData(), // 首页整体数据
|
|
403
|
|
- this.getTodayOnDutyKeZhang() // 今日上岗科长信息
|
|
|
428
|
+ this.getTodayOnDutyKeZhang(), // 今日上岗科长信息
|
|
|
429
|
+ this.getPerformanceData(), // 绩效分析数据
|
|
|
430
|
+ this.getCheckProblemDistributionData(), // 检查问题分布数据
|
|
|
431
|
+ this.getAccuracyAnalysis(), // 正确率分析数据
|
|
|
432
|
+ this.getProhibitedTop3Data(), // 违禁品TOP3数据
|
|
|
433
|
+ this.getConcealmentPositionTop1Data() // 隐匿重点部位TOP1数据
|
|
404
|
434
|
]);
|
|
405
|
435
|
|
|
406
|
436
|
// 检查每个接口的请求结果
|
|
|
@@ -412,7 +442,12 @@ export default {
|
|
412
|
442
|
'fetchAccuracyStatistics',
|
|
413
|
443
|
'getRank',
|
|
414
|
444
|
'getHomePageWholeData',
|
|
415
|
|
- 'getTodayOnDutyKeZhang'
|
|
|
445
|
+ 'getTodayOnDutyKeZhang',
|
|
|
446
|
+ 'getPerformanceData',
|
|
|
447
|
+ 'getCheckProblemDistribution',
|
|
|
448
|
+ 'getAccuracyAnalysis',
|
|
|
449
|
+ 'getProhibitedTop3Data',
|
|
|
450
|
+ 'getConcealmentPositionTop1Data'
|
|
416
|
451
|
];
|
|
417
|
452
|
|
|
418
|
453
|
if (result.status === 'rejected') {
|
|
|
@@ -428,7 +463,137 @@ export default {
|
|
428
|
463
|
throw error;
|
|
429
|
464
|
}
|
|
430
|
465
|
},
|
|
|
466
|
+ // 获取检查问题分布数据
|
|
|
467
|
+ async getCheckProblemDistributionData() {
|
|
|
468
|
+ return new Promise((resolve, reject) => {
|
|
|
469
|
+ const { startDate, endDate } = this.calculateDateRange(this.selectedTimeRange);
|
|
|
470
|
+
|
|
|
471
|
+ const params = {
|
|
|
472
|
+ startDate: startDate,
|
|
|
473
|
+ endDate: endDate
|
|
|
474
|
+ };
|
|
|
475
|
+
|
|
|
476
|
+ getCheckProblemDistribution(params).then(res => {
|
|
|
477
|
+ if (res && res.data) {
|
|
|
478
|
+ console.log('检查问题分布数据:', res.data);
|
|
|
479
|
+ this.checkProblemDistributionData = res.data;
|
|
|
480
|
+ resolve(res.data);
|
|
|
481
|
+ } else {
|
|
|
482
|
+ this.checkProblemDistributionData = {};
|
|
|
483
|
+ resolve(null);
|
|
|
484
|
+ }
|
|
|
485
|
+ }).catch(error => {
|
|
|
486
|
+ console.error('获取检查问题分布数据失败:', error);
|
|
|
487
|
+ this.checkProblemDistributionData = {};
|
|
|
488
|
+ reject(error);
|
|
|
489
|
+ });
|
|
|
490
|
+ });
|
|
|
491
|
+ },
|
|
|
492
|
+
|
|
|
493
|
+ // 获取正确率分析数据
|
|
|
494
|
+ getAccuracyAnalysis() {
|
|
|
495
|
+ return new Promise((resolve, reject) => {
|
|
|
496
|
+ const { startDate, endDate } = this.calculateDateRange(this.selectedTimeRange);
|
|
|
497
|
+
|
|
|
498
|
+ const params = {
|
|
|
499
|
+ startDate: startDate,
|
|
|
500
|
+ endDate: endDate
|
|
|
501
|
+ };
|
|
|
502
|
+
|
|
|
503
|
+ getAccuracyAnalysis(params).then(res => {
|
|
|
504
|
+ if (res && res.data) {
|
|
|
505
|
+ console.log('正确率分析数据:', res.data);
|
|
|
506
|
+ this.accuracyAnalysisData = res.data;
|
|
|
507
|
+ resolve(res.data);
|
|
|
508
|
+ } else {
|
|
|
509
|
+ resolve(null);
|
|
|
510
|
+ }
|
|
|
511
|
+ }).catch(error => {
|
|
|
512
|
+ console.error('获取正确率分析数据失败:', error);
|
|
|
513
|
+ reject(error);
|
|
|
514
|
+ });
|
|
|
515
|
+ });
|
|
|
516
|
+ },
|
|
|
517
|
+ // 获取绩效分析数据
|
|
|
518
|
+ getPerformanceData() {
|
|
|
519
|
+ return new Promise((resolve, reject) => {
|
|
|
520
|
+ const { startDate, endDate } = this.calculateDateRange(this.selectedTimeRange);
|
|
431
|
521
|
|
|
|
522
|
+ const params = {
|
|
|
523
|
+ startTime: startDate,
|
|
|
524
|
+ endTime: endDate,
|
|
|
525
|
+ sortField: 'totalScore',
|
|
|
526
|
+ dimension: '3'
|
|
|
527
|
+ };
|
|
|
528
|
+
|
|
|
529
|
+ getMetrics(params).then(res => {
|
|
|
530
|
+
|
|
|
531
|
+ if (res && res.data) {
|
|
|
532
|
+ this.performanceData = res.data;
|
|
|
533
|
+ resolve(res.data);
|
|
|
534
|
+ } else {
|
|
|
535
|
+ resolve([]);
|
|
|
536
|
+ }
|
|
|
537
|
+ }).catch(error => {
|
|
|
538
|
+ console.error('获取绩效数据失败:', error);
|
|
|
539
|
+ reject(error);
|
|
|
540
|
+ });
|
|
|
541
|
+ });
|
|
|
542
|
+ },
|
|
|
543
|
+
|
|
|
544
|
+ // 获取违禁品TOP3数据
|
|
|
545
|
+ getProhibitedTop3Data() {
|
|
|
546
|
+ return new Promise((resolve, reject) => {
|
|
|
547
|
+ const { startDate, endDate } = this.calculateDateRange(this.selectedTimeRange);
|
|
|
548
|
+
|
|
|
549
|
+ const params = {
|
|
|
550
|
+ startDate: startDate,
|
|
|
551
|
+ endDate: endDate
|
|
|
552
|
+ };
|
|
|
553
|
+
|
|
|
554
|
+ getProhibitedTop3(params).then(res => {
|
|
|
555
|
+ if (res && res.data) {
|
|
|
556
|
+ console.log('违禁品TOP3数据:', res.data);
|
|
|
557
|
+ this.prohibitedTop3Data = res.data;
|
|
|
558
|
+ resolve(res.data);
|
|
|
559
|
+ } else {
|
|
|
560
|
+ this.prohibitedTop3Data = {};
|
|
|
561
|
+ resolve(null);
|
|
|
562
|
+ }
|
|
|
563
|
+ }).catch(error => {
|
|
|
564
|
+ console.error('获取违禁品TOP3数据失败:', error);
|
|
|
565
|
+ this.prohibitedTop3Data = {};
|
|
|
566
|
+ reject(error);
|
|
|
567
|
+ });
|
|
|
568
|
+ });
|
|
|
569
|
+ },
|
|
|
570
|
+
|
|
|
571
|
+ // 获取隐匿重点部位TOP1数据
|
|
|
572
|
+ getConcealmentPositionTop1Data() {
|
|
|
573
|
+ return new Promise((resolve, reject) => {
|
|
|
574
|
+ const { startDate, endDate } = this.calculateDateRange(this.selectedTimeRange);
|
|
|
575
|
+
|
|
|
576
|
+ const params = {
|
|
|
577
|
+ startDate: startDate,
|
|
|
578
|
+ endDate: endDate
|
|
|
579
|
+ };
|
|
|
580
|
+
|
|
|
581
|
+ getConcealmentPositionTop1(params).then(res => {
|
|
|
582
|
+ if (res && res.data) {
|
|
|
583
|
+ console.log('隐匿重点部位TOP1数据:', res.data);
|
|
|
584
|
+ this.concealmentPositionTop1Data = res.data;
|
|
|
585
|
+ resolve(res.data);
|
|
|
586
|
+ } else {
|
|
|
587
|
+ this.concealmentPositionTop1Data = [];
|
|
|
588
|
+ resolve(null);
|
|
|
589
|
+ }
|
|
|
590
|
+ }).catch(error => {
|
|
|
591
|
+ console.error('获取隐匿重点部位TOP1数据失败:', error);
|
|
|
592
|
+ this.concealmentPositionTop1Data = [];
|
|
|
593
|
+ reject(error);
|
|
|
594
|
+ });
|
|
|
595
|
+ });
|
|
|
596
|
+ },
|
|
432
|
597
|
getRank() {
|
|
433
|
598
|
return new Promise((resolve, reject) => {
|
|
434
|
599
|
let params = {};
|