diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 4673500421..8c28a159ab 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -1014,7 +1014,8 @@ export default { enum_exp: 'Enum', pls_slc: 'Please Select', filter_exp: 'Filter Value', - filter_type: 'Filter Type' + filter_type: 'Filter Type', + filter_value_can_not_str: 'Value type can not input string' }, dataset: { sheet_warn: 'There are multiple sheet pages, and the first one is extracted by default', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index 818a3abd64..387db945a4 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -1014,7 +1014,8 @@ export default { enum_exp: '字段枚舉值', pls_slc: '請選擇', filter_exp: '過濾值', - filter_type: '過濾方式' + filter_type: '過濾方式', + filter_value_can_not_str: '數值類型字段過濾值不能包含文本' }, dataset: { sheet_warn: '有多個 Sheet 頁,默認抽取第一個', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index a181fb4c20..7f39521431 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -1016,7 +1016,8 @@ export default { enum_exp: '字段枚举值', pls_slc: '请选择', filter_exp: '过滤值', - filter_type: '过滤方式' + filter_type: '过滤方式', + filter_value_can_not_str: '数值类型字段过滤值不能包含文本' }, dataset: { sheet_warn: '有多个 Sheet 页,默认抽取第一个', diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index b6ad408146..272f006aeb 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -1638,6 +1638,14 @@ export default { }) return } + if (parseFloat(f.value).toString() === 'NaN') { + this.$message({ + message: this.$t('chart.filter_value_can_not_str'), + type: 'error', + showClose: true + }) + return + } } if (this.quotaItem.filterType === 'quota') { this.view.yaxis[this.quotaItem.index].filter = this.quotaItem.filter @@ -1686,6 +1694,16 @@ export default { }) return } + if (this.filterItem.deType === 2 || this.filterItem.deType === 3) { + if (parseFloat(f.value).toString() === 'NaN') { + this.$message({ + message: this.$t('chart.filter_value_can_not_str'), + type: 'error', + showClose: true + }) + return + } + } } }