NEZ-343 fix: 修复修改chart不生效的问题

This commit is contained in:
chenjinsong
2020-07-03 16:27:04 +08:00
parent 71a3a48c3e
commit 6ee3e69529

View File

@@ -686,7 +686,7 @@
}, },
// 更新图表 // 更新图表
updateCharts(params) { updateCharts(params) {
this.$put('panel/' + this.panelId + '/charts', params).then(response2 => { this.$put('panel/' + this.panelId + '/charts', params ? params : this.chart).then(response2 => {
if (response2.code === 200) { if (response2.code === 200) {
this.esc(); this.esc();
this.$message({duration: 1000, type: 'success', message: this.$t("tip.saveSuccess")}); this.$message({duration: 1000, type: 'success', message: this.$t("tip.saveSuccess")});
@@ -812,7 +812,11 @@
this.chart.elements.push({id: this.elementIds[i], expression: expr, type: "expert", legend: this.legends[i]}); this.chart.elements.push({id: this.elementIds[i], expression: expr, type: "expert", legend: this.legends[i]});
}); });
} }
this.addCharts(); if (this.chart.id) {
this.updateCharts();
} else {
this.addCharts();
}
}else { }else {
this.$refs.chartForm.validate((valid) => { this.$refs.chartForm.validate((valid) => {
const params = { const params = {