Browse Source

调整百分比

wangcc 2 years ago
parent
commit
9282dd60c6
2 changed files with 5 additions and 11 deletions
  1. 2 8
      src/components/Receivables/PercenTage.vue
  2. 3 3
      src/components/charts/PieCharts.vue

+ 2 - 8
src/components/Receivables/PercenTage.vue

@@ -3,7 +3,7 @@
  * @Author: wangcc
  * @Date: 2023-01-11 14:19:56
  * @LastEditors: wangcc
- * @LastEditTime: 2023-01-29 13:45:15
+ * @LastEditTime: 2023-02-17 14:03:32
  * @FilePath: \parking_LargeScreen\src\components\Receivables\PercenTage.vue
  * @Copyright: Copyright (c) 2016~2023 by wangcc, All Rights Reserved. 
 -->
@@ -32,13 +32,7 @@ export default {
     return {
       hackReset: false,
       echartsData: {
-        pieData: [
-          { value: 40, name: '微信支付' },
-          { value: 30, name: '现金支付' },
-          { value: 30, name: '聚合支付' },
-          { value: 30, name: '快捷支付' },
-          { value: 30, name: '无感支付' }
-        ]
+        pieData: []
       },
       payData: {
         0: '现金支付',

+ 3 - 3
src/components/charts/PieCharts.vue

@@ -3,7 +3,7 @@
  * @Author: wangcc
  * @Date: 2023-01-11 14:51:13
  * @LastEditors: wangcc
- * @LastEditTime: 2023-01-28 14:52:12
+ * @LastEditTime: 2023-02-17 14:19:19
  * @FilePath: \parking_LargeScreen\src\components\charts\PieCharts.vue
  * @Copyright: Copyright (c) 2016~2023 by wangcc, All Rights Reserved. 
 -->
@@ -56,7 +56,7 @@ export default {
                 fontSize: 35 * scale,
                 width: 35 * scale,
                 fontFamily: 'BarlowBold',
-                padding: [0, 0, 0, 12],
+                padding: [0, 0, 0, 37],
             };
         })
         let options = {
@@ -94,7 +94,7 @@ export default {
                     for (let i = 0; i < echartData.length; i++) {
                         if (echartData[i].name === name) {
                             target = echartData[i].value;
-                            percent = Math.ceil((echartData[i].value / sumNum) * 100);
+                            percent = ((echartData[i].value / sumNum) * 100).toFixed(3);
                             str = ` {checkName|${name} } {${'percent' + i}|${percent}} {${'unit' + i}|%}`
                         }
                     }