diff --git a/frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportTemplateEdit.vue b/frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportTemplateEdit.vue index 318c7cac11..87a24f035b 100644 --- a/frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportTemplateEdit.vue +++ b/frontend/src/business/components/track/plan/view/comonents/report/TestCaseReportTemplateEdit.vue @@ -219,12 +219,16 @@ }); }, handleSave() { + let pattern = new RegExp("[`~!@#$^&*=|{}':;',<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]"); if (this.template.name == null || this.template.name == '') { this.$warning(this.$t('test_track.plan_view.input_template_name')); return; } else if (this.template.name.length > 64) { this.$warning(this.$t('commons.name') + this.$t('test_track.length_less_than') + '64'); return; + } else if (pattern.test(this.template.name)) { + this.$warning(this.$t('test_track.plan_view.template_special_characters')); + return; } let param = {}; this.buildParam(param); diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index 9f0e292710..fa6a34cd7f 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -602,6 +602,7 @@ export default { component_library_tip: "Drag and drop the component from the component library, add to the right, preview the report effect, only one can be added per system component.", delete_component_tip: "Please reserve at least one component", input_template_name: "Input template name", + template_special_characters: 'Template name does not support special characters', case_count: "Case count", issues_count: "Issues count", result_statistics: "Result statistics", diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index 9660a09383..cfa62fe7ba 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -602,6 +602,7 @@ export default { component_library_tip: "拖拽组件库中组件,添加至右侧,预览报告效果,每个系统组件只能添加一个。", delete_component_tip: "请至少保留一个组件", input_template_name: "输入模版名称", + template_special_characters: '模版名称不支持特殊字符', case_count: "用例数", issues_count: "缺陷数", result_statistics: "测试结果统计", diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index 9ad4600e9d..1a2bf8efce 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -601,6 +601,7 @@ export default { component_library_tip: "拖拽組件庫中組件,添加至右側,預覽報告效果,每個系統組件只能添加壹個。", delete_component_tip: "請至少保留壹個組件", input_template_name: "輸入模版名稱", + template_special_characters: '模版名稱不支持特殊字符', case_count: "用例數", issues_count: "缺陷數", result_statistics: "測試結果統計",