diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 033b0da0bf..dd94163107 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -1013,7 +1013,8 @@ export default { merge: 'Merge', no_merge: 'Dont Merge', merge_msg: 'If the fields in the data table are consistent, merge them into one data set?', - merge_title: 'Merge data' + merge_title: 'Merge data', + field_name_less_50: 'Field name can not more 50 chars.' }, datasource: { datasource: 'Data Source', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index a973e69f36..5a34132bcf 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -1013,7 +1013,8 @@ export default { merge: '合併', no_merge: '不合併', merge_msg: '數據表中存在自斷一直的情況,是否合併到一個數據集中?', - merge_title: '合併數據' + merge_title: '合併數據', + field_name_less_50: '字段名不能超過50個字符' }, datasource: { datasource: '數據源', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index 285de2d1d8..57126190ef 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -1013,7 +1013,8 @@ export default { merge: '合并', no_merge: '不合并', merge_msg: '数据表中存在字段一致的情况,是否合并到一个数据集中?', - merge_title: '合并数据' + merge_title: '合并数据', + field_name_less_50: '字段名不能超过50个字符' }, datasource: { datasource: '数据源', diff --git a/frontend/src/views/dataset/data/CalcFieldEdit.vue b/frontend/src/views/dataset/data/CalcFieldEdit.vue index ede881388d..74d833eb76 100644 --- a/frontend/src/views/dataset/data/CalcFieldEdit.vue +++ b/frontend/src/views/dataset/data/CalcFieldEdit.vue @@ -312,6 +312,10 @@ export default { }, saveCalcField() { + if (this.fieldForm.name && this.fieldForm.name.length > 50) { + this.$message.error(this.$t('dataset.field_name_less_50')) + return + } if (!this.fieldForm.id) { this.fieldForm.type = this.fieldForm.deType this.fieldForm.deExtractType = this.fieldForm.deType diff --git a/frontend/src/views/dataset/data/FieldEdit.vue b/frontend/src/views/dataset/data/FieldEdit.vue index e71e8fe46b..bc4408383c 100644 --- a/frontend/src/views/dataset/data/FieldEdit.vue +++ b/frontend/src/views/dataset/data/FieldEdit.vue @@ -327,6 +327,10 @@ export default { // // this.closeEdit() // this.initField() // }) + if (item.name && item.name.length > 50) { + this.$message.error(this.$t('dataset.field_name_less_50')) + return + } post('/dataset/field/save', item).then(response => { this.initField()