@@ -356,7 +358,8 @@ export default {
}, // 表单参数
tableData: [], // 规则表格数据
tableDataCopy: [], // 规则表格数据备份
- isAddRule: false // 是否禁用新增规则按钮
+ isAddRule: false, // 是否禁用新增规则按钮
+ itemkey:'',
};
},
mounted() {
@@ -483,6 +486,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)
}
} else {
this.$message.warning(res.message);
@@ -709,22 +713,30 @@ export default {
}
},
handleDelete(row, index) { // 处理删除规则
-
this.$confirm("此操作将永久删除该规则, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
center: true
}).then(() => {
- console.log(this.tableData)
- console.log(index)
- console.log(this.tableData[0])
- console.log(this.tableData.splice(index,2))
+ if(index+1 == this.tableData.length){
+ index = index-1
+ }
this.tableData.splice(index,2);
- console.log(this.tableData)
- // console.log()
- // index ? this.tableData.splice(index - 1, 1) : this.tableData.splice(0, 1);
- // this.isAddRule = false;
+ this.itemkey = Math.random()
+ 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);
+ }
+ });
+ this.isAddRule = false;
}).catch(() => {
});
},