mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-11-30 19:18:59 +08:00
fix(接口定义): 修复批量添加变量,多次弹窗提示的缺陷
--bug=1017831 --user=王孝刚 【接口测试】接口批量添加变量,会弹出多个提示框 https://www.tapd.cn/55049933/s/1258968
This commit is contained in:
parent
04e321d5ff
commit
b6a8c2aa6f
@ -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 = "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user