From aba444f58264a5b6a016ddc3e6076de8e9379950 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期二, 05 十二月 2023 16:29:13 +0800
Subject: [PATCH] 设备超出点点点

---
 src/views/cockpitPage/components/PerSonnelProductivity.vue |   85 +++++++++++++++++++++++++-----------------
 1 files changed, 51 insertions(+), 34 deletions(-)

diff --git a/src/views/cockpitPage/components/PerSonnelProductivity.vue b/src/views/cockpitPage/components/PerSonnelProductivity.vue
index 476823f..193499c 100644
--- a/src/views/cockpitPage/components/PerSonnelProductivity.vue
+++ b/src/views/cockpitPage/components/PerSonnelProductivity.vue
@@ -24,8 +24,18 @@
   data() {
     return {
       chartData: {
-        datax: ["浜哄憳1", "浜哄憳2", "浜哄憳3", "浜哄憳4", "浜哄憳5", "浜哄憳6"],
-        datay: [120, 200, 150, 380, 470, 150, 230],
+        datax: [
+          "浜哄憳1",
+          "浜哄憳2",
+          "浜哄憳3",
+          "浜哄憳4",
+          "浜哄憳5",
+          "浜哄憳6",
+          "浜哄憳7",
+          "浜哄憳8",
+          "浜哄憳9",
+        ],
+        datay: [120, 200, 150, 380, 470, 150, 230, 330, 190, 440],
       },
     };
   },
@@ -43,6 +53,7 @@
   methods: {
     //鍦ㄨ亴
     pieChart(chartName, data) {
+      let that = this;
       let chartDom = this.$refs[chartName];
       let myChart = echarts.init(chartDom);
       let option;
@@ -65,24 +76,10 @@
           dataZoom: [
             {
               type: "inside",
-              // show: true, //鏄剧ず婊氬姩鏉�
-              start: 0,
-              end: 100,
               yAxisIndex: 0,
-              minSpan: 20,
-              maxSpan: 100,
-              // handleSize: 8
-            },
-            {
-              //   type: 'slider', //涓や釜涓�涓槸slider锛屼竴涓槸inside锛宻lider鏄鍔犳粴鍔ㄦ潯浠ュ強榧犳爣鎷栧姩婊氬姩鏉″姛鑳斤紝inside鍒欐槸榧犳爣婊氳疆婊氬姩婊氬姩鏉°��
-              type: "inside",
-              // show: true,
-              // realtime : true,
-              yAxisIndex: 0,
-              minSpan: 20,
-              maxSpan: 100,
-              start: 0,
-              end: 100,
+              show: false,
+              startValue: 0, // 浠庡ご寮�濮�
+              endValue: 5, // 涓�娆℃�у睍绀哄嚑涓�
             },
           ],
           legend: {
@@ -124,7 +121,7 @@
           ],
           xAxis: [
             {
-              type: "",
+              type: "value",
               name: "鍗曚綅锛氫欢",
               // min: data.yAxis[0].min?data.yAxis.min:0,
               minInterval: 1, //鍧愭爣杞存槸鏁存暟
@@ -151,7 +148,6 @@
               axisTick: {
                 show: false,
               },
-
               axisLabel: {
                 textStyle: {
                   color: "#00FFFF",
@@ -188,7 +184,22 @@
           ],
         };
 
+        setInterval(function () {
+          // 姣忔鍚戝乏婊戝姩涓�涓紝鏈�鍚庝竴涓粠澶村紑濮嬨��
+          if (option.dataZoom[0].endValue == that.chartData.datay.length) {
+            option.dataZoom[0].startValue = 0;
+            option.dataZoom[0].endValue = 5;
+          } else {
+            option.dataZoom[0].endValue = option.dataZoom[0].endValue + 1;
+            option.dataZoom[0].startValue = option.dataZoom[0].startValue + 1;
+          }
+          myChart.setOption(option);
+        }, 4000);
+
         option && myChart.setOption(option);
+        window.addEventListener("resize", function () {
+          myChart.resize();
+        });
       } else {
         option = {};
         myChart.setOption(option, true);
@@ -201,7 +212,7 @@
       let option;
       if (data) {
         option = {
-          color: ["#dcb018", "#735b09", "#ebd68e", "#FF3000"],
+          color: ["#dcb018", "#735b09", "#ebd68e", "#c7b36e"],
           tooltip: {
             trigger: "item",
           },
@@ -212,8 +223,8 @@
                 z: 3,
                 style: {
                   image: img,
-                  width: 118,
-                  height: 118,
+                  width: 238,
+                  height: 238,
                 },
                 left: "center",
                 top: "center",
@@ -225,23 +236,29 @@
             {
               name: "Access From",
               type: "pie",
-              // center: ['80%', '46%'],
-              radius: ["52%", "65%"],
-              // minAngle: 20,
-              // startAngle: 60,
+              radius: ["52%", "62%"],
               avoidLabelOverlap: false,
 
               label: {
                 normal: {
                   position: "outer",
-                  padding: [0, -55],
+                  padding: [0, -62],
                   color: "#01f7fd",
                   fontSize: 12,
-                  borderWidth: 20,
+                  borderWidth: 5,
                   borderRadius: 4,
                   formatter: function (params) {
-                    let str = params.name + params.value + "%";
-                    return str;
+                    return `{a|${params.name}} {b|${params.value + "%"}}`;
+                  },
+                  rich: {
+                    a: {
+                      color: "#00ffff",
+                      fontSize: 14,
+                    },
+                    b: {
+                      color: "#fccd1d",
+                      fontSize: 14,
+                    },
                   },
                 },
               },
@@ -255,8 +272,8 @@
               },
               labelLine: {
                 show: true,
-                length: 5,
-                length2: 70,
+                length: 4,
+                length2: 80,
                 lineStyle: {
                   color: "#dcb018",
                 },

--
Gitblit v1.8.0