Merge pull request #9327 from dataease/pr@dev@fix_formatter_cfg_edit
fix(视图): 修复编辑单个指标的数值格式化时其他指标也受影响 #9126
This commit is contained in:
commit
4f0af1913b
@ -3708,7 +3708,9 @@ export default {
|
|||||||
this.showValueFormatter = false
|
this.showValueFormatter = false
|
||||||
},
|
},
|
||||||
saveValueFormatter() {
|
saveValueFormatter() {
|
||||||
const ele = this.valueFormatterItem.formatterCfg.decimalCount
|
const formatterItem = _.cloneDeep(this.valueFormatterItem)
|
||||||
|
const formatterCfg = formatterItem.formatterCfg
|
||||||
|
const ele = formatterCfg.decimalCount
|
||||||
if (ele === undefined || ele.toString().indexOf('.') > -1 || parseInt(ele).toString() === 'NaN' || parseInt(ele) < 0 || parseInt(ele) > 10) {
|
if (ele === undefined || ele.toString().indexOf('.') > -1 || parseInt(ele).toString() === 'NaN' || parseInt(ele) < 0 || parseInt(ele) > 10) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: this.$t('chart.formatter_decimal_count_error'),
|
message: this.$t('chart.formatter_decimal_count_error'),
|
||||||
@ -3718,14 +3720,14 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 更新指标
|
// 更新指标
|
||||||
if (this.valueFormatterItem.formatterType === 'quota' && this.chart.type !== 'bar-time-range') {
|
if (formatterItem.formatterType === 'quota' && this.chart.type !== 'bar-time-range') {
|
||||||
this.view.yaxis[this.valueFormatterItem.index].formatterCfg = this.valueFormatterItem.formatterCfg
|
this.view.yaxis[formatterItem.index].formatterCfg = formatterCfg
|
||||||
} else if (this.valueFormatterItem.formatterType === 'quotaExt') {
|
} else if (formatterItem.formatterType === 'quotaExt') {
|
||||||
this.view.yaxisExt[this.valueFormatterItem.index].formatterCfg = this.valueFormatterItem.formatterCfg
|
this.view.yaxisExt[formatterItem.index].formatterCfg = formatterCfg
|
||||||
} else if (this.valueFormatterItem.formatterType === 'dimension') {
|
} else if (formatterItem.formatterType === 'dimension') {
|
||||||
this.view.xaxis[this.valueFormatterItem.index].formatterCfg = this.valueFormatterItem.formatterCfg
|
this.view.xaxis[formatterItem.index].formatterCfg = formatterCfg
|
||||||
} else if (this.chart.type === 'bar-time-range') {
|
} else if (this.chart.type === 'bar-time-range') {
|
||||||
this.view.xaxisExt[this.valueFormatterItem.index].formatterCfg = this.valueFormatterItem.formatterCfg
|
this.view.xaxisExt[formatterItem.index].formatterCfg = formatterCfg
|
||||||
}
|
}
|
||||||
this.calcData(true)
|
this.calcData(true)
|
||||||
this.closeValueFormatter()
|
this.closeValueFormatter()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user