From f97718f8cb3722b899a8f4ab4497acba7c6c1b30 Mon Sep 17 00:00:00 2001
From: liuying <1427574514@qq.com>
Date: 周四, 17 10月 2024 16:27:44 +0800
Subject: [PATCH] 细节

---
 yiqi_screen/src/components/ProductionStatistics.vue |   43 ++++++++++++++++++++++++++++++-------------
 1 files changed, 30 insertions(+), 13 deletions(-)

diff --git a/yiqi_screen/src/components/ProductionStatistics.vue b/yiqi_screen/src/components/ProductionStatistics.vue
index 82ab84c..65d8a59 100644
--- a/yiqi_screen/src/components/ProductionStatistics.vue
+++ b/yiqi_screen/src/components/ProductionStatistics.vue
@@ -22,16 +22,33 @@
   },
   watch: {
     produceStatisData(val) {
-        this.$set(this.option.series[1], "data", [
-          { value: val.currentMonthProduceNum },
-          { value: val.currentMonthPlanNum - val.currentMonthProduceNum },
-        ]);
-        this.$set(this.option.series[0], "data", [
-          { value: val.currentShiftProduceNum },
-          { value: val.currentShiftPlanNum - val.currentShiftProduceNum },
-        ]);
-        this.myChart.setOption(this.option);
-        this.hignLightPie();
+      // 褰撳墠鐝粍瀹為檯鐢熶骇鏁伴噺 currentShiftProduceNum  
+      // 褰撳墠鐝粍璁″垝鐢熶骇鏁伴噺 currentShiftPlanNum
+      var num1 = val.currentShiftProduceNum; //瀹為檯鐢熶骇鏁伴噺
+      var num2 = val.currentShiftPlanNum - val.currentShiftProduceNum; //璁″垝鐢熶骇鏁伴噺
+      if(val.currentShiftPlanNum == 0){ //鍒嗘瘝涓�0 鏄剧ず0%
+        num1 = 0
+        num2 = 10
+      }
+      this.$set(this.option.series[0], "data", [
+      // { value: 1 },  //瀹為檯鐢熶骇鏁伴噺 1/ (9+1) = 10%
+      // { value: 9 },
+        { value: num1 }, //瀹為檯鐢熶骇鏁伴噺
+        { value: num2 },
+      ]);
+      var num3 = val.currentMonthProduceNum; 
+      var num4 = val.currentMonthPlanNum - val.currentMonthProduceNum; 
+      if(val.currentMonthPlanNum == 0 ){ //鍒嗘瘝涓�0 鏄剧ず0%
+        num3 = 0
+        num4 = 10
+      }
+      this.$set(this.option.series[1], "data", [
+        { value: num3 },
+        { value: num4 },
+      ]);
+
+      this.myChart.setOption(this.option);
+      this.hignLightPie();
     },
   },
   mounted() {
@@ -53,11 +70,11 @@
             fontSize: 12,
           },
 
-          emphasis: {
+          emphasis: { //楗煎浘涓棿鐨勫瓧浣撳ぇ灏�
             scale: false,
             label: {
               show: true,
-              fontSize: 24,
+              fontSize: 14,
               fontWeight: "normal",
             },
           },
@@ -93,7 +110,7 @@
             scale: false,
             label: {
               show: true,
-              fontSize: 24,
+              fontSize: 14, //楗煎浘涓棿鐨勫瓧浣撳ぇ灏�
               fontWeight: "normal",
             },
           },

--
Gitblit v1.9.3