refactor: 仪表盘阈值范围校验

This commit is contained in:
junjun 2022-04-22 10:20:10 +08:00
parent a5d8d6cbbb
commit 3b0e2b86c1
4 changed files with 16 additions and 3 deletions

View File

@ -1088,7 +1088,8 @@ export default {
unit_ten_thousand: 'Ten Thousand',
unit_million: 'Million',
unit_hundred_million: 'Hundred Million',
formatter_decimal_count_error: 'Range 0-10'
formatter_decimal_count_error: 'Range 0-10',
gauge_threshold_compare_error: 'Range must added'
},
dataset: {
sheet_warn: 'There are multiple sheet pages, and the first one is extracted by default',

View File

@ -1088,7 +1088,8 @@ export default {
unit_ten_thousand: '萬',
unit_million: '百萬',
unit_hundred_million: '億',
formatter_decimal_count_error: '請輸入0-10的整數'
formatter_decimal_count_error: '請輸入0-10的整數',
gauge_threshold_compare_error: '阈值範圍需逐級遞增'
},
dataset: {
sheet_warn: '有多個 Sheet 頁,默認抽取第一個',

View File

@ -1091,7 +1091,8 @@ export default {
unit_ten_thousand: '万',
unit_million: '百万',
unit_hundred_million: '亿',
formatter_decimal_count_error: '请输入0-10的整数'
formatter_decimal_count_error: '请输入0-10的整数',
gauge_threshold_compare_error: '阈值范围需逐级递增'
},
dataset: {
sheet_warn: '有多个 Sheet 页,默认抽取第一个',

View File

@ -137,6 +137,16 @@ export default {
})
return
}
if (i > 0) {
if (parseFloat(ele) <= parseFloat(arr[i - 1])) {
this.$message({
message: this.$t('chart.gauge_threshold_compare_error'),
type: 'error',
showClose: true
})
return
}
}
}
}
this.changeThreshold()