fix:回复chartBox的校验 以及 this.editChart.param.statistics为空事的默认值

This commit is contained in:
zhangyu
2021-06-08 14:01:16 +08:00
parent a886f736b5
commit 10a79680b9

View File

@@ -1036,6 +1036,8 @@ export default {
this.confirmAdd() this.confirmAdd()
}, },
confirmAdd () { confirmAdd () {
this.$refs.chartForm.validate((valid) => {
if (valid) {
this.prevent_opt.save = true this.prevent_opt.save = true
this.elementTarget = [] // 初始化清空参数 this.elementTarget = [] // 初始化清空参数
if (this.editChart.type !== 'url' && this.editChart.type != 'text') { if (this.editChart.type !== 'url' && this.editChart.type != 'text') {
@@ -1127,6 +1129,8 @@ export default {
}) })
} }
} }
}
})
}, },
// 获取metric列表 // 获取metric列表
getSuggestMetric () { getSuggestMetric () {
@@ -1755,6 +1759,9 @@ export default {
} else { } else {
this.createData(this.showPanel.id, '', n.unit) this.createData(this.showPanel.id, '', n.unit)
} }
if ( this.editChart.param && !this.editChart.param.statistics) {
this.editChart.param.statistics = 'null'
}
} }
} }
}, },