Fix parsing arrays - cache being overwritten. Remove redundant array evaluate. (#1531)

Signed-off-by: Boris Krivonog <boris.krivonog@inova.si>
pull/1535/head^2
Boris Krivonog 2022-10-20 21:01:24 +02:00 committed by GitHub
parent 5960cbe55f
commit 4cdb037177
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 18 deletions

View File

@ -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)
}
}

View File

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