字段一致性规则:用户编辑器中至少出现如下语句
@@ -199,6 +203,13 @@ export default { console.log(err) }); }, + // 设置序号 + setIndex() { + let i = 0 + this.tableData.map(e => { + if (e.isSubject) e.index = i++ + }) + }, // 重新封装数据 anewPosttingData(judgmentRule){ let length = judgmentRule.length; @@ -239,7 +250,7 @@ export default { tempArr.push({ruleOperation: item.ruleOperation}); } this.tableData = tempArr; - console.log(this.tableData) + this.setIndex() }); }, handleBlur() { // 新增/编辑判分点名称判重 @@ -372,6 +383,7 @@ export default { value5: "" }); } + this.setIndex() } }, changeResult(row) { // (左右)结果运算符(0:且 1:或 默认0) @@ -402,6 +414,7 @@ export default { // this.tableData.splice(index, 1); this.isAddRule = false; } + this.setIndex() }, handleDelete(index) { // 处理删除规则 this.$confirm("此操作将永久删除该规则, 是否继续?", "提示", { @@ -417,6 +430,7 @@ export default { } this.itemkey = Math.random() this.isAddRule = false; + this.setIndex() }).catch(() => {}) }, // 表头样式设置 diff --git a/src/views/Transaction.vue b/src/views/Transaction.vue index 7f26a09..2dfaa80 100644 --- a/src/views/Transaction.vue +++ b/src/views/Transaction.vue @@ -85,6 +85,9 @@ header-align="center" >