|
|
@ -40,7 +40,10 @@ export default {
|
|
|
|
// 通过表达式计算得来的值
|
|
|
|
// 通过表达式计算得来的值
|
|
|
|
getDataByExpression (config) {
|
|
|
|
getDataByExpression (config) {
|
|
|
|
// 如果表达式是由其他组件的值构成的
|
|
|
|
// 如果表达式是由其他组件的值构成的
|
|
|
|
if (this.config.expressionCodes && this.config.expressionCodes.length) {
|
|
|
|
const len = this.config.expressionCodes ? this.config.expressionCodes.length : 0
|
|
|
|
|
|
|
|
const len1 = this.currentComputedDatas ? Object.keys(this.currentComputedDatas).length : 0
|
|
|
|
|
|
|
|
const len2 = this.currentDataset ? Object.keys(this.currentDataset).length : 0
|
|
|
|
|
|
|
|
if (len && len === len1 + len2) {
|
|
|
|
// eslint-disable-next-line no-new-func
|
|
|
|
// eslint-disable-next-line no-new-func
|
|
|
|
const result = new Function('dataset', 'computedDatas', this.config.expression)
|
|
|
|
const result = new Function('dataset', 'computedDatas', this.config.expression)
|
|
|
|
config.customize.title = result(this.dataset, this.computedDatas)
|
|
|
|
config.customize.title = result(this.dataset, this.computedDatas)
|
|
|
|