fix(接口定义): 修复场景变量批量添加未覆盖的缺陷
--bug=1016048 --user=王孝刚 【接口测试】批量添加场景变量,同名变量没覆盖 https://www.tapd.cn/55049933/s/1228204
This commit is contained in:
parent
b04409a456
commit
569a4f539f
|
@ -352,10 +352,20 @@ export default {
|
||||||
batchSaveParameter(data) {
|
batchSaveParameter(data) {
|
||||||
if (data) {
|
if (data) {
|
||||||
let keyValues = this._handleBatchVars(data);
|
let keyValues = this._handleBatchVars(data);
|
||||||
keyValues.forEach(item => {
|
keyValues.forEach(keyValue => {
|
||||||
item.type = 'CONSTANT';
|
let isAdd = true;
|
||||||
this.addParameters(item);
|
keyValue.id = getUUID();
|
||||||
|
this.variables.forEach(item => {
|
||||||
|
if (item.name === keyValue.name) {
|
||||||
|
item.value = keyValue.value;
|
||||||
|
isAdd = false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (isAdd) {
|
||||||
|
this.variables.splice(this.variables.length, 0, keyValue);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
this.sortParameters();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleClick(command) {
|
handleClick(command) {
|
||||||
|
@ -462,13 +472,11 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let repeatKey = "";
|
let repeatKey = "";
|
||||||
if (!this.showDelete) {
|
this.variables.forEach((item) => {
|
||||||
this.variables.forEach((item, index) => {
|
if (item.name === this.editData.name) {
|
||||||
if (item.name === this.editData.name) {
|
repeatKey = item.name;
|
||||||
repeatKey = item.name;
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
if (repeatKey !== "") {
|
if (repeatKey !== "") {
|
||||||
this.$warning(this.$t('api_test.scenario.variables') + "【" + repeatKey + "】" + this.$t('load_test.param_is_duplicate'));
|
this.$warning(this.$t('api_test.scenario.variables') + "【" + repeatKey + "】" + this.$t('load_test.param_is_duplicate'));
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue