From b6a8c2aa6f4473818d03903099d2e9e78a4427ef Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Tue, 11 Oct 2022 19:34:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=B9=E9=87=8F=E6=B7=BB=E5=8A=A0=E5=8F=98?= =?UTF-8?q?=E9=87=8F=EF=BC=8C=E5=A4=9A=E6=AC=A1=E5=BC=B9=E7=AA=97=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1017831 --user=王孝刚 【接口测试】接口批量添加变量,会弹出多个提示框 https://www.tapd.cn/55049933/s/1258968 --- .../definition/components/basis/BatchAddParameter.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/api-test/frontend/src/business/definition/components/basis/BatchAddParameter.vue b/api-test/frontend/src/business/definition/components/basis/BatchAddParameter.vue index af9306dbc0..6918e861d9 100644 --- a/api-test/frontend/src/business/definition/components/basis/BatchAddParameter.vue +++ b/api-test/frontend/src/business/definition/components/basis/BatchAddParameter.vue @@ -63,23 +63,29 @@ export default { let params = this.parameters.split("\n"); let index = 1; let isNormal = true; + let msg = ''; params.forEach(item => { if (item) { let line = item.split(/:|:/); if (!line[0]) { isNormal = false; - this.$warning(this.$t('api_test.params_format_warning', [index]) + " :" + this.$t('api_test.automation.variable_warning')); - return; + let indexMsg = index + '、'; + msg = msg + indexMsg; } index++; } }); + if (msg !== '') { + this.$warning(this.$t('api_test.params_format_warning', [msg.slice(0, msg.length - 1)]) + " :" + this.$t('api_test.automation.variable_warning')); + } if (isNormal) { this.dialogVisible = false; this.$emit("batchSave", this.parameters); this.parameters = ""; } + } + } }