|
|
|
@ -50,10 +50,28 @@ |
|
|
|
|
<div>判分规则</div> |
|
|
|
|
</div> |
|
|
|
|
<div> |
|
|
|
|
<el-button v-if="!isView" type="primary" size="mini" @click="addRules">批量新增</el-button> |
|
|
|
|
<el-button v-if="!isView" type="primary" size="mini" @click="addRule">新增</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<el-dialog :visible.sync="configVisible" width="30%" title="批量新增判分点" center> |
|
|
|
|
<div class="flex-between mgb20"> |
|
|
|
|
<div style="width: 100%;height: 400px;overflow: auto;margin: auto;background: #F5F5F5"> |
|
|
|
|
<el-tree |
|
|
|
|
style="background: #F5F5F5" |
|
|
|
|
:data="treeData" |
|
|
|
|
@check="currentChecked" |
|
|
|
|
header-align="center" |
|
|
|
|
show-checkbox node-key="id" |
|
|
|
|
:props="defaultProps"> |
|
|
|
|
</el-tree> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
<el-button @click="configVisible = false">取 消</el-button> |
|
|
|
|
<el-button type="primary" @click="handleConfirm">确 定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
<el-card shadow="hover"> |
|
|
|
|
<el-table |
|
|
|
|
:data="tableData" |
|
|
|
@ -368,6 +386,8 @@ export default { |
|
|
|
|
isAddRule: false, // 是否禁用新增规则按钮 |
|
|
|
|
itemkey:'', |
|
|
|
|
judgePoints:false,//判断是否点了编辑 |
|
|
|
|
configVisible:false, |
|
|
|
|
SelectedObj:[] |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
@ -424,6 +444,90 @@ export default { |
|
|
|
|
//计算此节点的距离思路1.计算出当前节点据顶部的高度+当前节点在树的位置的高度-盒子高度的一半 |
|
|
|
|
scrollToDepTree(deptCode){ |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
currentChecked (nodeObj, SelectedObj) { |
|
|
|
|
this.SelectedObj = SelectedObj |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
handleConfirm(){ |
|
|
|
|
let list = [] |
|
|
|
|
if (this.formData.lcJudgmentRuleList.length){ |
|
|
|
|
for (var j = 0;j<this.formData.lcJudgmentRuleList.length;j++){ |
|
|
|
|
list.push(this.formData.lcJudgmentRuleList[j]); |
|
|
|
|
} |
|
|
|
|
for (var i=0;i<list.length;i++){ |
|
|
|
|
list[i].id = list[i].operationIds |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (this.SelectedObj.checkedNodes.length > 0){ |
|
|
|
|
for (var i=0;i<this.SelectedObj.checkedNodes.length;i++){ |
|
|
|
|
if(this.SelectedObj.checkedNodes[i].children.length > 0){ |
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
this.SelectedObj.checkedNodes[i].resultOperation = 0 |
|
|
|
|
if (this.SelectedObj.checkedNodes[i].id) { |
|
|
|
|
list.push(this.SelectedObj.checkedNodes[i]) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.tableData = [] |
|
|
|
|
this.anewPosttingDatas(list) |
|
|
|
|
this.tableData.forEach(async (item, index) => { |
|
|
|
|
// 勾选树节点 |
|
|
|
|
// console.log(item) |
|
|
|
|
if (item.id) { |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.$refs[`tree-${index}`].setCheckedKeys([item.id]); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.configVisible = false |
|
|
|
|
}, |
|
|
|
|
anewPosttingDatas(judgmentRuleList){ |
|
|
|
|
let length = judgmentRuleList.length; |
|
|
|
|
let tempArr = []; |
|
|
|
|
judgmentRuleList.forEach((item, index) => { |
|
|
|
|
let obj = { |
|
|
|
|
...item, |
|
|
|
|
isSubject: true, |
|
|
|
|
isDisabled: true, // 已禁用 |
|
|
|
|
isSave: true // 已保存 |
|
|
|
|
}; |
|
|
|
|
//题目类型(1选择 2判断 3填空 4问答 5指标结果) |
|
|
|
|
if (item.type == 1 || item.type == 2) { |
|
|
|
|
obj.subjectId = Number(item.emptyOne); |
|
|
|
|
obj.value1 = item.itemId; |
|
|
|
|
} else if (item.type == 3) { |
|
|
|
|
obj.subjectId = Number(item.emptyOne); |
|
|
|
|
obj.value1 = item.emptyTwo; |
|
|
|
|
} else if (item.type == 4) { |
|
|
|
|
// 需要提目id |
|
|
|
|
if (item.emptyOne === "无限制") { |
|
|
|
|
obj.value1 = item.emptyOne; |
|
|
|
|
obj.value2 = ""; |
|
|
|
|
} else { |
|
|
|
|
obj.value1 = item.emptyOne.substring(0, item.emptyOne.indexOf(",")); |
|
|
|
|
obj.value2 = item.emptyOne.substring(item.emptyOne.indexOf(",") + 1, item.emptyOne.length); |
|
|
|
|
} |
|
|
|
|
obj.value3 = item.emptyTwo; |
|
|
|
|
} else if (item.type == 5) { |
|
|
|
|
obj.subjectId = Number(item.emptyOne); |
|
|
|
|
obj.value2 = item.emptyTwo[0]; |
|
|
|
|
obj.value3 = item.emptyTwo.substring(1, item.emptyTwo.indexOf("~")); |
|
|
|
|
obj.value4 = item.emptyTwo.substring(item.emptyTwo.indexOf("~") + 1, item.emptyTwo.length - 1); |
|
|
|
|
obj.value5 = item.emptyTwo[item.emptyTwo.length - 1]; |
|
|
|
|
} |
|
|
|
|
tempArr.push(obj); |
|
|
|
|
if (length > 1 && index !== (length - 1)) { |
|
|
|
|
if(item.ruleOperation){ |
|
|
|
|
tempArr.push({ruleOperation: item.ruleOperation}); |
|
|
|
|
}else{ |
|
|
|
|
tempArr.push({ruleOperation: 0}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.tableData = tempArr; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 重新封装数据 |
|
|
|
|
anewPosttingData(judgmentRuleList){ |
|
|
|
@ -544,7 +648,7 @@ export default { |
|
|
|
|
let result = []; |
|
|
|
|
data.forEach(item => { |
|
|
|
|
if (item.isNode === 0) { |
|
|
|
|
item.disabled = true; |
|
|
|
|
// item.disabled = true; |
|
|
|
|
item.showCheckbox = false; |
|
|
|
|
} else { |
|
|
|
|
item.showCheckbox = true; |
|
|
|
@ -668,6 +772,9 @@ export default { |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
addRules(){ |
|
|
|
|
this.configVisible = true |
|
|
|
|
}, |
|
|
|
|
addRule() { // 新增规则 |
|
|
|
|
this.changeArr.splice(0, this.changeArr.length) |
|
|
|
|
this.checkChange.push(false) |
|
|
|
|