From 301532b5c1cad2c1d45080bfef86579b20486bf5 Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期三, 25 十二月 2024 10:33:23 +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