fix:修复组件在计算时如果改变title导致计算表达式失效的问题

main
liu.shiyi 1 year ago
parent a570bcbbce
commit 933f30f0d1

@ -45,7 +45,7 @@ export default {
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)
// //
this.updateComputedDatas({ code: config.code, title: config.title, data: config.customize.title }) this.updateComputedDatas({ code: config.code, name: config.name, data: config.customize.title })
// this.changeChartConfig(config) // this.changeChartConfig(config)
} }
}, },

@ -45,7 +45,7 @@ export default {
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)
// //
this.updateComputedDatas({ code: config.code, title: config.title, data: config.customize.title }) this.updateComputedDatas({ code: config.code, name: config.name, data: config.customize.title })
// this.changeChartConfig(config) // this.changeChartConfig(config)
} }
}, },

@ -174,7 +174,7 @@ export default {
} }
// 将后端返回的数据保存 // 将后端返回的数据保存
if (_res.success) { if (_res.success) {
this.updateDataset({ code: config.code, title: config.title, data: _res?.data }) this.updateDataset({ code: config.code, name: config.name, data: _res?.data })
} }
config = this.dataFormatting(config, _res) config = this.dataFormatting(config, _res)
this.changeChartConfig(config) this.changeChartConfig(config)
@ -243,7 +243,7 @@ export default {
} }
// 将后端返回的数据保存 // 将后端返回的数据保存
if (_res.success) { if (_res.success) {
this.updateDataset({ code: config.code, title: config.title, data: _res?.data }) this.updateDataset({ code: config.code, name: config.name, data: _res?.data })
} }
config = this.dataFormatting(config, _res) config = this.dataFormatting(config, _res)
if (this.chart) { if (this.chart) {

@ -372,11 +372,11 @@ export default {
}, },
// 更新数据集库中的内容 // 更新数据集库中的内容
updateDataset (state, res) { updateDataset (state, res) {
Vue.set(state.dataset, res.title + res.code, res.data) Vue.set(state.dataset, res.name + res.code, res.data)
}, },
// 更新数据集库中的内容 // 更新数据集库中的内容
updateComputedDatas (state, res) { updateComputedDatas (state, res) {
Vue.set(state.computedDatas, res.title + res.code, res.data) Vue.set(state.computedDatas, res.name + res.code, res.data)
}, },
// 清空数据集库 // 清空数据集库
emptyDataset (state) { emptyDataset (state) {

Loading…
Cancel
Save