Procházet zdrojové kódy

Merge branch 'ai' into dev

huoyi před 5 dny
rodič
revize
2252717398

+ 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 21
     if (!chartInstance.value && !initialized.value) {
22 22
       initChart();
23 23
     }
24 24
     if (!chartInstance.value) return;
25
-    
25
+
26 26
     try {
27
-      chartInstance.value.setOption(option);
27
+      chartInstance.value.setOption(option, notMerge);
28 28
       // 仅在需要时调整大小,避免重复调用
29 29
       if (domRef.value && domRef.value.offsetHeight > 0) {
30 30
         chartInstance.value.resize();

+ 5 - 3
src/views/assistant/components/dataBoard.vue

@@ -104,6 +104,7 @@ const currentYear = new Date().getFullYear()
104 104
 
105 105
 // 查询表单数据
106 106
 const queryForm = ref({
107
+  deptId: 100,
107 108
   dateRangeQueryType: 'YEAR',
108 109
   year: currentYear,
109 110
   quarter: '',
@@ -112,6 +113,7 @@ const queryForm = ref({
112 113
 
113 114
 // 当前查询参数(只有点击查询按钮时才更新)
114 115
 const currentQueryParams = ref({
116
+  deptId: null,
115 117
   dateRangeQueryType: 'YEAR',
116 118
   year: currentYear,
117 119
   quarter: '',
@@ -279,10 +281,10 @@ const handleExport = async () => {
279 281
     for (let i = 0; i < sectionTitles.length; i++) {
280 282
       const sectionTitle = sectionTitles[i];
281 283
       const sectionName = sectionTitle.textContent;
282
-      
284
+
283 285
       // 检查组件是否显示(通过检查父组件的显示状态)
284 286
       const componentContainer = sectionTitle.closest('.duty-organization, .quality-control, .risk-hazard, .qa-analysis');
285
-      const isComponentVisible = componentContainer && 
287
+      const isComponentVisible = componentContainer &&
286 288
         window.getComputedStyle(componentContainer).display !== 'none' &&
287 289
         componentContainer.offsetHeight > 0 &&
288 290
         componentContainer.offsetWidth > 0;
@@ -323,7 +325,7 @@ const handleExport = async () => {
323 325
           const isPanelVisible = window.getComputedStyle(panelItem).display !== 'none' &&
324 326
             panelItem.offsetHeight > 0 &&
325 327
             panelItem.offsetWidth > 0;
326
-          
328
+
327 329
           if (isPanelVisible) {
328 330
             componentPanelItems.push(panelItem);
329 331
           }

+ 5 - 2
src/views/assistant/components/dutyOrganization.vue

@@ -342,7 +342,7 @@ const fetchDutyOrganizationData = async (queryParams) => {
342 342
     if (isStationType.value) {
343 343
       //获取资质等级分布柱状图数据
344 344
       const barResponse = await getQualificationBarChart({ ...processedParams, ...calculateParams })
345
-     
345
+
346 346
       qualificationBarData.value = barResponse.data?.brigades || []
347 347
 
348 348
     } else if (isTeamsType.value) {
@@ -556,7 +556,8 @@ const attendanceBarOptions = {
556 556
   },
557 557
   legend: {
558 558
     data: ['安检一大队', '安检二大队', '安检三大队', '安检综合大队', '全站'],
559
-    top: 0
559
+    top: 0,
560
+    show: true,
560 561
   },
561 562
   grid: {
562 563
     left: '3%',
@@ -814,6 +815,7 @@ const updateAttendanceBarChart = () => {
814 815
     attendanceBarOptions.series[2].data = dept2Data
815 816
     attendanceBarOptions.series[3].data = dept3Data
816 817
     attendanceBarOptions.series[4].data = dept4Data
818
+    attendanceBarOptions.legend.show = !!isStationType.value
817 819
 
818 820
     // 重新设置图表选项
819 821
     setAttendanceOption(attendanceBarOptions)
@@ -826,6 +828,7 @@ const updateAttendanceBarChart = () => {
826 828
     attendanceBarOptions.series[1].data = []
827 829
     attendanceBarOptions.series[2].data = []
828 830
     attendanceBarOptions.series[3].data = []
831
+    attendanceBarOptions.legend.show = !!isStationType.value
829 832
     setAttendanceOption(attendanceBarOptions)
830 833
   }
831 834
 }

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

@@ -119,7 +119,8 @@ const processQueryParams = (queryParams) => {
119 119
   // 根据部门类型添加相应的参数
120 120
   const selectedDept = props.selectedDeptObject
121 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 124
   processedParams.scopeId = id
124 125
   delete processedParams.deptId;
125 126
   delete processedParams.teamId;
@@ -329,6 +330,7 @@ const fetchCompletionTrendData = async () => {
329 330
         width: 3
330 331
       },
331 332
     }))
333
+    
332 334
 
333 335
     // 更新答题完成趋势图表
334 336
     setCompletionTrendOption({
@@ -374,7 +376,7 @@ const fetchCompletionTrendData = async () => {
374 376
       xAxis: {
375 377
         type: 'category',
376 378
         boundaryGap: false,
377
-        data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
379
+        data: []
378 380
       },
379 381
       yAxis: {
380 382
         type: 'value',
@@ -382,15 +384,7 @@ const fetchCompletionTrendData = async () => {
382 384
         max: 100
383 385
       },
384 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
   }

+ 1 - 1
src/views/assistant/components/qualityControl.vue

@@ -8,7 +8,7 @@
8 8
     <!-- 四个横向均分的内容区域 -->
9 9
     <div class="four-panel-layout">
10 10
       <!-- 第一个:任务计划安排统计 -->
11
-      <div class="panel-item" v-show="!isTeamType && !isUserType">
11
+      <div class="panel-item" v-show="!isTeamType && !isUserType && !isBrigadeType">
12 12
         <div class="panel-header">
13 13
           <h3>任务计划安排统计</h3>
14 14
         </div>

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

@@ -231,7 +231,13 @@ import {
231 231
   getConcealmentPositionStats,
232 232
   getDepartmentRanking,
233 233
   getPostCategoryStats,
234
-  getChannelRankingStats
234
+  getChannelRankingStats,
235
+  getPoliceData,
236
+  getPoliceDataStats,
237
+  getXrayMissCheck,
238
+  getXrayMissCheckStats,
239
+  getAbnormalSeizureData,
240
+  getAbnormalSeizureStats
235 241
 } from '@/api/assistant/assistant.js'
236 242
 
237 243
 // 定义props接收queryForm参数
@@ -470,6 +476,17 @@ const processQueryParams = (queryParams) => {
470 476
   }
471 477
   return processedParams
472 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
+}
473 490
 
474 491
 // 调用API获取风险隐患数据
475 492
 const fetchRiskHazardData = async (queryParams) => {
@@ -516,6 +533,42 @@ const fetchRiskHazardData = async (queryParams) => {
516 533
     console.log('查获通道TOP5:', channelRankingStatsResponse)
517 534
     channelRankingStatsData.value = channelRankingStatsResponse?.data?.channelRankings || []
518 535
 
536
+    // 7. 移交公安数据
537
+    const policeDataResponse = await getPoliceData({ ...processedParams, ...otherParams })
538
+    console.log('移交公安数据:', policeDataResponse)
539
+    policeTransferData.value = policeDataResponse?.data || []
540
+
541
+    // 8. X光机漏检数据
542
+    const xrayMissCheckResponse = await getXrayMissCheck({ ...processedParams, ...otherParams })
543
+    console.log('X光机漏检数据:', xrayMissCheckResponse)
544
+    xrayMissData.value = xrayMissCheckResponse?.data || []
545
+
546
+    // 9. 可能异常查获数据(只有当部门类型是STATION时才请求)
547
+
548
+    if (isStationType.value || isDepartmentType.value) {
549
+      const abnormalSeizureResponse = await getAbnormalSeizureData({ ...processedParams, ...otherParams })
550
+      console.log('可能异常查获数据:', abnormalSeizureResponse)
551
+      abnormalCaptureData.value = abnormalSeizureResponse?.data || []
552
+      // 12. 可能异常查获统计数据(描述卡片文本)
553
+      const abnormalSeizureStatsResponse = await getAbnormalSeizureStats({ ...processedParams, ...otherParams })
554
+       console.log('可能异常查获统计数据:', abnormalSeizureStatsResponse,isStationType.value)
555
+      // debugger
556
+      abnormalCaptureStats.value = handleAbnormalCaptureStats(abnormalSeizureStatsResponse?.data)
557
+    } else {
558
+      abnormalCaptureData.value = []
559
+      abnormalCaptureStats.value = ''
560
+    }
561
+
562
+    // 10. 移交公安统计数据(描述卡片文本)
563
+    const policeDataStatsResponse = await getPoliceDataStats({ ...processedParams, ...otherParams })
564
+    console.log('移交公安统计数据:', policeDataStatsResponse)
565
+    policeTransferStats.value = handlePoliceTransferStats(policeDataStatsResponse?.data)
566
+
567
+    // 11. X光机漏检统计数据(描述卡片文本)
568
+    const xrayMissCheckStatsResponse = await getXrayMissCheckStats({ ...processedParams, ...otherParams })
569
+    console.log('X光机漏检统计数据:', xrayMissCheckStatsResponse)
570
+    let userName = xrayMissCheckStatsResponse?.data?.map(item => item.xrayOperatorName).join('、') || ''
571
+    xrayMissStats.value = `X光机漏检事件主要集中于以下开机员:${userName},可针对性开展判图技能强化培训。`
519 572
     // 更新图表和表格数据
520 573
     updateChartsWithData()
521 574