py项目增加上下且或判断

master
e 3 years ago
parent 3537333baa
commit e09cd40788
  1. 4
      src/views/Program.vue
  2. 14
      src/views/Transaction.vue

@ -409,15 +409,11 @@ export default {
type: "warning", type: "warning",
center: true, center: true,
}).then(() => { }).then(() => {
// this.tableData.splice(index, 1);
console.log(index)
console.log(this.tableData.length)
if (index+1 == this.tableData.length){ if (index+1 == this.tableData.length){
this.tableData.splice(index - 1, 2) this.tableData.splice(index - 1, 2)
}else{ }else{
this.tableData.splice(index,2); this.tableData.splice(index,2);
} }
this.itemkey = Math.random() this.itemkey = Math.random()
this.isAddRule = false; this.isAddRule = false;
}).catch(() => {}) }).catch(() => {})

@ -894,7 +894,12 @@ export default {
this.$refs[`tree-${index}`].setCheckedKeys([this.tableData[index].operationIds]); this.$refs[`tree-${index}`].setCheckedKeys([this.tableData[index].operationIds]);
} }
} else { } 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); // index ? this.tableData.splice(index - 1, 1) : this.tableData.splice(0, 1);
this.isAddRule = false; this.isAddRule = false;
} }
@ -909,8 +914,11 @@ export default {
// if(index+1 == this.tableData.length){ // if(index+1 == this.tableData.length){
// index = index-1 // index = index-1
// } // }
this.tableData.splice(index,2); if (index+1 == this.tableData.length){
index ? this.tableData.splice(index - 1, 1) : this.tableData.splice(0, 1); this.tableData.splice(index - 1, 2)
}else{
this.tableData.splice(index,2);
}
this.itemkey = Math.random() this.itemkey = Math.random()
this.tableData.forEach(async (item, index) => { this.tableData.forEach(async (item, index) => {
// //

Loading…
Cancel
Save