From e5d499ae6a4e6b320f71c49987b76cc11f6bc1e4 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期二, 28 十月 2025 14:13:10 +0800
Subject: [PATCH] 首页问题
---
src/views/home/work-order/index.vue | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/src/views/home/work-order/index.vue b/src/views/home/work-order/index.vue
index dd29ecf..6fb264f 100644
--- a/src/views/home/work-order/index.vue
+++ b/src/views/home/work-order/index.vue
@@ -49,6 +49,9 @@
},
methods: {
initChart() {
+ // 瀵� complete 瀵硅薄鐨勯敭杩涜鎺掑簭
+ const sortedKeys = Object.keys(this.acitveData.complete)
+ .sort(); // 鎸夌収瀛楃涓茬殑瀛楀吀搴忓閿繘琛屾帓搴�
const option = {
legend: {
right: 'right',
@@ -86,13 +89,17 @@
tooltip: {},
xAxis: {
type: 'category',
- data: Object.keys(this.acitveData.complete),
+ data: sortedKeys,
+ axisLabel: {
+ interval: 0 // 寮哄埗鏄剧ず鎵�鏈夋爣绛�
+ },
+ sortSeriesData: false
},
yAxis: {},
series: [
{
name: '瀹屾垚宸ュ崟鏁�',
- data: Object.entries(this.acitveData.complete).map(([key, value]) => value),
+ data: sortedKeys.map(key => this.acitveData.complete[key]),
type: 'line',
itemStyle: {
color: 'rgba(62, 144, 247, 1)'
@@ -100,7 +107,7 @@
},
{
name: '寰呭畬鎴愬伐鍗曟暟',
- data: Object.entries(this.acitveData.waiting).map(([key, value]) => value),
+ data: sortedKeys.map(key => this.acitveData.waiting[key]),
type: 'line',
itemStyle: {
color: 'rgba(85, 192, 191, 1)'
@@ -108,7 +115,7 @@
},
{
name: '寰呭鎵瑰伐鍗曟暟',
- data: Object.entries(this.acitveData.pending).map(([key, value]) => value),
+ data: sortedKeys.map(key => this.acitveData.pending[key]),
type: 'line',
itemStyle: {
color: 'rgba(255, 165, 0, 1)'
@@ -131,6 +138,7 @@
pending: {}
}
}
+
lineChart = echarts.init(this.$refs.chartContent);
this.initChart();
this.observe();
--
Gitblit v1.8.0