From 53e63b2923a3dec03a5d9c45493f10576729781a Mon Sep 17 00:00:00 2001 From: douzhuo <17611323298@163.com> Date: Thu, 28 Jul 2022 15:21:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=91=A8=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/reportExcel/weekReport.vue | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/views/reportExcel/weekReport.vue b/src/views/reportExcel/weekReport.vue index f47f70a..acc6a9b 100644 --- a/src/views/reportExcel/weekReport.vue +++ b/src/views/reportExcel/weekReport.vue @@ -200,7 +200,7 @@ class="middles-progress" :show-text="false" stroke-width="16" - :percentage="percent.value" + :percentage="percent.values" :color="$options.filters.setColor(index)" > @@ -525,6 +525,7 @@ export default { this.needList.forEach((item) => { if (this.weekObj[item + "List"]) { this.bubbleSort(this.weekObj[item + "List"]); + this.weekObj[item + 'List'] = this.dealData(this.weekObj[item + 'List']) } }); @@ -570,6 +571,18 @@ export default { } }, + // 定义一个公共方法对数据进行处理 + dealData(arr) { + // 获取最大值 + let num = Math.max.apply(Math, arr.map((o) => { + return o.value + })) + arr.map(item => { + item.values = Math.floor(item.value / num * 100) + }) + return arr + + }, initEcharts() { // 基本柱状图 const option = {