Fix parsing arrays - cache being overwritten. Remove redundant array evaluate. (#1531)
Signed-off-by: Boris Krivonog <boris.krivonog@inova.si>pull/1535/head^2
parent
5960cbe55f
commit
4cdb037177
|
@ -8,22 +8,6 @@ export default {
|
|||
if (!component.config || typeof component.config !== 'object') return {}
|
||||
|
||||
const dataSeriesId = ComponentId.get(component)
|
||||
let series = chart.evaluateExpression(dataSeriesId, component.config)
|
||||
|
||||
if (series.data && Array.isArray(series.data)) {
|
||||
series.data = series.data.map((v, index) => {
|
||||
const item = chart.evaluateExpression(dataSeriesId + 'data.' + index, v)
|
||||
return Number.isNaN(item.value) ? {} : item
|
||||
})
|
||||
}
|
||||
|
||||
if (series.axisLine && series.axisLine.lineStyle && series.axisLine.lineStyle.color && Array.isArray(series.axisLine.lineStyle.color)) {
|
||||
series.axisLine.lineStyle.color = series.axisLine.lineStyle.color.map((v, index) => {
|
||||
if (!Array.isArray(v)) return v
|
||||
return v.map((s, subindex) => chart.evaluateExpression(dataSeriesId + 'axisLine.lineStyle.color.' + index + '.' + subindex, s))
|
||||
})
|
||||
}
|
||||
|
||||
return series
|
||||
return chart.evaluateExpression(dataSeriesId, component.config)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -155,7 +155,7 @@ export default {
|
|||
} else if (typeof value === 'object' && Array.isArray(value)) {
|
||||
const evalArr = []
|
||||
for (let i = 0; i < value.length; i++) {
|
||||
this.$set(evalArr, i, this.evaluateExpression(i, value[i]))
|
||||
this.$set(evalArr, i, this.evaluateExpression(key + '.' + i, value[i]))
|
||||
}
|
||||
return evalArr
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue