|
|
@ -451,53 +451,13 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
let tableData = this.tableData |
|
|
|
|
|
|
|
this.tableData = [] |
|
|
|
|
|
|
|
this.anewPosttingDatas(list) |
|
|
|
this.anewPosttingDatas(list) |
|
|
|
for (var j=0;j<tableData.length;j++){ |
|
|
|
|
|
|
|
for(var i=0;i<this.tableData.length;i++){ |
|
|
|
|
|
|
|
if (tableData[j].name == this.tableData[i].name){ |
|
|
|
|
|
|
|
this.tableData[i].type = tableData[j].type |
|
|
|
|
|
|
|
if (tableData[j].type == 1 || tableData[j].type == 2) { |
|
|
|
|
|
|
|
this.tableData[i].subjectId = Number(tableData[j].emptyOne); |
|
|
|
|
|
|
|
this.tableData[i].value1 = tableData[j].emptyTwo; |
|
|
|
|
|
|
|
} else if (tableData[j].type == 3) { |
|
|
|
|
|
|
|
this.tableData[i].subjectId = Number(tableData[j].emptyOne); |
|
|
|
|
|
|
|
this.tableData[i].value1 = tableData[j].emptyTwo; |
|
|
|
|
|
|
|
} else if (tableData[j].type == 4) { |
|
|
|
|
|
|
|
// 需要提目id |
|
|
|
|
|
|
|
if (tableData[j].emptyOne === "无限制") { |
|
|
|
|
|
|
|
this.tableData[i].value1 = tableData[j].emptyOne; |
|
|
|
|
|
|
|
this.tableData[i].value2 = ""; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.tableData[i].value1 = tableData[j].emptyOne.substring(0, tableData[j].emptyOne.indexOf(",")); |
|
|
|
|
|
|
|
this.tableData[i].value2 = tableData[j].emptyOne.substring(tableData[j].emptyOne.indexOf(",") + 1, tableData[j].emptyOne.length); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.tableData[i].value3 = tableData[j].emptyTwo; |
|
|
|
|
|
|
|
} else if (tableData[j].type == 5) { |
|
|
|
|
|
|
|
this.tableData[i].subjectId = Number(tableData[j].emptyOne); |
|
|
|
|
|
|
|
this.tableData[i].value2 = tableData[j].emptyTwo[0]; |
|
|
|
|
|
|
|
this.tableData[i].value3 = tableData[j].emptyTwo.substring(1, tableData[j].emptyTwo.indexOf("~")); |
|
|
|
|
|
|
|
this.tableData[i].value4 = tableData[j].emptyTwo.substring(tableData[j].emptyTwo.indexOf("~") + 1, tableData[j].emptyTwo.length - 1); |
|
|
|
|
|
|
|
this.tableData[i].value5 = tableData[j].emptyTwo[tableData[j].emptyTwo.length - 1]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.tableData[i].isDisabled=true// 已禁用 |
|
|
|
|
|
|
|
this.tableData[i].isSave=true // 已保存 |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(tableData[j].operationIds == this.tableData[i].operationIds){ |
|
|
|
|
|
|
|
this.tableData[i].isDisabled=true// 已禁用 |
|
|
|
|
|
|
|
this.tableData[i].isSave=true // 已保存 |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.tableData.forEach(async (item, index) => { |
|
|
|
this.tableData.forEach(async (item, index) => { |
|
|
|
// 勾选树节点 |
|
|
|
// 勾选树节点 |
|
|
|
item.operationIds = item.id |
|
|
|
// item.operationIds = item.id |
|
|
|
if (item.id) { |
|
|
|
if (item.operationIds) { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs[`tree-${index}`].setCheckedKeys([item.id]); |
|
|
|
this.$refs[`tree-${index}`].setCheckedKeys([item.operationIds]); |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
@ -506,6 +466,11 @@ export default { |
|
|
|
anewPosttingDatas(judgmentRuleList){ |
|
|
|
anewPosttingDatas(judgmentRuleList){ |
|
|
|
let length = judgmentRuleList.length; |
|
|
|
let length = judgmentRuleList.length; |
|
|
|
let tempArr = []; |
|
|
|
let tempArr = []; |
|
|
|
|
|
|
|
if(this.tableData.length > 0){ |
|
|
|
|
|
|
|
tempArr.push({ruleOperation: 0}); |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
tempArr = [] |
|
|
|
|
|
|
|
} |
|
|
|
judgmentRuleList.forEach((item, index) => { |
|
|
|
judgmentRuleList.forEach((item, index) => { |
|
|
|
let obj = { |
|
|
|
let obj = { |
|
|
|
...item, |
|
|
|
...item, |
|
|
@ -513,9 +478,11 @@ export default { |
|
|
|
isDisabled: false, // 已禁用 |
|
|
|
isDisabled: false, // 已禁用 |
|
|
|
isSave: false // 已保存 |
|
|
|
isSave: false // 已保存 |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
obj.operationIds = item.id |
|
|
|
if(item.type == undefined || item.type == ''){ |
|
|
|
if(item.type == undefined || item.type == ''){ |
|
|
|
item.operationIds = item.id |
|
|
|
obj.type = null |
|
|
|
item.type = null |
|
|
|
}else{ |
|
|
|
|
|
|
|
obj.type = item.type |
|
|
|
} |
|
|
|
} |
|
|
|
//题目类型(1选择 2判断 3填空 4问答 5指标结果) |
|
|
|
//题目类型(1选择 2判断 3填空 4问答 5指标结果) |
|
|
|
if (item.type == 1 || item.type == 2) { |
|
|
|
if (item.type == 1 || item.type == 2) { |
|
|
@ -549,8 +516,10 @@ export default { |
|
|
|
tempArr.push({ruleOperation: 0}); |
|
|
|
tempArr.push({ruleOperation: 0}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.tableData = tempArr; |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
for(var i=0;i<tempArr.length;i++){ |
|
|
|
|
|
|
|
this.tableData.push(tempArr[i]); |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 重新封装数据 |
|
|
|
// 重新封装数据 |
|
|
|
anewPosttingData(judgmentRuleList){ |
|
|
|
anewPosttingData(judgmentRuleList){ |
|
|
@ -612,7 +581,7 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleCheckChange(data, checked, indeterminate, row, index) { // 处理勾选 |
|
|
|
handleCheckChange(data, checked, indeterminate, row, index) { // 处理勾选 |
|
|
|
if (checked && data.isNode === 1) { |
|
|
|
if (checked && data.isNode === 1) { |
|
|
|
this.tableData[index].operationIds = data.id; // 操作id串 |
|
|
|
// this.tableData[index].operationIds = data.id; // 操作id串 |
|
|
|
// row.value1 = ""; |
|
|
|
// row.value1 = ""; |
|
|
|
// row.value2 = ""; |
|
|
|
// row.value2 = ""; |
|
|
|
// row.value3 = ""; |
|
|
|
// row.value3 = ""; |
|
|
@ -784,16 +753,7 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
addRules(){ |
|
|
|
addRules(){ |
|
|
|
this.configVisible = true; |
|
|
|
this.configVisible = true; |
|
|
|
let operationIds = [] |
|
|
|
this.$refs.tree.setCheckedKeys([]); |
|
|
|
this.tableData.forEach(async (item, index) => { |
|
|
|
|
|
|
|
// 勾选树节点 |
|
|
|
|
|
|
|
if (item.operationIds) { |
|
|
|
|
|
|
|
operationIds.push(item.operationIds) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
|
|
this.$refs.tree.setCheckedKeys(operationIds); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
addRule() { // 新增规则 |
|
|
|
addRule() { // 新增规则 |
|
|
|
this.changeArr.splice(0, this.changeArr.length) |
|
|
|
this.changeArr.splice(0, this.changeArr.length) |
|
|
|