|
|
|
@ -385,11 +385,33 @@ export default { |
|
|
|
|
lcJudgmentPoint: judgmentPoint, |
|
|
|
|
lcJudgmentRuleList: judgmentRuleList |
|
|
|
|
}; |
|
|
|
|
this.anewPosttingData(judgmentRuleList) |
|
|
|
|
this.tableData.forEach(async (item, index) => { |
|
|
|
|
// 勾选树节点 |
|
|
|
|
if (item.operationIds) { |
|
|
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.$refs[`tree-${index}`].setCheckedKeys([item.operationIds]); |
|
|
|
|
// this.scrollToDepTree(item.operationIds) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
// 根据题目id,获取题目信息 |
|
|
|
|
if (item.isSubject && item.type && item.type != 4 && item.emptyOne) { |
|
|
|
|
await this.getSubjectData(item.emptyOne, index); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
this.$message.warning(res.message); |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
|
console.log(err); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 重新封装数据 |
|
|
|
|
anewPosttingData(judgmentRuleList){ |
|
|
|
|
let length = judgmentRuleList.length; |
|
|
|
|
let tempArr = []; |
|
|
|
|
console.log(judgmentRuleList) |
|
|
|
|
judgmentRuleList.forEach((item, index) => { |
|
|
|
|
let obj = { |
|
|
|
|
...item, |
|
|
|
@ -427,26 +449,6 @@ export default { |
|
|
|
|
} |
|
|
|
|
this.tableData = tempArr; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.tableData.forEach(async (item, index) => { |
|
|
|
|
// 勾选树节点 |
|
|
|
|
if (item.operationIds) { |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.$refs[`tree-${index}`].setCheckedKeys([item.operationIds]); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
// 根据题目id,获取题目信息 |
|
|
|
|
if (item.isSubject && item.type && item.type != 4 && item.emptyOne) { |
|
|
|
|
await this.getSubjectData(item.emptyOne, index); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
this.$message.warning(res.message); |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
|
console.log(err); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
getSubjectData(subjectId, index) { // 获取题目信息 |
|
|
|
|
this.$get(`${this.api.getSubjectInfo}?subject_id=${subjectId}`).then(res => { |
|
|
|
@ -488,7 +490,7 @@ export default { |
|
|
|
|
if (res.status === 200 && res.list) { |
|
|
|
|
if (res.list.length) { |
|
|
|
|
this.treeData = this.toTreeId(res.list, res.list[0].parentId); |
|
|
|
|
console.log(this.treeData) |
|
|
|
|
// console.log(this.treeData) |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
this.$message.warning(res.message); |
|
|
|
@ -630,6 +632,8 @@ export default { |
|
|
|
|
this.isAddRule = true; |
|
|
|
|
// this.tableData.length && this.tableData.push({ruleOperation: 0, indexNo: ""}); |
|
|
|
|
this.tableData.push({ |
|
|
|
|
ruleOperation: 0 |
|
|
|
|
},{ |
|
|
|
|
indexNo: this.tableData.length +1, |
|
|
|
|
isSubject: true, |
|
|
|
|
isDisabled: false, // 不禁用 |
|
|
|
@ -645,6 +649,7 @@ export default { |
|
|
|
|
value5: "" |
|
|
|
|
}); |
|
|
|
|
console.log(this.tableData) |
|
|
|
|
// anewPosttingData(judgmentRuleList) |
|
|
|
|
}, |
|
|
|
|
changeResult(row) { // (左右)结果运算符(0:且 1:或 默认0) |
|
|
|
|
row.resultOperation = row.resultOperation === 0 ? 1 : 0; |
|
|
|
@ -713,7 +718,7 @@ export default { |
|
|
|
|
this.$refs[`tree-${index}`].setCheckedKeys([this.tableData[index].operationIds]); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
this.tableData.splice(index, 1); |
|
|
|
|
this.tableData.splice(index-1, 2); |
|
|
|
|
// index ? this.tableData.splice(index - 1, 1) : this.tableData.splice(0, 1); |
|
|
|
|
this.isAddRule = false; |
|
|
|
|
} |
|
|
|
@ -728,7 +733,7 @@ export default { |
|
|
|
|
// if(index+1 == this.tableData.length){ |
|
|
|
|
// index = index-1 |
|
|
|
|
// } |
|
|
|
|
this.tableData.splice(index,1); |
|
|
|
|
this.tableData.splice(index,2); |
|
|
|
|
index ? this.tableData.splice(index - 1, 1) : this.tableData.splice(0, 1); |
|
|
|
|
this.itemkey = Math.random() |
|
|
|
|
this.tableData.forEach(async (item, index) => { |
|
|
|
|