feat: 新增 切换 datasource 以及 type 清空部分不需要的参数

This commit is contained in:
zhangyu
2021-12-01 17:12:02 +08:00
parent cc6bfbbdc2
commit 9aa66facc6
4 changed files with 163 additions and 100 deletions

View File

@@ -237,9 +237,25 @@ export default {
},
datasourceChange (val, e) {
console.log(val, e, this.editChart.datasource)
if (this.editChart.datasource == 1) {
this.editChart = {
...this.editChart,
span: 4,
height: 4,
unit: 2,
type: 'line',
elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A' }],
param: {
stack: 0,
nullType: 'null',
legend: { placement: 'bottom', values: [], show: true },
thresholdShow: true,
thresholds: [{ value: '', color: '#eeeeeeff' }]
}
}
}
},
editChartChange (newEditChart) {
console.log(newEditChart)
this.editChart = JSON.parse(JSON.stringify(newEditChart))
}
},