From 1dd74bb741611e3882c781d79539be1600d98431 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期三, 01 三月 2023 12:44:55 +0800
Subject: [PATCH] 1.新增采购订单、生产管理看板

---
 src/utils/myEcharts.js |  312 +++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 286 insertions(+), 26 deletions(-)

diff --git a/src/utils/myEcharts.js b/src/utils/myEcharts.js
index de20de6..b545b5c 100644
--- a/src/utils/myEcharts.js
+++ b/src/utils/myEcharts.js
@@ -1231,22 +1231,22 @@
             color: 'rgba(41, 162, 245, 1)',
             barBorderRadius: 10
           }
-        // color: '#A71A2B',
-        // barBorderRadius: 4,
+          // color: '#A71A2B',
+          // barBorderRadius: 4,
         }
-      // label: {
-      //     normal: {
-      //         color: '#fff',
-      //         show: true,
-      //         position: ["-80px", 0],
-      //         textStyle: {
-      //             fontSize: 16
-      //         },
-      //         formatter: function(a, b) {
-      //             return a.name
-      //         }
-      //     }
-      // }
+        // label: {
+        //     normal: {
+        //         color: '#fff',
+        //         show: true,
+        //         position: ["-80px", 0],
+        //         textStyle: {
+        //             fontSize: 16
+        //         },
+        //         formatter: function(a, b) {
+        //             return a.name
+        //         }
+        //     }
+        // }
       }]
   }
 
@@ -1294,16 +1294,16 @@
         }
       }
     }
-    // {
-    //   text: '鍗曚綅锛氫釜',
-    //   top: 20,
-    //   left: 20,
-    //   textStyle: {
-    //     fontSize: 14,
-    //     color: '#666666',
-    //     fontWeight: 400
-    //   }
-    // }
+      // {
+      //   text: '鍗曚綅锛氫釜',
+      //   top: 20,
+      //   left: 20,
+      //   textStyle: {
+      //     fontSize: 14,
+      //     color: '#666666',
+      //     fontWeight: 400
+      //   }
+      // }
     ],
     // legend: {
     //     orient: 'vertical',
@@ -1363,7 +1363,7 @@
             formatter: params => {
               return (
                 '{icon|鈼弣{name|' + params.name + '}{value|' +
-              formatNumber(params.value) + '}'
+                formatNumber(params.value) + '}'
               )
             },
             padding: [0, -50, 25, -50],
@@ -1518,3 +1518,263 @@
 
   return option
 }
+
+// 閲囪喘璁㈠崟
+export function cgddchart(data1, data2, data3) {
+  // 寰楀埌鏈�澶у��  5鐨勫�嶆暟
+
+  let max = Math.max(Math.max(data1, data2), data3) + 5
+  if (max % 5 !== 0) {
+    max = 5 - max % 5 + max
+  }
+  const option = {
+    backgroundColor: 'transparent',
+    tooltip: {
+      formatter: '{a} <br/>{c} {b}'
+    },
+    series: [
+      {
+        name: '鏈湀閲囪喘璁㈠崟鏁�',
+        type: 'gauge',
+        color: ['#f00'],
+        min: 0,
+        max: max,
+        splitNumber: 5,
+        radius: '70%',
+        center: ['17%', '48%'],
+        axisLine: { // 鍧愭爣杞寸嚎
+          lineStyle: { // 灞炴�ineStyle鎺у埗绾挎潯鏍峰紡
+            width: 10,
+            color: [
+              [0.4, '#09d8f2'],
+              [1, '#00FFFFF']
+            ]
+          },
+          backgroundColor: 'none'
+        },
+        tooltip: {
+          show: false
+        },
+        axisTick: { // 鍧愭爣杞村皬鏍囪
+          length: 10, // 灞炴�ength鎺у埗绾块暱
+          lineStyle: { // 灞炴�ineStyle鎺у埗绾挎潯鏍峰紡
+            color: 'auto'
+          }
+        },
+        splitLine: { // 鍒嗛殧绾�
+          length: 10, // 灞炴�ength鎺у埗绾块暱
+          lineStyle: { // 灞炴�ineStyle锛堣瑙乴ineStyle锛夋帶鍒剁嚎鏉℃牱寮�
+            color: colorY
+          }
+        },
+        axisLabel: {
+          borderRadius: 1,
+          // color: 'rgba(255,255,255,0.7)',
+          color: '#00FFFF',
+          padding: 1,
+          fontSize: 18
+        },
+        title: {
+          // 鍏朵綑灞炴�ч粯璁や娇鐢ㄥ叏灞�鏂囨湰鏍峰紡锛岃瑙乀EXTSTYLE
+          // fontWeight: 'bolder',
+          fontSize: 22,
+          fontFamily: 'Microsoft YaHei',
+          fontColor: '#FFF',
+          color: '#FFF',
+          paddingTop: 20,
+          offsetCenter: [0, '120%']
+          // fontStyle: 'italic'
+        },
+        itemStyle: {
+          // color: '#1092ff'
+          color: '#09d8f2'
+        },
+        detail: {
+          shadowOffsetX: 0,
+          shadowOffsetY: 0,
+          fontFamily: 'digital',
+          fontSize: 26,
+          color: '#fff',
+          rich: {},
+          offsetCenter: [0, '90%'],
+
+          formatter: function(value) {
+            return value
+          }
+        },
+        data: [{
+          value: data1,
+          name: '鏈湀閲囪喘璁㈠崟鏁�'
+        }]
+      },
+      {
+        name: '鏈湀鍒拌揣鍗曟暟',
+        type: 'gauge',
+        color: ['#f00'],
+        min: 0,
+        max: max,
+        splitNumber: 5,
+        radius: '70%',
+        center: ['50%', '48%'],
+        axisLine: { // 鍧愭爣杞寸嚎
+          lineStyle: { // 灞炴�ineStyle鎺у埗绾挎潯鏍峰紡
+            width: 10,
+            color: [
+              [0.4, '#09d8f2'],
+              [1, '#00FFFFF']
+            ]
+          },
+          backgroundColor: 'none'
+        },
+        tooltip: {
+          show: false
+        },
+        axisTick: { // 鍧愭爣杞村皬鏍囪
+          length: 10, // 灞炴�ength鎺у埗绾块暱
+          lineStyle: { // 灞炴�ineStyle鎺у埗绾挎潯鏍峰紡
+            color: 'auto'
+          }
+        },
+        splitLine: { // 鍒嗛殧绾�
+          length: 10, // 灞炴�ength鎺у埗绾块暱
+          lineStyle: { // 灞炴�ineStyle锛堣瑙乴ineStyle锛夋帶鍒剁嚎鏉℃牱寮�
+            color: colorY
+          }
+        },
+        axisLabel: {
+          borderRadius: 1,
+          // color: 'rgba(255,255,255,0.7)',
+          color: '#00FFFF',
+          padding: 1,
+          fontSize: 18
+        },
+        title: {
+          // 鍏朵綑灞炴�ч粯璁や娇鐢ㄥ叏灞�鏂囨湰鏍峰紡锛岃瑙乀EXTSTYLE
+          // fontWeight: 'bolder',
+          fontSize: 22,
+          fontColor: '#FFF',
+          color: '#FFF',
+          fontFamily: 'Microsoft YaHei',
+          paddingTop: 20,
+          offsetCenter: [0, '120%']
+          // fontStyle: 'italic'
+        },
+        itemStyle: {
+          // color: '#1092ff'
+          color: '#09d8f2'
+        },
+        detail: {
+          shadowOffsetX: 0,
+          shadowOffsetY: 0,
+          // borderWidth: 1,
+          textBorderColor: '#000',
+          textBorderWidth: 1,
+          textShadowBlur: 1,
+          textShadowColor: colorY,
+          textShadowOffsetX: 0,
+          textShadowOffsetY: 0,
+          paddingTop: 10,
+          fontFamily: 'digital',
+          fontSize: 20,
+          width: 30,
+          color: '#fff',
+          rich: {},
+          offsetCenter: [0, '90%'],
+          formatter: function(value) {
+            // console.info(value)
+            // return (value * 10 + '%')
+            return value
+          }
+        },
+        data: [{
+          value: data2,
+          name: '鏈湀鍒拌揣鍗曟暟'
+        }]
+      },
+      {
+        name: '鏈湀閲囪喘鍏ュ簱鍗曟暟',
+        type: 'gauge',
+        color: ['#f00'],
+        min: 0,
+        max: max,
+        splitNumber: 5,
+        radius: '70%',
+        center: ['83%', '48%'],
+        axisLine: { // 鍧愭爣杞寸嚎
+          lineStyle: { // 灞炴�ineStyle鎺у埗绾挎潯鏍峰紡
+            width: 10,
+            color: [
+              [0.4, '#09d8f2'],
+              [1, '#00FFFFF']
+            ]
+          },
+          backgroundColor: 'none'
+        },
+        tooltip: {
+          show: false
+        },
+        axisTick: { // 鍧愭爣杞村皬鏍囪
+          length: 10, // 灞炴�ength鎺у埗绾块暱
+          lineStyle: { // 灞炴�ineStyle鎺у埗绾挎潯鏍峰紡
+            color: 'auto'
+          }
+        },
+        splitLine: { // 鍒嗛殧绾�
+          length: 10, // 灞炴�ength鎺у埗绾块暱
+          lineStyle: { // 灞炴�ineStyle锛堣瑙乴ineStyle锛夋帶鍒剁嚎鏉℃牱寮�
+            color: colorY
+          }
+        },
+        axisLabel: {
+          borderRadius: 1,
+          // color: 'rgba(255,255,255,0.7)',
+          color: '#00FFFF',
+          padding: 1,
+          fontSize: 18
+        },
+        title: {
+          // 鍏朵綑灞炴�ч粯璁や娇鐢ㄥ叏灞�鏂囨湰鏍峰紡锛岃瑙乀EXTSTYLE
+          // fontWeight: 'bolder',
+          fontSize: 22,
+          fontColor: '#FFF',
+          color: '#FFF',
+          fontFamily: 'Microsoft YaHei',
+          paddingTop: 20,
+          offsetCenter: [0, '120%']
+          // fontStyle: 'italic'
+        },
+        itemStyle: {
+          // color: '#1092ff'
+          color: '#09d8f2'
+        },
+        detail: {
+          shadowOffsetX: 0,
+          shadowOffsetY: 0,
+          // borderWidth: 1,
+          textBorderColor: '#000',
+          textBorderWidth: 1,
+          textShadowBlur: 1,
+          textShadowColor: colorY,
+          textShadowOffsetX: 0,
+          textShadowOffsetY: 0,
+          paddingTop: 10,
+          fontFamily: 'digital',
+          fontSize: 20,
+          width: 30,
+          color: '#fff',
+          rich: {},
+          offsetCenter: [0, '90%'],
+          formatter: function(value) {
+            return value
+          }
+        },
+        data: [{
+          value: data3,
+          name: `鏈湀閲囪喘鍏ュ簱鍗曟暟`
+        }]
+      }
+
+    ]
+  }
+  return option
+}

--
Gitblit v1.9.3