fix:修复复制图表 旧数据中不存在的字段报错
This commit is contained in:
@@ -435,6 +435,20 @@ 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 === 'line' || this.chart.type === 'area' || this.chart.type === 'point') && !this.chart.param.rightYAxis) {
|
||||||
|
this.chart.param.rightYAxis = {
|
||||||
|
elementNames: [],
|
||||||
|
style: 'line',
|
||||||
|
unit: 2,
|
||||||
|
label: '',
|
||||||
|
min: undefined,
|
||||||
|
max: undefined
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.chart.type === 'stat') {
|
||||||
|
if (!this.chart.param.sparklineMode) { this.chart.param.sparklineMode = 'none' }
|
||||||
|
if (!this.chart.param.comparison) { this.chart.param.comparison = 'none' }
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.rightBox.loading = true
|
this.rightBox.loading = true
|
||||||
this.$get('visual/dashboard/chart/' + data.id).then(res => {
|
this.$get('visual/dashboard/chart/' + data.id).then(res => {
|
||||||
@@ -449,7 +463,10 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.chart.param = {}
|
this.chart.param = {}
|
||||||
}
|
}
|
||||||
if (!this.chart.param.rightYAxis) {
|
if (!this.chart.groupId || this.chart.groupId == -1) {
|
||||||
|
this.chart.groupId = ''
|
||||||
|
}
|
||||||
|
if ((this.chart.type === 'line' || this.chart.type === 'area' || this.chart.type === 'point') && !this.chart.param.rightYAxis) {
|
||||||
this.chart.param.rightYAxis = {
|
this.chart.param.rightYAxis = {
|
||||||
elementNames: [],
|
elementNames: [],
|
||||||
style: 'line',
|
style: 'line',
|
||||||
@@ -459,9 +476,6 @@ export default {
|
|||||||
max: undefined
|
max: undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!this.chart.groupId || this.chart.groupId == -1) {
|
|
||||||
this.chart.groupId = ''
|
|
||||||
}
|
|
||||||
if (this.chart.type === 'stat') {
|
if (this.chart.type === 'stat') {
|
||||||
if (!this.chart.param.sparklineMode) { this.chart.param.sparklineMode = 'none' }
|
if (!this.chart.param.sparklineMode) { this.chart.param.sparklineMode = 'none' }
|
||||||
if (!this.chart.param.comparison) { this.chart.param.comparison = 'none' }
|
if (!this.chart.param.comparison) { this.chart.param.comparison = 'none' }
|
||||||
|
|||||||
@@ -604,6 +604,20 @@ 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 === 'line' || this.chart.type === 'area' || this.chart.type === 'point') && !this.chart.param.rightYAxis) {
|
||||||
|
this.chart.param.rightYAxis = {
|
||||||
|
elementNames: [],
|
||||||
|
style: 'line',
|
||||||
|
unit: 2,
|
||||||
|
label: '',
|
||||||
|
min: undefined,
|
||||||
|
max: undefined
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.chart.type === 'stat') {
|
||||||
|
if (!this.chart.param.sparklineMode) { this.chart.param.sparklineMode = 'none' }
|
||||||
|
if (!this.chart.param.comparison) { this.chart.param.comparison = 'none' }
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.rightBox.loading = true
|
this.rightBox.loading = true
|
||||||
this.$get('visual/dashboard/chart/' + data.id).then(res => {
|
this.$get('visual/dashboard/chart/' + data.id).then(res => {
|
||||||
@@ -618,7 +632,10 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.chart.param = {}
|
this.chart.param = {}
|
||||||
}
|
}
|
||||||
if (!this.chart.param.rightYAxis) {
|
if (!this.chart.groupId || this.chart.groupId == -1) {
|
||||||
|
this.chart.groupId = ''
|
||||||
|
}
|
||||||
|
if ((this.chart.type === 'line' || this.chart.type === 'area' || this.chart.type === 'point') && !this.chart.param.rightYAxis) {
|
||||||
this.chart.param.rightYAxis = {
|
this.chart.param.rightYAxis = {
|
||||||
elementNames: [],
|
elementNames: [],
|
||||||
style: 'line',
|
style: 'line',
|
||||||
@@ -628,9 +645,6 @@ export default {
|
|||||||
max: undefined
|
max: undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!this.chart.groupId || this.chart.groupId == -1) {
|
|
||||||
this.chart.groupId = ''
|
|
||||||
}
|
|
||||||
if (this.chart.type === 'stat') {
|
if (this.chart.type === 'stat') {
|
||||||
if (!this.chart.param.sparklineMode) { this.chart.param.sparklineMode = 'none' }
|
if (!this.chart.param.sparklineMode) { this.chart.param.sparklineMode = 'none' }
|
||||||
if (!this.chart.param.comparison) { this.chart.param.comparison = 'none' }
|
if (!this.chart.param.comparison) { this.chart.param.comparison = 'none' }
|
||||||
|
|||||||
Reference in New Issue
Block a user