From df2a6af6a4b5f35596a870bee3a79e50c9572998 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Tue, 21 Jul 2020 21:37:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B5=8B=E8=AF=95=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E6=A8=A1=E7=89=88=E5=90=8D=E7=A7=B0=E7=89=B9=E6=AE=8A=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plan/view/comonents/report/TestCaseReportTemplateEdit.vue | 4 ++++ frontend/src/i18n/en-US.js | 1 + frontend/src/i18n/zh-CN.js | 1 + frontend/src/i18n/zh-TW.js | 1 + 4 files changed, 7 insertions(+) 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: "測試結果統計",