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"
:placeholder="$t('api_test.variable_name')"
show-word-limit
@change="change"
@change="change(scope.row)"
/>
</template>
</ms-table-column>
@ -365,7 +365,7 @@ export default {
});
},
// change
change: function () {
change: function (row) {
let isNeedCreate = true;
let removeIndex = -1;
let repeatKey = "";
@ -377,6 +377,9 @@ export default {
repeatKey = item.name;
} else {
itemNames.add(item.name);
if(row && item.id === row.id) {
item.name = row.name;
}
}
//
@ -410,7 +413,7 @@ export default {
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";
}
this.items.forEach((item) => {
if (item.name === data.name) {
if (item.id === data.id) {
item.scope = value;
item.type = data.type;
item.value = data.value;
}
});
},
changeVariableVal(data) {
changeVariableVal(row) {
this.items.forEach((item) => {
if (item.name === data.name) {
item.value = data.value;
if (item.id === row.id) {
item.value = row.value;
}
});
},
//
descriptionChange(data) {
descriptionChange(row) {
this.items.forEach((item) => {
if (item.name === data.name) {
item.description = data.description;
if (item.id === row.id) {
item.description = row.description;
}
});
},
//
enableChange(data) {
enableChange(row) {
this.items.forEach((item) => {
if (item.name === data.name) {
item.enable = data.enable;
if (item.id === row.id) {
item.enable = row.enable;
}
});
},