From 1dbdda3517a01851d8d9894b22e61aa4462b541c Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期四, 07 十二月 2023 19:16:36 +0800
Subject: [PATCH] tooltip值优化

---
 src/views/cockpitPage/components/DeviceChart.vue           |    3 +++
 src/views/cockpitPage/components/BarChart.vue              |    5 +++--
 src/views/cockpitPage/components/PerSonnelProductivity.vue |    6 ++++++
 src/views/cockpitPage/components/MaterialChart.vue         |    3 +++
 4 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/views/cockpitPage/components/BarChart.vue b/src/views/cockpitPage/components/BarChart.vue
index 15e3d29..f4c4554 100644
--- a/src/views/cockpitPage/components/BarChart.vue
+++ b/src/views/cockpitPage/components/BarChart.vue
@@ -4,7 +4,7 @@
     <div class="bar-contents">
       <div class="bar-total">
         <div class="bar-item">褰撴棩鍚堣鐢熶骇锛歿{ chartData.total }}</div>
-        <div class="bar-item">姝e搧鐜囷細{{ chartData.rate }}</div>
+        <div class="bar-item">姝e搧鐜囷細{{ chartData.rate }}%</div>
       </div>
       <div class="chart" ref="chart"></div>
     </div>
@@ -116,7 +116,8 @@
                 '<span style=width:70px;display:inline-block">' +
                 "姝e搧鐜�" +
                 "</span>&nbsp;" +
-                data.rate;
+                data.rate +
+                "%";
               list.push(lastString);
               listItem = list.join("<br>");
               return '<div class="showBox">' + listItem + "</div>";
diff --git a/src/views/cockpitPage/components/DeviceChart.vue b/src/views/cockpitPage/components/DeviceChart.vue
index b95ae0e..a88e6be 100644
--- a/src/views/cockpitPage/components/DeviceChart.vue
+++ b/src/views/cockpitPage/components/DeviceChart.vue
@@ -65,6 +65,9 @@
             axisPointer: {
               type: "none",
             },
+            valueFormatter: function (value) {
+              return value + "%";
+            },
           },
           grid: {
             right: "80px",
diff --git a/src/views/cockpitPage/components/MaterialChart.vue b/src/views/cockpitPage/components/MaterialChart.vue
index 3710cb5..1e95123 100644
--- a/src/views/cockpitPage/components/MaterialChart.vue
+++ b/src/views/cockpitPage/components/MaterialChart.vue
@@ -63,6 +63,9 @@
             axisPointer: {
               type: "none",
             },
+            valueFormatter: function (value) {
+              return "鐗╂枡涓嶈冻鐨勬暟閲�:" + value;
+            },
           },
           grid: {
             right: "80px",
diff --git a/src/views/cockpitPage/components/PerSonnelProductivity.vue b/src/views/cockpitPage/components/PerSonnelProductivity.vue
index ac8be87..4f11181 100644
--- a/src/views/cockpitPage/components/PerSonnelProductivity.vue
+++ b/src/views/cockpitPage/components/PerSonnelProductivity.vue
@@ -70,6 +70,9 @@
             axisPointer: {
               type: "none",
             },
+            valueFormatter: function (value) {
+              return value + "%";
+            },
           },
           grid: {
             right: "80px",
@@ -253,6 +256,9 @@
           color: ["#dcb018", "#735b09", "#ebd68e", "#c7b36e"],
           tooltip: {
             trigger: "item",
+            valueFormatter: function (value) {
+              return value + "%";
+            },
           },
           graphic: {
             elements: [

--
Gitblit v1.8.0