From dbb2a464d215efcda6c0761b0574e9d9d6e9f24d Mon Sep 17 00:00:00 2001
From: liuying <1427574514@qq.com>
Date: 周四, 17 10月 2024 15:35:19 +0800
Subject: [PATCH] 整改

---
 yiqi_screen/src/components/ProductionCompletionTrend.vue |   31 +++++++++++++++++++++++++------
 1 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/yiqi_screen/src/components/ProductionCompletionTrend.vue b/yiqi_screen/src/components/ProductionCompletionTrend.vue
index 2d23cb8..8987f4f 100644
--- a/yiqi_screen/src/components/ProductionCompletionTrend.vue
+++ b/yiqi_screen/src/components/ProductionCompletionTrend.vue
@@ -19,16 +19,21 @@
   },
   watch:{
     produceCompletionData(val){
-      let xData=[],yData1=[],yData2=[];
+      let xData=[],yData1=[],yData2=[],yData3=[];
       val.forEach(item => {
         xData.push(item.month)
-        yData1.push(item.planCompletionNum)
-        yData2.push(item.planCompletionRate)
+        yData1.push(item.completionNum) //瀹為檯
+        yData2.push(item.planCompletionRate)  //planCompletionRate
+        yData3.push(item.planCompletionNum)  //璁″垝
       });
       this.$set(this.option.xAxis,'data',xData)
       this.$set(this.option.series[0],'data',yData1)
       this.$set(this.option.series[1],'data',yData2)
-      this.myChart.setOption(this.option);
+      this.$set(this.option.series[2],'data',yData3)
+      this.$nextTick(() => {
+        this.myChart.setOption(this.option);
+        });
+
     }
   },
   mounted() {
@@ -37,8 +42,12 @@
       tooltip: {
         trigger: "axis",
         formatter:
-          '{b0}鏈�<br /><a style="display:inline-block;width:10px;height:10px;background:linear-gradient(to bottom,#13e5f2,#01afba);border-radius:50%"></a> {a0}: {c0}<br /><a style="display:inline-block;width:10px;height:10px;background:linear-gradient(to bottom,#fff,#eee);border-radius:50%"></a> {a1}: {c1}%',
+    '{b0}鏈�<br />' +
+    '<a style="display:inline-block;width:10px;height:10px;background:linear-gradient(to bottom,#13e5f2,#01afba);border-radius:50%"></a> {a0}: {c0}<br />' +
+     '<a style="display:inline-block;width:10px;height:10px;background:linear-gradient(to bottom,#ffc107,#fd7e14);border-radius:50%"></a> {a2}: {c2}<br />'+
+    '<a style="display:inline-block;width:10px;height:10px;background:linear-gradient(to bottom,#fff,#eee);border-radius:50%"></a> {a1}: {c1}%<br />', // 娣诲姞鐢熶骇璁″垝鏁版彁绀�
         backgroundColor: "rgba(0,0,0,0.7)",
+        
         textStyle: {
           color: "#fff",
         },
@@ -69,7 +78,6 @@
       yAxis: [
         {
           type: "value",
-          // name: "鎶ヨ娆℃暟",
           position:'left',
           axisLine: {
             show: true,
@@ -154,6 +162,17 @@
             width:3
           }
         },
+     {
+    name: "鐢熶骇璁″垝鏁�", // 娣诲姞鐢熶骇璁″垝鏁�
+     type: "line",
+     data: [], // 鏍规嵁闇�瑕佸~鍏呮鏁扮粍
+     showSymbol: false,
+     yAxisIndex: 0, // 涓庣浉搴旂殑 y 杞村叧鑱�
+    color: 'rgba(255,205,86,0.85)', // 鑷畾涔夐鑹�
+      lineStyle: {
+       width: 3
+     }
+    }
       ],
       // animation: true,
       // dataZoom: [

--
Gitblit v1.9.3