Selaa lähdekoodia

feat(图表): 添加图表选项合并控制参数

refactor(风险隐患): 新增异常查获统计文本处理函数

fix(质量分析): 修正部门类型映射并清理图表数据
huoyi 1 viikko sitten
vanhempi
commit
5b2f66699a

+ 3 - 3
src/hooks/chart.js

@@ -17,14 +17,14 @@ export function useEcharts(domRef) {
17
     }
17
     }
18
   };
18
   };
19
 
19
 
20
-  const setOption = (option) => {
20
+  const setOption = (option, notMerge = false) => {
21
     if (!chartInstance.value && !initialized.value) {
21
     if (!chartInstance.value && !initialized.value) {
22
       initChart();
22
       initChart();
23
     }
23
     }
24
     if (!chartInstance.value) return;
24
     if (!chartInstance.value) return;
25
-    
25
+
26
     try {
26
     try {
27
-      chartInstance.value.setOption(option);
27
+      chartInstance.value.setOption(option, notMerge);
28
       // 仅在需要时调整大小,避免重复调用
28
       // 仅在需要时调整大小,避免重复调用
29
       if (domRef.value && domRef.value.offsetHeight > 0) {
29
       if (domRef.value && domRef.value.offsetHeight > 0) {
30
         chartInstance.value.resize();
30
         chartInstance.value.resize();

+ 5 - 11
src/views/assistant/components/qaAnalysis.vue

@@ -119,7 +119,8 @@ const processQueryParams = (queryParams) => {
119
   // 根据部门类型添加相应的参数
119
   // 根据部门类型添加相应的参数
120
   const selectedDept = props.selectedDeptObject
120
   const selectedDept = props.selectedDeptObject
121
   const { deptType = "", id } = selectedDept ? selectedDept : { deptType: "", id: "" }
121
   const { deptType = "", id } = selectedDept ? selectedDept : { deptType: "", id: "" }
122
-  processedParams.scopeType = deptType === 'STATION' ? 'STATION' : deptType == 'BRIGADE' ? 'BRIGADE' : deptType == 'DEPARTMENT' ? 'DEPT' : deptType == 'TEAMS' ? 'TEAM' : deptType == 'USER' ? 'USER' : ''
122
+  
123
+  processedParams.scopeType = deptType === 'STATION' ? 'STATION' : deptType == 'BRIGADE' ? 'BRIGADE' : deptType == 'MANAGER' ? 'MANAGER' : deptType == 'TEAMS' ? 'TEAM' : deptType == 'USER' ? 'USER' : ''
123
   processedParams.scopeId = id
124
   processedParams.scopeId = id
124
   delete processedParams.deptId;
125
   delete processedParams.deptId;
125
   delete processedParams.teamId;
126
   delete processedParams.teamId;
@@ -329,6 +330,7 @@ const fetchCompletionTrendData = async () => {
329
         width: 3
330
         width: 3
330
       },
331
       },
331
     }))
332
     }))
333
+    
332
 
334
 
333
     // 更新答题完成趋势图表
335
     // 更新答题完成趋势图表
334
     setCompletionTrendOption({
336
     setCompletionTrendOption({
@@ -374,7 +376,7 @@ const fetchCompletionTrendData = async () => {
374
       xAxis: {
376
       xAxis: {
375
         type: 'category',
377
         type: 'category',
376
         boundaryGap: false,
378
         boundaryGap: false,
377
-        data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
379
+        data: []
378
       },
380
       },
379
       yAxis: {
381
       yAxis: {
380
         type: 'value',
382
         type: 'value',
@@ -382,15 +384,7 @@ const fetchCompletionTrendData = async () => {
382
         max: 100
384
         max: 100
383
       },
385
       },
384
       series: [
386
       series: [
385
-        {
386
-          name: '完成率',
387
-          type: 'line',
388
-          smooth: true,
389
-          data: [85, 88, 92, 90, 87, 89, 91, 93, 95, 94, 92, 90],
390
-          itemStyle: {
391
-            color: '#5470c6'
392
-          }
393
-        }
387
+        
394
       ]
388
       ]
395
     });
389
     });
396
   }
390
   }

+ 12 - 1
src/views/assistant/components/riskHazard.vue

@@ -476,6 +476,17 @@ const processQueryParams = (queryParams) => {
476
   }
476
   }
477
   return processedParams
477
   return processedParams
478
 }
478
 }
479
+const handleAbnormalCaptureStats = (data) => {
480
+  const { higList, lowList } = data;
481
+  let first = !!higList && higList.map((item) => item.departmentName).length > 0 ? `${higList.map((item) => item.departmentName).join("、")}查获违禁品数量显著高于整体水平` : '';
482
+  let second = !!lowList && lowList.map((item) => item.departmentName).length > 0 ? `${lowList.map((item) => item.departmentName).join("、")}查获违禁品数量显著低于整体水平` : '';
483
+  return `${first}${!!second ? ',' : first && second ? '。' : ''}${second}`
484
+}
485
+const handlePoliceTransferStats = (data) => {
486
+  const { totalQuantity, brigadeRankList } = data;
487
+  const topDepartment = brigadeRankList.map(item => item.brigadeName).join('、')
488
+  return `移交公安的违禁品数量共${totalQuantity}件,主要集中于${topDepartment}。`
489
+}
479
 
490
 
480
 // 调用API获取风险隐患数据
491
 // 调用API获取风险隐患数据
481
 const fetchRiskHazardData = async (queryParams) => {
492
 const fetchRiskHazardData = async (queryParams) => {
@@ -540,7 +551,7 @@ const fetchRiskHazardData = async (queryParams) => {
540
       abnormalCaptureData.value = abnormalSeizureResponse?.data || []
551
       abnormalCaptureData.value = abnormalSeizureResponse?.data || []
541
       // 12. 可能异常查获统计数据(描述卡片文本)
552
       // 12. 可能异常查获统计数据(描述卡片文本)
542
       const abnormalSeizureStatsResponse = await getAbnormalSeizureStats({ ...processedParams, ...otherParams })
553
       const abnormalSeizureStatsResponse = await getAbnormalSeizureStats({ ...processedParams, ...otherParams })
543
-      // console.log('可能异常查获统计数据:', abnormalSeizureStatsResponse,isStationType.value)
554
+       console.log('可能异常查获统计数据:', abnormalSeizureStatsResponse,isStationType.value)
544
       // debugger
555
       // debugger
545
       abnormalCaptureStats.value = handleAbnormalCaptureStats(abnormalSeizureStatsResponse?.data)
556
       abnormalCaptureStats.value = handleAbnormalCaptureStats(abnormalSeizureStatsResponse?.data)
546
     } else {
557
     } else {