fix(接口管理): 修复环境配置通用配置出现丢值的问题

This commit is contained in:
RubyLiu 2023-12-21 11:46:05 +08:00 committed by 刘瑞斌
parent e41c091300
commit 7b0364f018
1 changed files with 16 additions and 13 deletions

View File

@ -110,7 +110,7 @@
maxlength="200" maxlength="200"
:placeholder="$t('api_test.variable_name')" :placeholder="$t('api_test.variable_name')"
show-word-limit show-word-limit
@change="change" @change="change(scope.row)"
/> />
</template> </template>
</ms-table-column> </ms-table-column>
@ -365,7 +365,7 @@ export default {
}); });
}, },
// change // change
change: function () { change: function (row) {
let isNeedCreate = true; let isNeedCreate = true;
let removeIndex = -1; let removeIndex = -1;
let repeatKey = ""; let repeatKey = "";
@ -377,6 +377,9 @@ export default {
repeatKey = item.name; repeatKey = item.name;
} else { } else {
itemNames.add(item.name); itemNames.add(item.name);
if(row && item.id === row.id) {
item.name = row.name;
}
} }
// //
@ -410,7 +413,7 @@ export default {
scope: "api", scope: "api",
}) })
); );
this.currentPage = Math.ceil(this.allData.length / this.pageSize); this.currentPage = Math.ceil(this.items.length / this.pageSize);
} }
// //
@ -437,33 +440,33 @@ export default {
data.type = "STRING"; data.type = "STRING";
} }
this.items.forEach((item) => { this.items.forEach((item) => {
if (item.name === data.name) { if (item.id === data.id) {
item.scope = value; item.scope = value;
item.type = data.type; item.type = data.type;
item.value = data.value; item.value = data.value;
} }
}); });
}, },
changeVariableVal(data) { changeVariableVal(row) {
this.items.forEach((item) => { this.items.forEach((item) => {
if (item.name === data.name) { if (item.id === row.id) {
item.value = data.value; item.value = row.value;
} }
}); });
}, },
// //
descriptionChange(data) { descriptionChange(row) {
this.items.forEach((item) => { this.items.forEach((item) => {
if (item.name === data.name) { if (item.id === row.id) {
item.description = data.description; item.description = row.description;
} }
}); });
}, },
// //
enableChange(data) { enableChange(row) {
this.items.forEach((item) => { this.items.forEach((item) => {
if (item.name === data.name) { if (item.id === row.id) {
item.enable = data.enable; item.enable = row.enable;
} }
}); });
}, },