optmization

This commit is contained in:
JM 2018-12-23 22:33:51 +08:00
parent 34771fe562
commit 774b6c8708
1 changed files with 6 additions and 2 deletions

View File

@ -108,13 +108,17 @@ export default {
if (agValueSeries.length) this.agValueMaxMin = calcValueMaxMin(agValueSeries) if (agValueSeries.length) this.agValueMaxMin = calcValueMaxMin(agValueSeries)
}, },
calcValueMaxMin (data) { calcValueMaxMin (data) {
const { mulValueAdd, calcMulValueAdd, getArrayMaxMin } = this const { mulValueAdd, calcMulValueAdd, getArrayMax, getArrayMin } = this
let valueSeries = data.map(({ data: td }) => td) let valueSeries = data.map(({ data: td }) => td)
const min = getArrayMin(valueSeries)
mulValueAdd && (valueSeries = calcMulValueAdd(valueSeries)) mulValueAdd && (valueSeries = calcMulValueAdd(valueSeries))
return getArrayMaxMin(valueSeries) const max = getArrayMax(valueSeries)
return [max, min]
}, },
calcMulValueAdd (values) { calcMulValueAdd (values) {
const { multipleSum, filterNull } = this const { multipleSum, filterNull } = this