fix(接口测试): 修复环境变量批量删除失效的缺陷
--bug=1019659 --user=王孝刚 【接口测试】环境变量批量删除,没有变量名称的删不掉 https://www.tapd.cn/55049933/s/1296980
This commit is contained in:
parent
1f5e0bf2f0
commit
f703667a67
|
@ -76,7 +76,7 @@
|
||||||
<el-switch v-model="scope.row.enable" size="mini"/>
|
<el-switch v-model="scope.row.enable" size="mini"/>
|
||||||
<el-tooltip effect="dark" :content="$t('commons.remove')" placement="top-start">
|
<el-tooltip effect="dark" :content="$t('commons.remove')" placement="top-start">
|
||||||
<el-button icon="el-icon-delete" type="danger" circle size="mini" style="margin-left: 10px"
|
<el-button icon="el-icon-delete" type="danger" circle size="mini" style="margin-left: 10px"
|
||||||
@click="remove(scope.row)" v-if="scope.row.name"/>
|
@click="remove(scope.row)" v-if="isDisable(scope.row)"/>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-tooltip effect="dark" :content="$t('schema.adv_setting')" placement="top-start">
|
<el-tooltip effect="dark" :content="$t('schema.adv_setting')" placement="top-start">
|
||||||
<el-button icon="el-icon-setting" circle size="mini" style="margin-left: 10px"
|
<el-button icon="el-icon-setting" circle size="mini" style="margin-left: 10px"
|
||||||
|
@ -247,10 +247,12 @@ export default {
|
||||||
operationConfirm(this, this.$t('api_test.environment.variables_delete_info') + " ?", () => {
|
operationConfirm(this, this.$t('api_test.environment.variables_delete_info') + " ?", () => {
|
||||||
let ids = this.$refs.variableTable.selectRows;
|
let ids = this.$refs.variableTable.selectRows;
|
||||||
ids.forEach(row => {
|
ids.forEach(row => {
|
||||||
if (row.name) {
|
if (row.id) {
|
||||||
const index = this.variables.findIndex(d => d.name === row.name);
|
const index = this.variables.findIndex(d => d.id === row.id);
|
||||||
|
if (index !== this.variables.length - 1) {
|
||||||
this.variables.splice(index, 1);
|
this.variables.splice(index, 1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
this.sortParameters();
|
this.sortParameters();
|
||||||
this.$refs.variableTable.cancelCurrentRow();
|
this.$refs.variableTable.cancelCurrentRow();
|
||||||
|
@ -276,8 +278,9 @@ export default {
|
||||||
openSetting(data) {
|
openSetting(data) {
|
||||||
this.$refs.apiVariableSetting.open(data);
|
this.$refs.apiVariableSetting.open(data);
|
||||||
},
|
},
|
||||||
isDisable: function (index) {
|
isDisable: function (row) {
|
||||||
return this.items.length - 1 === index;
|
const index = this.variables.findIndex(d => d.name === row.name);
|
||||||
|
return this.variables.length - 1 !== index;
|
||||||
},
|
},
|
||||||
_handleBatchVars(data) {
|
_handleBatchVars(data) {
|
||||||
let params = data.split("\n");
|
let params = data.split("\n");
|
||||||
|
|
Loading…
Reference in New Issue