From 600fe725775e28af1f86f7f7f1e2521f494252b1 Mon Sep 17 00:00:00 2001
From: liu <2021943741@qq.com>
Date: 星期二, 01 九月 2026 15:27:26 +0800
Subject: [PATCH] feat(mes): 新增管理驾驶舱页面

---
 src/views/mes/trace-consumer-scan/chart-options.ts |   62 +++++++++++++++++++++++++++++++
 1 files changed, 62 insertions(+), 0 deletions(-)

diff --git a/src/views/mes/trace-consumer-scan/chart-options.ts b/src/views/mes/trace-consumer-scan/chart-options.ts
new file mode 100644
index 0000000..0e6426f
--- /dev/null
+++ b/src/views/mes/trace-consumer-scan/chart-options.ts
@@ -0,0 +1,62 @@
+import type { EChartsOption } from '@vben/plugins/echarts';
+
+/** 娑堣垂鑰呮壂鐮佽闂秼鍔挎姌绾垮浘閰嶇疆 */
+export function getScanTrendChartOptions(
+  dates: string[],
+  totals: number[],
+  success: number[],
+  failed: number[],
+): EChartsOption {
+  return {
+    grid: { bottom: 40, left: 50, right: 20, top: 20 },
+    legend: { bottom: 0, data: ['鎬昏闂�', '鎴愬姛', '澶辫触'] },
+    series: [
+      {
+        areaStyle: { color: 'rgba(64,158,255,0.15)' },
+        data: totals,
+        itemStyle: { color: '#409EFF' },
+        name: '鎬昏闂�',
+        smooth: true,
+        type: 'line',
+      },
+      {
+        data: success,
+        itemStyle: { color: '#67C23A' },
+        name: '鎴愬姛',
+        smooth: true,
+        type: 'line',
+      },
+      {
+        data: failed,
+        itemStyle: { color: '#F56C6C' },
+        name: '澶辫触',
+        smooth: true,
+        type: 'line',
+      },
+    ],
+    tooltip: { axisPointer: { type: 'cross' }, trigger: 'axis' },
+    xAxis: { boundaryGap: false, data: dates, type: 'category' },
+    yAxis: { minInterval: 1, type: 'value' },
+  };
+}
+
+/** 娑堣垂鑰呮壂鐮佽闂垎甯冮ゼ鍥鹃厤缃� */
+export function getScanDistributionChartOptions(
+  data: Array<{ itemStyle: { color: string }; name: string; value: number }>,
+): EChartsOption {
+  return {
+    legend: { bottom: 0, type: 'scroll' },
+    series: [
+      {
+        avoidLabelOverlap: true,
+        data,
+        emphasis: { label: { fontSize: 14, fontWeight: 'bold', show: true } },
+        itemStyle: { borderColor: '#fff', borderRadius: 6, borderWidth: 2 },
+        label: { formatter: '{b}\n{c}', show: true },
+        radius: ['40%', '70%'],
+        type: 'pie',
+      },
+    ],
+    tooltip: { formatter: '{b}: {c} ({d}%)', trigger: 'item' },
+  };
+}

--
Gitblit v1.9.3