huoyi дней назад: 3
Родитель
Сommit
483cdf38fd
1 измененных файлов с 27 добавлено и 22 удалено
  1. 27 22
      src/views/assistant/components/riskHazard.vue

+ 27 - 22
src/views/assistant/components/riskHazard.vue

@@ -474,7 +474,18 @@ const processQueryParams = (queryParams) => {
474 474
     processedParams.chainRatio = true
475 475
     processedParams.yearOnYear = true
476 476
   }
477
-  return processedParams
477
+  const selectedDept = props.selectedDeptObject
478
+  const { deptType = "", id } = selectedDept ? selectedDept : { deptType: "", id: "" }
479
+
480
+
481
+  let otherParams = {
482
+    ...(deptType == 'BRIGADE' ? { brigadeId: id } : {}),
483
+    ...(deptType == 'MANAGER' ? { departmentId: id } : {}),
484
+    ...(deptType == 'TEAMS' ? { teamId: id } : {}),
485
+    ...(deptType == 'USER' ? { userId: id } : {})
486
+  }
487
+  delete processedParams.deptId;
488
+  return { ...processedParams, ...otherParams }
478 489
 }
479 490
 const handleAbnormalCaptureStats = (data) => {
480 491
   const { higList, lowList } = data;
@@ -493,65 +504,59 @@ const fetchRiskHazardData = async (queryParams) => {
493 504
   try {
494 505
     // 处理query参数
495 506
     const processedParams = processQueryParams(queryParams)
496
-    const selectedDept = props.selectedDeptObject
497
-    const { deptType = "", id } = selectedDept ? selectedDept : { deptType: "", id: "" }
498
-    let otherParams = {
499
-      ...(deptType == 'BRIGADE' ? { brigadeId: id } : {}),
500
-      ...(deptType == 'DEPARTMENT' ? { departmentId: id } : {}),
501
-      ...(deptType == 'TEAMS' ? { teamId: id } : {}),
502
-      ...(deptType == 'USER' ? { userId: id } : {})
503
-    }
507
+
508
+    
504 509
     // 按顺序调用六个API接口
505 510
 
506 511
     // 1. 查获违禁品类别统计
507
-    const categoryStatsResponse = await getCategoryStats({ ...processedParams, ...otherParams })
512
+    const categoryStatsResponse = await getCategoryStats(processedParams)
508 513
     console.log('查获违禁品类别统计:', categoryStatsResponse)
509 514
     categoryStatsData.value = categoryStatsResponse.data?.categoryStats || []
510 515
 
511 516
     // 2. 查获时间趋势
512
-    const seizureTimeTrendResponse = await getSeizureTimeTrend({ ...processedParams, ...otherParams })
517
+    const seizureTimeTrendResponse = await getSeizureTimeTrend(processedParams)
513 518
     console.log('查获时间趋势:', seizureTimeTrendResponse)
514 519
     seizureTimeTrendData.value = seizureTimeTrendResponse?.data || []
515 520
 
516 521
     // 3. 隐匿物品查获部位统计
517
-    const concealmentPositionStatsResponse = await getConcealmentPositionStats({ ...processedParams, ...otherParams })
522
+    const concealmentPositionStatsResponse = await getConcealmentPositionStats(processedParams)
518 523
     console.log('隐匿物品查获部位统计:', concealmentPositionStatsResponse)
519 524
     concealmentPositionStatsData.value = concealmentPositionStatsResponse?.data?.positionStats || []
520 525
 
521 526
     // 4. 大队查获排名(表格数据)
522
-    const departmentRankingResponse = await getDepartmentRanking({ ...processedParams, ...otherParams })
527
+    const departmentRankingResponse = await getDepartmentRanking(processedParams)
523 528
     console.log('大队查获排名:', departmentRankingResponse)
524 529
     departmentRankingData.value = departmentRankingResponse.data || []
525 530
 
526 531
     // 5. 查获岗位分布统计
527
-    const postCategoryStatsResponse = await getPostCategoryStats({ ...processedParams, ...otherParams })
532
+    const postCategoryStatsResponse = await getPostCategoryStats(processedParams)
528 533
     console.log('查获岗位分布统计:', postCategoryStatsResponse)
529 534
     postCategoryStatsData.value = postCategoryStatsResponse?.data?.postStats || []
530 535
 
531 536
     // 6. 查获通道TOP5(表格数据)
532
-    const channelRankingStatsResponse = await getChannelRankingStats({ ...processedParams, ...otherParams })
537
+    const channelRankingStatsResponse = await getChannelRankingStats(processedParams)
533 538
     console.log('查获通道TOP5:', channelRankingStatsResponse)
534 539
     channelRankingStatsData.value = channelRankingStatsResponse?.data?.channelRankings || []
535 540
 
536 541
     // 7. 移交公安数据
537
-    const policeDataResponse = await getPoliceData({ ...processedParams, ...otherParams })
542
+    const policeDataResponse = await getPoliceData(processedParams)
538 543
     console.log('移交公安数据:', policeDataResponse)
539 544
     policeTransferData.value = policeDataResponse?.data || []
540 545
 
541 546
     // 8. X光机漏检数据
542
-    const xrayMissCheckResponse = await getXrayMissCheck({ ...processedParams, ...otherParams })
547
+    const xrayMissCheckResponse = await getXrayMissCheck(processedParams)
543 548
     console.log('X光机漏检数据:', xrayMissCheckResponse)
544 549
     xrayMissData.value = xrayMissCheckResponse?.data || []
545 550
 
546 551
     // 9. 可能异常查获数据(只有当部门类型是STATION时才请求)
547 552
 
548 553
     if (isStationType.value || isDepartmentType.value) {
549
-      const abnormalSeizureResponse = await getAbnormalSeizureData({ ...processedParams, ...otherParams })
554
+      const abnormalSeizureResponse = await getAbnormalSeizureData(processedParams)
550 555
       console.log('可能异常查获数据:', abnormalSeizureResponse)
551 556
       abnormalCaptureData.value = abnormalSeizureResponse?.data || []
552 557
       // 12. 可能异常查获统计数据(描述卡片文本)
553
-      const abnormalSeizureStatsResponse = await getAbnormalSeizureStats({ ...processedParams, ...otherParams })
554
-       console.log('可能异常查获统计数据:', abnormalSeizureStatsResponse,isStationType.value)
558
+      const abnormalSeizureStatsResponse = await getAbnormalSeizureStats(processedParams)
559
+      console.log('可能异常查获统计数据:', abnormalSeizureStatsResponse, isStationType.value)
555 560
       // debugger
556 561
       abnormalCaptureStats.value = handleAbnormalCaptureStats(abnormalSeizureStatsResponse?.data)
557 562
     } else {
@@ -560,12 +565,12 @@ const fetchRiskHazardData = async (queryParams) => {
560 565
     }
561 566
 
562 567
     // 10. 移交公安统计数据(描述卡片文本)
563
-    const policeDataStatsResponse = await getPoliceDataStats({ ...processedParams, ...otherParams })
568
+    const policeDataStatsResponse = await getPoliceDataStats(processedParams)
564 569
     console.log('移交公安统计数据:', policeDataStatsResponse)
565 570
     policeTransferStats.value = handlePoliceTransferStats(policeDataStatsResponse?.data)
566 571
 
567 572
     // 11. X光机漏检统计数据(描述卡片文本)
568
-    const xrayMissCheckStatsResponse = await getXrayMissCheckStats({ ...processedParams, ...otherParams })
573
+    const xrayMissCheckStatsResponse = await getXrayMissCheckStats(processedParams)
569 574
     console.log('X光机漏检统计数据:', xrayMissCheckStatsResponse)
570 575
     let userName = xrayMissCheckStatsResponse?.data?.map(item => item.xrayOperatorName).join('、') || ''
571 576
     xrayMissStats.value = `X光机漏检事件主要集中于以下开机员:${userName},可针对性开展判图技能强化培训。`