diff --git a/framework/sdk-parent/frontend/src/components/environment/commons/ApiScenarioVariables.vue b/framework/sdk-parent/frontend/src/components/environment/commons/ApiScenarioVariables.vue index 0bd49e273c..44669f6e2f 100644 --- a/framework/sdk-parent/frontend/src/components/environment/commons/ApiScenarioVariables.vue +++ b/framework/sdk-parent/frontend/src/components/environment/commons/ApiScenarioVariables.vue @@ -76,7 +76,7 @@ + @click="remove(scope.row)" v-if="isDisable(scope.row)"/> { let ids = this.$refs.variableTable.selectRows; ids.forEach(row => { - if (row.name) { - const index = this.variables.findIndex(d => d.name === row.name); - this.variables.splice(index, 1); + if (row.id) { + const index = this.variables.findIndex(d => d.id === row.id); + if (index !== this.variables.length - 1) { + this.variables.splice(index, 1); + } } }); this.sortParameters(); @@ -276,8 +278,9 @@ export default { openSetting(data) { this.$refs.apiVariableSetting.open(data); }, - isDisable: function (index) { - return this.items.length - 1 === index; + isDisable: function (row) { + const index = this.variables.findIndex(d => d.name === row.name); + return this.variables.length - 1 !== index; }, _handleBatchVars(data) { let params = data.split("\n");