fix: 修改table新增有多余参数的问题

This commit is contained in:
zhangyu
2021-12-15 09:51:04 +08:00
parent 8452916491
commit 06cc43e340
2 changed files with 6 additions and 1 deletions

View File

@@ -170,6 +170,9 @@ export default {
params.groupId = 0 params.groupId = 0
} }
delete params.panel delete params.panel
if (params.type === 'table') {
delete params.param.tags
}
if (params.id) { // 修改 if (params.id) { // 修改
this.$put('visual/panel/chart', params).then(response => { this.$put('visual/panel/chart', params).then(response => {
if (response.code === 200) { if (response.code === 200) {
@@ -329,7 +332,6 @@ export default {
immediate: true, immediate: true,
handler (n) { handler (n) {
this.editChart = JSON.parse(JSON.stringify(n)) this.editChart = JSON.parse(JSON.stringify(n))
console.log(this.editChart)
if (this.editChart.groupId === -1) { if (this.editChart.groupId === -1) {
this.editChart.groupId = '' this.editChart.groupId = ''
} }

View File

@@ -415,6 +415,9 @@ export default {
if (!this.chart.groupId || this.chart.groupId == -1) { if (!this.chart.groupId || this.chart.groupId == -1) {
this.chart.groupId = '' this.chart.groupId = ''
} }
if (this.chart.type == 'table') {
this.chart.param.tags = this.chart.param.indexs ? this.chart.param.indexs.split(',') : []
}
} else { } else {
this.$message.error(res.msg) this.$message.error(res.msg)
} }