From 33d4704762e72acab707b6633c43521c72b01a10 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 24 七月 2025 14:54:55 +0800
Subject: [PATCH] 1.检验项要求值偏差预警数据详情

---
 src/views/statisticalCharts/inspectionItemWarning/index.vue |   88 +++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 86 insertions(+), 2 deletions(-)

diff --git a/src/views/statisticalCharts/inspectionItemWarning/index.vue b/src/views/statisticalCharts/inspectionItemWarning/index.vue
index 448aa29..22585f5 100644
--- a/src/views/statisticalCharts/inspectionItemWarning/index.vue
+++ b/src/views/statisticalCharts/inspectionItemWarning/index.vue
@@ -10,12 +10,28 @@
       <el-row>
         <el-col :span="24">
           <div class="inspection-card">
-            <div class="title">妫�楠岄」鍋忓樊棰勮鏁版嵁璇︽儏</div>
+            <div class="title">妫�楠岄」骞冲潎鍊煎亸宸璀︽暟鎹鎯�</div>
             <Echarts ref="chart"
                      :chartStyle="chartStyle"
                      :grid="grid"
                      :options="echartsOptions"
                      :series="echartsSeries"
+                     :tooltip="tooltip"
+                     :xAxis="xAxis"
+                     :yAxis="yAxis"
+                     style="height: 40vh;"></Echarts>
+          </div>
+        </el-col>
+      </el-row>
+      <el-row>
+        <el-col :span="24">
+          <div class="inspection-card">
+            <div class="title">妫�楠岄」瑕佹眰鍊煎亸宸璀︽暟鎹鎯�</div>
+            <Echarts ref="chart"
+                     :chartStyle="chartStyle"
+                     :grid="grid"
+                     :options="echartsOptions"
+                     :series="echartsSeries1"
                      :tooltip="tooltip"
                      :xAxis="xAxis"
                      :yAxis="yAxis"
@@ -138,6 +154,29 @@
           markPoint: {}
         },
       ],
+      echartsSeries1: [
+        {
+          name: '妫�娴嬪��',
+          type: 'line',
+          smooth: true,
+          tooltip: {
+            valueFormatter: function (value) {
+              return value;
+            }
+          },
+          label: {
+            show: true,
+            position: 'top',
+            formatter: function (value) {
+              return value.value;
+            },
+            distance: 14
+          },
+          data: [],
+          markArea: {},
+          markPoint: {}
+        },
+      ],
       xAxis: [
         {
           type: 'category',
@@ -186,7 +225,6 @@
     // 鏌ヨ鎶樼嚎鍥句俊鎭�
     rowClick (row) {
       selectDeviationWarning({deviationWarningId: row.deviationWarningId}).then(res => {
-        console.log('res---', res)
         if (res.data === null) {
           this.$message.warning('鏆傛棤鏁版嵁')
           return
@@ -194,7 +232,9 @@
         let lineData = []
         let xAxis = []
         let markAreas = []; // 瀛樺偍 markArea 鐨勬暟缁�
+        let markAreas1 = [];
         let markPoints = [];
+        let markPoints1 = [];
         const sampleCodeCount = {};
         res.data.forEach((item, index) => {
           lineData.push(item.testValue)
@@ -242,6 +282,39 @@
                 borderRadius: 4
               }
             });
+          }// 濡傛灉 isIssueAsked 涓� 1锛屽垯鍦ㄦ绱㈠紩澶勬坊鍔犱竴涓� markAreas1
+          if (item.isIssueAsked == 1) {
+            const startColumn = index > 0 ? xAxis[index - 1] : xAxis[index]; // 璧风偣锛氬墠涓�鍒楁垨褰撳墠鍒�
+            const endColumn = xAxis[index]; // 缁堢偣锛氬綋鍓嶅垪
+
+            markAreas.push([
+              {
+                xAxis: startColumn, // 浠庡墠涓�鍒楀紑濮�
+              },
+              {
+                xAxis: endColumn, // 鍒板綋鍓嶅垪缁撴潫
+              }
+            ]);
+            markPoints1.push({
+              name: '闂鐐�',
+              coord: [item.sampleCode, item.testValue],
+              value: item.testValue,
+              itemStyle: {
+                color: 'rgba(255, 173, 177, 0.8)'
+              },
+              label: {
+                show: true,
+                formatter: function(params) {
+                  return params.value; // 鑷畾涔夋爣绛惧唴瀹�
+                },
+                color: 'black', // 鏍囩鏂囧瓧棰滆壊
+                fontSize: 12,
+                distance: 5, // 璋冩暣鏍囩涓庢皵娉$殑璺濈
+                padding: [0,0],
+                backgroundColor: 'rgba(255, 173, 177, 0.8)', // 鏍囩鑳屾櫙鑹插強閫忔槑搴�
+                borderRadius: 4
+              }
+            });
           }
         })
         this.xAxis[0].data = xAxis
@@ -256,6 +329,17 @@
         this.echartsSeries[0].markPoint = {
           data: markPoints
         };
+        this.echartsSeries1[0].data = lineData
+        // 鏇存柊 markAreas1 閰嶇疆
+        this.echartsSeries1[0].markAreas1 = {
+          itemStyle: {
+            color: 'rgba(255, 173, 177, 0.4)' // 璁剧疆鑳屾櫙棰滆壊
+          },
+          data: markAreas1 // 鍔ㄦ�佺敓鎴愮殑 markAreas1 鏁版嵁
+        };
+        this.echartsSeries1[0].markPoint = {
+          data: markPoints1
+        };
       })
     },
     // 閲嶇疆

--
Gitblit v1.9.3