From 3bd4b793e14315c88e211eef7f0eaea22a53afbe Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Sat, 8 May 2021 13:39:46 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=8E=AF=E5=A2=83=E7=B1=BB=E5=9E=8B=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E4=BF=AE=E6=94=B9=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/automation/scenario/ApiScenarioModule.vue | 1 + .../definition/components/module/ApiModule.vue | 1 + .../environment/EnvironmentHttpConfig.vue | 15 ++++++++++++--- frontend/src/i18n/en-US.js | 1 + frontend/src/i18n/zh-CN.js | 1 + frontend/src/i18n/zh-TW.js | 1 + 6 files changed, 17 insertions(+), 3 deletions(-) diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue index f59fb6763a..e18d1c36ec 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue @@ -6,6 +6,7 @@ {{$t('api_test.environment.condition_enable')}} - + {{ $t('api_test.definition.document.data_set.none') }} {{$t('test_track.module.module')}} {{$t('api_test.definition.api_path')}} @@ -123,6 +123,7 @@ loading: false, pathDetails: new KeyValue({name: "", value: "contains"}), condition: {type: "NONE", details: [new KeyValue({name: "", value: "contains"})], protocol: "http", socket: "", domain: "", port: 0, headers: [new KeyValue()]}, + beforeCondition: {} }; }, watch: { @@ -201,8 +202,14 @@ }); } } + this.beforeCondition = JSON.parse(JSON.stringify(this.condition)); }, typeChange() { + if (this.condition.type === "NONE" && this.condition.id && this.checkNode(this.condition.id)) { + this.condition.type = this.beforeCondition.type; + this.$warning("启用条件为 '无' 的域名已经存在!"); + return; + } switch (this.condition.type) { case "NONE": this.condition.details = []; @@ -263,11 +270,13 @@ this.loading = false }); }, - checkNode() { + checkNode(id) { let index = 1; this.httpConfig.conditions.forEach(item => { if (item.type === "NONE") { - index++; + if(!id || id !== item.id) { + index++; + } } }) return index > 1; diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index cd49e91b2e..9a91ba7469 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -155,6 +155,7 @@ export default { node_name_tip: "The name cannot contain'\\'", more_operator: "More operator", mock: "Mock settings", + all_module_title: "All module", table: { select_tip: "Item {0} data is selected" }, diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index 925e33289a..7201ebada4 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -156,6 +156,7 @@ export default { node_name_tip: "名称不能包含'\\'", more_operator: "更多操作", mock: "Mock 设置", + all_module_title: "全部模块", table: { select_tip: "已选中 {0} 条数据" }, diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index d0b712b869..cf7be57fad 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -156,6 +156,7 @@ export default { node_name_tip: "名稱不能包含'\\'", more_operator: "更多操作", mock: "Mock 設置", + all_module_title: "全部模塊", table: { select_tip: "已選中 {0} 條數據" },