From e09cd40788cff5cd517a40ac95de540020b82433 Mon Sep 17 00:00:00 2001 From: e <2432808546@qq.com> Date: Tue, 21 Dec 2021 14:32:50 +0800 Subject: [PATCH] =?UTF-8?q?py=E9=A1=B9=E7=9B=AE=E5=A2=9E=E5=8A=A0=E4=B8=8A?= =?UTF-8?q?=E4=B8=8B=E4=B8=94=E6=88=96=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Program.vue | 4 ---- src/views/Transaction.vue | 14 +++++++++++--- 2 files changed, 11 insertions(+), 7 deletions(-) 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) => { // 勾选树节点