diff --git a/frontend/src/business/components/settings/workspace/template/CustomFieldEdit.vue b/frontend/src/business/components/settings/workspace/template/CustomFieldEdit.vue index d7331c4391..45592910c6 100644 --- a/frontend/src/business/components/settings/workspace/template/CustomFieldEdit.vue +++ b/frontend/src/business/components/settings/workspace/template/CustomFieldEdit.vue @@ -143,9 +143,13 @@ export default { let param = {}; Object.assign(param, this.form); param.workspaceId = getCurrentWorkspaceId(); - for (const item of this.form.options) { + if (['select','multipleSelect','radio','checkbox'].indexOf(param.type) > -1 && param.options.length < 1) { + this.$warning(this.$t('custom_field.option_check')); + return; + } + for (const item of param.options) { if (!item.text || !item.value) { - this.$warning('请填写完整选项值'); + this.$warning(this.$t('custom_field.option_value_check')); return; } } diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index 5566856991..fffba6963f 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -312,6 +312,8 @@ export default { case_template: 'Test Case Template', default_template: 'Default Template', system_template: 'System Template', + option_check: 'Please add option values', + option_value_check: 'Please fill in the full option values', }, workspace: { create: 'Create Workspace', @@ -817,7 +819,7 @@ export default { wait_controller: "Wait controller", if_controller: "If controller", loop_controller: "Loop Controller", - transcation_controller: "Transcation controller", + transcation_controller:"Transcation controller", scenario_import: "Scenario import", customize_script: "Customize script", customize_req: "Customize req", @@ -1830,6 +1832,5 @@ export default { after_change: "After change", share: "Share", change_history: "Change history", - change_content: "Change content", } }; diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index 8bacf3a032..a537915318 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -313,6 +313,8 @@ export default { case_template: '测试用例模板', default_template: '默认模板', system_template: '系统模板', + option_check: '请添加选项值', + option_value_check: '请填写完整选项值', }, workspace: { create: '创建工作空间', @@ -1837,6 +1839,5 @@ export default { after_change: "变更后", share: "分享", change_history: "变更历史", - change_content: "变更内容", } }; diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index dd890826bb..4194767c61 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -313,6 +313,8 @@ export default { case_template: '測試用例模板', default_template: '默認模板', system_template: '系統模板', + option_check: '請添加選項值', + option_value_check: '請填寫完整選項值', }, workspace: { create: '創建工作空間', @@ -1837,6 +1839,5 @@ export default { after_change: "變更後", share: "分享", change_history: "變更歷史", - change_content: "变更内容", } };