fix: 修改 新增metrics时 名称丢失的问题

This commit is contained in:
zhangyu
2021-12-03 16:29:05 +08:00
parent 059f6ead7b
commit dd208a2e99

View File

@@ -161,6 +161,7 @@ export default {
const arr = [this.$refs.chartForm.validate()] const arr = [this.$refs.chartForm.validate()]
arr.push(this.$refs['childrenFrom' + this.editChart.datasource].$refs.chartForm.validate()) arr.push(this.$refs['childrenFrom' + this.editChart.datasource].$refs.chartForm.validate())
Promise.all(arr).then(res => { Promise.all(arr).then(res => {
this.editChart.param = JSON.stringify(this.editChart.param)
if (this.editChart.id) { // 修改 if (this.editChart.id) { // 修改
this.$put('visual/panel/chart', this.editChart).then(response => { this.$put('visual/panel/chart', this.editChart).then(response => {
if (response.code === 200) { if (response.code === 200) {
@@ -286,7 +287,13 @@ export default {
} }
}, },
editChartChange (newEditChart) { editChartChange (newEditChart) {
this.editChart = JSON.parse(JSON.stringify(newEditChart)) this.editChart = {
...JSON.parse(JSON.stringify(newEditChart)),
name: this.editChart.name,
remark: this.editChart.remark,
groupId: this.editChart.groupId,
panelName: this.editChart.panelName
}
} }
}, },
created () { created () {