From 2146654ce466348808bd11218d5a71756d03abc4 Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期四, 13 三月 2025 16:46:05 +0800
Subject: [PATCH] 1.打印模板修改2.新增打印次数字段

---
 src/utils/myEcharts.js |   54 ++++++++++++++++++++----------------------------------
 1 files changed, 20 insertions(+), 34 deletions(-)

diff --git a/src/utils/myEcharts.js b/src/utils/myEcharts.js
index 3fb285e..55bcdcb 100644
--- a/src/utils/myEcharts.js
+++ b/src/utils/myEcharts.js
@@ -356,13 +356,13 @@
 
 // 缁煎悎鐪嬫澘鍥�
 export function bar02(dataArr, titlenameArr) {
-  // const data = [700, 600, 50, 40, 30]
-  // const titlename = ['500ml鎻愭墜鐩栧挅鍟℃澂 钃濊壊 鍠峰', '500ml鎻愭墜鐩栧挅鍟℃澂 钃濊壊 鍠峰', '灏哄', '棰滆壊', '澶у皬']
+  // const data = [70, 60, 50, 40, 30]
+  // const titlename = ['澶栬鍒掍激', '琛ㄩ潰娌规薄', '灏哄', '棰滆壊', '澶у皬']
   // const data = val.map(i => i.cont)
   // const titlename = val.map(i => i.name)
-  const data = dataArr.filter((item, index) => index < 5)
+  const data = dataArr.filter((item, index) => index < 10)
 
-  const titlename = titlenameArr.filter((item, index) => index < 5)
+  const titlename = titlenameArr.filter((item, index) => index < 10)
 
   const length = titlename.length
   if (titlename.length < 5) {
@@ -371,13 +371,14 @@
     }
   }
 
-  console.log(titlename, 123)
-
-  // const valdata = [683, 500, 400, 300, 200]
+  const valdata = [683, 500, 400, 300, 200]
   // const myColor = ['#FF0000', '#FF5511', '#FF8800', '#FFBB00', '#FFFF00']
   // const myColor = ['#0000FF']
   // const myColor = ['#7af5f5', '#00FFFF', '#00FFFF', '#00FFFF', '#00FFFF']
-  const myColor = ['rgba(122,245,245,1)', 'rgba(122,245,245,0.95)', 'rgba(122,245,245,0.9)', 'rgba(122,245,245,0.85)', 'rgba(122,245,245,0.8)']
+  const myColor = [
+    'rgba(122,245,245,1)', 'rgba(122,245,245,0.95)', 'rgba(122,245,245,0.9)', 'rgba(122,245,245,0.85)', 'rgba(122,245,245,0.8)',
+    'rgba(122,245,245,0.75)', 'rgba(122,245,245,0.7)', 'rgba(122,245,245,0.65)', 'rgba(122,245,245,0.6)', 'rgba(122,245,245,0.55)'
+  ]
   const option = {
     animation: false,
     backgroundColor: 'transparent',
@@ -423,16 +424,11 @@
           show: false
         },
         axisLabel: {
-          show: false,
           // color: '#fff',
           color: function(value, index) {
             return value === '0' ? 'transparent' : '#fff'
           },
-          verticalAlign: 'bottom',
-          // align: 'left',
-          // margin: 80,
           fontSize: 20,
-
           // formatter: function(value, index) {
           //   return [
           //     '{lg|' + (index + 1) + '銆�   }' + '{title|' + value + '} '
@@ -462,12 +458,12 @@
         }
       },
       {
-        show: true,
+        show: false,
         inverse: true,
-        data: data,
+        data: valdata,
         axisLabel: {
           textStyle: {
-            fontSize: 20,
+            fontSize: 12,
             color: '#fff'
           }
         },
@@ -502,24 +498,13 @@
         },
         label: {
           normal: {
-            color: '#fff',
             show: true,
-            position: [0, '-20px'],
-            textStyle: {
-              fontSize: 16
-            },
-            formatter: function(a, b) {
-              return a.name
-            }
+            position: 'right',
+            formatter: '{c}',
+            fontSize: 20,
+            color: '#fff'
+            // formatter: '{c}%',
           }
-          // normal: {
-          //   show: true,
-          //   position: 'right',
-          //   formatter: '{c}',
-          //   fontSize: 20,
-          //   color: '#fff'
-          //   // formatter: '{c}%',
-          // }
         }
       }
     ]
@@ -2119,12 +2104,13 @@
   return option
 }
 
-export function all02(data) {
+export function all02(data, title) {
   return {
     backgroundColor: 'transparent',
     // tooltip: {},
     title: {
-      text: '姣忔湀璁㈠崟鏁伴噺/鍑哄簱鏁伴噺',
+      text: title,
+      // text: '姣忔湀璁㈠崟鏁伴噺/鍑哄簱鏁伴噺',
       left: '50%',
       top: '0%',
       textAlign: 'center',

--
Gitblit v1.9.3