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
     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 - 3
src/views/assistant/components/dataBoard.vue

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

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

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

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

@@ -8,7 +8,7 @@
8
     <!-- 四个横向均分的内容区域 -->
8
     <!-- 四个横向均分的内容区域 -->
9
     <div class="four-panel-layout">
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
         <div class="panel-header">
12
         <div class="panel-header">
13
           <h3>任务计划安排统计</h3>
13
           <h3>任务计划安排统计</h3>
14
         </div>
14
         </div>

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

@@ -231,7 +231,13 @@ import {
231
   getConcealmentPositionStats,
231
   getConcealmentPositionStats,
232
   getDepartmentRanking,
232
   getDepartmentRanking,
233
   getPostCategoryStats,
233
   getPostCategoryStats,
234
-  getChannelRankingStats
234
+  getChannelRankingStats,
235
+  getPoliceData,
236
+  getPoliceDataStats,
237
+  getXrayMissCheck,
238
+  getXrayMissCheckStats,
239
+  getAbnormalSeizureData,
240
+  getAbnormalSeizureStats
235
 } from '@/api/assistant/assistant.js'
241
 } from '@/api/assistant/assistant.js'
236
 
242
 
237
 // 定义props接收queryForm参数
243
 // 定义props接收queryForm参数
@@ -470,6 +476,17 @@ const processQueryParams = (queryParams) => {
470
   }
476
   }
471
   return processedParams
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
 // 调用API获取风险隐患数据
491
 // 调用API获取风险隐患数据
475
 const fetchRiskHazardData = async (queryParams) => {
492
 const fetchRiskHazardData = async (queryParams) => {
@@ -516,6 +533,42 @@ const fetchRiskHazardData = async (queryParams) => {
516
     console.log('查获通道TOP5:', channelRankingStatsResponse)
533
     console.log('查获通道TOP5:', channelRankingStatsResponse)
517
     channelRankingStatsData.value = channelRankingStatsResponse?.data?.channelRankings || []
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
     updateChartsWithData()
573
     updateChartsWithData()
521
 
574