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 = {