diff --git a/src/views/Program.vue b/src/views/Program.vue index d7a4cf4..07b0792 100644 --- a/src/views/Program.vue +++ b/src/views/Program.vue @@ -409,15 +409,11 @@ export default { type: "warning", center: true, }).then(() => { - // this.tableData.splice(index, 1); - console.log(index) - console.log(this.tableData.length) if (index+1 == this.tableData.length){ this.tableData.splice(index - 1, 2) }else{ this.tableData.splice(index,2); } - this.itemkey = Math.random() this.isAddRule = false; }).catch(() => {}) diff --git a/src/views/Transaction.vue b/src/views/Transaction.vue index 0a81b91..3ab97f6 100644 --- a/src/views/Transaction.vue +++ b/src/views/Transaction.vue @@ -894,7 +894,12 @@ export default { this.$refs[`tree-${index}`].setCheckedKeys([this.tableData[index].operationIds]); } } else { - this.tableData.splice(index-1, 2); + if (index+1 == this.tableData.length){ + this.tableData.splice(index - 1, 2) + }else{ + this.tableData.splice(index,2); + } + // this.tableData.splice(index-1, 2); // index ? this.tableData.splice(index - 1, 1) : this.tableData.splice(0, 1); this.isAddRule = false; } @@ -909,8 +914,11 @@ export default { // if(index+1 == this.tableData.length){ // index = index-1 // } - this.tableData.splice(index,2); - index ? this.tableData.splice(index - 1, 1) : this.tableData.splice(0, 1); + if (index+1 == this.tableData.length){ + this.tableData.splice(index - 1, 2) + }else{ + this.tableData.splice(index,2); + } this.itemkey = Math.random() this.tableData.forEach(async (item, index) => { // 勾选树节点