From 2af7049b8706232b9db59d5be5a08b49285024fc Mon Sep 17 00:00:00 2001 From: liuying <1427574514@qq.com> Date: 周五, 01 11月 2024 19:34:54 +0800 Subject: [PATCH] 细节 --- yiqi_screen/src/components/ProductionStatistics.vue | 49 ++++++++++++++++++++++++++++++++++--------------- 1 files changed, 34 insertions(+), 15 deletions(-) diff --git a/yiqi_screen/src/components/ProductionStatistics.vue b/yiqi_screen/src/components/ProductionStatistics.vue index 82ab84c..6248f98 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() { @@ -42,7 +59,8 @@ { name: "Access From", type: "pie", - radius: ["25%", "40%"], + // radius: ["25%", "40%"], + radius: ["30%", "37%"],//鐜彉缁� center: ["26%", "47%"], avoidLabelOverlap: false, label: { @@ -53,11 +71,11 @@ fontSize: 12, }, - emphasis: { + emphasis: { //楗煎浘涓棿鐨勫瓧浣撳ぇ灏� scale: false, label: { show: true, - fontSize: 24, + fontSize: 15, fontWeight: "normal", }, }, @@ -74,7 +92,8 @@ { name: "Access From", type: "pie", - radius: ["25%", "40%"], + // radius: ["25%", "40%"], + radius: ["30%", "37%"],//鐜彉缁� center: ["74%", "47%"], avoidLabelOverlap: false, label: { @@ -93,7 +112,7 @@ scale: false, label: { show: true, - fontSize: 24, + fontSize: 15, //楗煎浘涓棿鐨勫瓧浣撳ぇ灏� fontWeight: "normal", }, }, -- Gitblit v1.9.3