|
|
@ -50,8 +50,8 @@ |
|
|
|
<div>判分规则</div> |
|
|
|
<div>判分规则</div> |
|
|
|
</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="addRules">新增</el-button> |
|
|
|
<el-button v-if="!isView" type="primary" size="mini" @click="addRule">新增</el-button> |
|
|
|
<!-- <el-button v-if="!isView" type="primary" size="mini" @click="addRule">新增</el-button>--> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-dialog :visible.sync="configVisible" width="30%" title="批量新增判分点" center :append-to-body='true'> |
|
|
|
<el-dialog :visible.sync="configVisible" width="30%" title="批量新增判分点" center :append-to-body='true'> |
|
|
@ -62,7 +62,9 @@ |
|
|
|
:data="treeData" |
|
|
|
:data="treeData" |
|
|
|
@check="currentChecked" |
|
|
|
@check="currentChecked" |
|
|
|
header-align="center" |
|
|
|
header-align="center" |
|
|
|
show-checkbox node-key="id" |
|
|
|
show-checkbox |
|
|
|
|
|
|
|
ref="tree" |
|
|
|
|
|
|
|
node-key="id" |
|
|
|
:props="defaultProps"> |
|
|
|
:props="defaultProps"> |
|
|
|
</el-tree> |
|
|
|
</el-tree> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -78,9 +80,7 @@ |
|
|
|
:data="tableData" |
|
|
|
:data="tableData" |
|
|
|
:stripe="true" |
|
|
|
:stripe="true" |
|
|
|
:key="itemkey" |
|
|
|
:key="itemkey" |
|
|
|
:cell-style="rowClass" |
|
|
|
|
|
|
|
header-align="center" |
|
|
|
header-align="center" |
|
|
|
:header-cell-style="headClass" |
|
|
|
|
|
|
|
> |
|
|
|
> |
|
|
|
<el-table-column prop="indexNo" type="index" label="序号" width="80"> |
|
|
|
<el-table-column prop="indexNo" type="index" label="序号" width="80"> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
@ -129,7 +129,7 @@ |
|
|
|
<p class="p" style="margin-top: 1px">交易结果一致性规则:用户交易结果需要与下面设置的交易结果指标要求一致</p> |
|
|
|
<p class="p" style="margin-top: 1px">交易结果一致性规则:用户交易结果需要与下面设置的交易结果指标要求一致</p> |
|
|
|
<div class="block"> |
|
|
|
<div class="block"> |
|
|
|
<!-- type: 题目类型(1选择 2判断 3填空 4问答 5指标结果) --> |
|
|
|
<!-- type: 题目类型(1选择 2判断 3填空 4问答 5指标结果) --> |
|
|
|
<div v-if="scope.row.operationIds && scope.row.type == null" style="line-height: 65px">需点击</div> |
|
|
|
<div v-if="scope.row.operationIds && scope.row.type == null" style="line-height: 65px;text-align: center">需点击</div> |
|
|
|
<template v-if="scope.row.type == 1"> |
|
|
|
<template v-if="scope.row.type == 1"> |
|
|
|
<div class="box"> |
|
|
|
<div class="box"> |
|
|
|
<div class="line"> |
|
|
|
<div class="line"> |
|
|
@ -396,9 +396,7 @@ export default { |
|
|
|
token: atob(decodeURI(this.$route.query.token)) |
|
|
|
token: atob(decodeURI(this.$route.query.token)) |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.checkChange.push(false) |
|
|
|
this.checkChange.push(false) |
|
|
|
console.log('remounted') |
|
|
|
|
|
|
|
this.getTreeData(); |
|
|
|
this.getTreeData(); |
|
|
|
console.log(this.treeData) |
|
|
|
|
|
|
|
if (this.$route.query.systemId) { |
|
|
|
if (this.$route.query.systemId) { |
|
|
|
this.formData.lcJudgmentPoint.systemId = this.$route.query.systemId; |
|
|
|
this.formData.lcJudgmentPoint.systemId = this.$route.query.systemId; |
|
|
|
} |
|
|
|
} |
|
|
@ -418,16 +416,6 @@ export default { |
|
|
|
if (item.operationIds) { |
|
|
|
if (item.operationIds) { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs[`tree-${index}`].setCheckedKeys([item.operationIds]); |
|
|
|
this.$refs[`tree-${index}`].setCheckedKeys([item.operationIds]); |
|
|
|
// let currentNode = this.$refs[`tree-${index}`].getNode([item]); |
|
|
|
|
|
|
|
// while ( parentLevel>0)//包含一级节点,因为一级节点有多个,如果是一级节点有一个,那这个判断就是while ( 1!=parentLevel) |
|
|
|
|
|
|
|
// let dom = document.querySelector("#divTree") |
|
|
|
|
|
|
|
// let dom1 = document.querySelector("#depTree") |
|
|
|
|
|
|
|
// //一个节点的高度是26px,这个值能否从对象中获取,等我把这个功能做好再考虑吧 |
|
|
|
|
|
|
|
// let nodeHight =26 |
|
|
|
|
|
|
|
// dom1.style.height = (nodeCount * nodeHight) + "px" |
|
|
|
|
|
|
|
// let contHeight=(nodeIndex * nodeHight)+topHeight-300//总高度,盒子高度的一半 |
|
|
|
|
|
|
|
// dom.scrollTo(0, contHeight) |
|
|
|
|
|
|
|
// this.scrollToDepTree(item.operationIds) |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
// 根据题目id,获取题目信息 |
|
|
|
// 根据题目id,获取题目信息 |
|
|
@ -448,18 +436,17 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
currentChecked (nodeObj, SelectedObj) { |
|
|
|
currentChecked (nodeObj, SelectedObj) { |
|
|
|
this.SelectedObj = SelectedObj |
|
|
|
this.SelectedObj = SelectedObj |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
handleConfirm(){ |
|
|
|
handleConfirm(){ |
|
|
|
let list = [] |
|
|
|
let list = [] |
|
|
|
if (this.formData.lcJudgmentRuleList.length){ |
|
|
|
// if (this.formData.lcJudgmentRuleList.length){ |
|
|
|
for (var j = 0;j<this.formData.lcJudgmentRuleList.length;j++){ |
|
|
|
// for (var j = 0;j<this.formData.lcJudgmentRuleList.length;j++){ |
|
|
|
list.push(this.formData.lcJudgmentRuleList[j]); |
|
|
|
// list.push(this.formData.lcJudgmentRuleList[j]); |
|
|
|
} |
|
|
|
// } |
|
|
|
for (var i=0;i<list.length;i++){ |
|
|
|
// for (var i=0;i<list.length;i++){ |
|
|
|
list[i].id = list[i].operationIds |
|
|
|
// list[i].id = list[i].operationIds |
|
|
|
} |
|
|
|
// } |
|
|
|
} |
|
|
|
// } |
|
|
|
if (this.SelectedObj.checkedNodes.length > 0){ |
|
|
|
if (this.SelectedObj.checkedNodes.length > 0){ |
|
|
|
for (var i=0;i<this.SelectedObj.checkedNodes.length;i++){ |
|
|
|
for (var i=0;i<this.SelectedObj.checkedNodes.length;i++){ |
|
|
|
if(this.SelectedObj.checkedNodes[i].children.length > 0){ |
|
|
|
if(this.SelectedObj.checkedNodes[i].children.length > 0){ |
|
|
@ -476,7 +463,7 @@ export default { |
|
|
|
this.anewPosttingDatas(list) |
|
|
|
this.anewPosttingDatas(list) |
|
|
|
this.tableData.forEach(async (item, index) => { |
|
|
|
this.tableData.forEach(async (item, index) => { |
|
|
|
// 勾选树节点 |
|
|
|
// 勾选树节点 |
|
|
|
// console.log(item) |
|
|
|
item.operationIds = item.id |
|
|
|
if (item.id) { |
|
|
|
if (item.id) { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs[`tree-${index}`].setCheckedKeys([item.id]); |
|
|
|
this.$refs[`tree-${index}`].setCheckedKeys([item.id]); |
|
|
@ -492,9 +479,13 @@ export default { |
|
|
|
let obj = { |
|
|
|
let obj = { |
|
|
|
...item, |
|
|
|
...item, |
|
|
|
isSubject: true, |
|
|
|
isSubject: true, |
|
|
|
isDisabled: true, // 已禁用 |
|
|
|
isDisabled: false, // 已禁用 |
|
|
|
isSave: true // 已保存 |
|
|
|
isSave: false // 已保存 |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
if(item.type == undefined || item.type == ''){ |
|
|
|
|
|
|
|
item.operationIds = item.id |
|
|
|
|
|
|
|
item.type = null |
|
|
|
|
|
|
|
} |
|
|
|
//题目类型(1选择 2判断 3填空 4问答 5指标结果) |
|
|
|
//题目类型(1选择 2判断 3填空 4问答 5指标结果) |
|
|
|
if (item.type == 1 || item.type == 2) { |
|
|
|
if (item.type == 1 || item.type == 2) { |
|
|
|
obj.subjectId = Number(item.emptyOne); |
|
|
|
obj.subjectId = Number(item.emptyOne); |
|
|
@ -587,18 +578,6 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleCheckChange(data, checked, indeterminate, row, index) { // 处理勾选 |
|
|
|
handleCheckChange(data, checked, indeterminate, row, index) { // 处理勾选 |
|
|
|
// this.changeArr.push(checked) |
|
|
|
|
|
|
|
// if(this.changeArr.length === 4) { |
|
|
|
|
|
|
|
// this.checkChange.splice(index, 1, this.changeArr[2]) |
|
|
|
|
|
|
|
// this.changeArr.splice(0, this.changeArr.length) |
|
|
|
|
|
|
|
// }else if(this.changeArr.length === 2) { |
|
|
|
|
|
|
|
// this.checkChange.splice(index, 1, true) |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
if (checked){ |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
row.operationIds = null |
|
|
|
|
|
|
|
row.type = null |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
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 = ""; |
|
|
@ -606,14 +585,12 @@ export default { |
|
|
|
row.value3 = ""; |
|
|
|
row.value3 = ""; |
|
|
|
row.value4 = ""; |
|
|
|
row.value4 = ""; |
|
|
|
row.value5 = ""; |
|
|
|
row.value5 = ""; |
|
|
|
// console.log(data) |
|
|
|
|
|
|
|
if (data.subjectId) { // 是否有题目id |
|
|
|
if (data.subjectId) { // 是否有题目id |
|
|
|
this.currentNodeData = data; |
|
|
|
this.currentNodeData = data; |
|
|
|
this.$refs[`tree-${index}`].setCheckedNodes([data]); |
|
|
|
this.$refs[`tree-${index}`].setCheckedNodes([data]); |
|
|
|
this.getSubjectData(data.subjectId, index); |
|
|
|
this.getSubjectData(data.subjectId, index); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
row.type = null; |
|
|
|
row.type = null; |
|
|
|
// console.log(row.type) |
|
|
|
|
|
|
|
this.currentNodeData = {}; |
|
|
|
this.currentNodeData = {}; |
|
|
|
this.$refs[`tree-${index}`].setCheckedNodes([data]); |
|
|
|
this.$refs[`tree-${index}`].setCheckedNodes([data]); |
|
|
|
} |
|
|
|
} |
|
|
@ -649,7 +626,6 @@ export default { |
|
|
|
let result = []; |
|
|
|
let result = []; |
|
|
|
data.forEach(item => { |
|
|
|
data.forEach(item => { |
|
|
|
if (item.isNode === 0) { |
|
|
|
if (item.isNode === 0) { |
|
|
|
// item.disabled = true; |
|
|
|
|
|
|
|
item.showCheckbox = false; |
|
|
|
item.showCheckbox = false; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
item.showCheckbox = true; |
|
|
|
item.showCheckbox = true; |
|
|
@ -774,14 +750,25 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
addRules(){ |
|
|
|
addRules(){ |
|
|
|
this.configVisible = true |
|
|
|
this.configVisible = true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log(this.formData.lcJudgmentRuleList) |
|
|
|
|
|
|
|
let operationIds = [] |
|
|
|
|
|
|
|
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) |
|
|
|
this.checkChange.push(false) |
|
|
|
this.checkChange.push(false) |
|
|
|
if(!this.isAddRule) { |
|
|
|
if(!this.isAddRule) { |
|
|
|
this.isAddRule = true; |
|
|
|
this.isAddRule = true; |
|
|
|
// this.tableData.length && this.tableData.push({ruleOperation: 0, indexNo: ""}); |
|
|
|
|
|
|
|
if (this.tableData.length > 0){ |
|
|
|
if (this.tableData.length > 0){ |
|
|
|
this.tableData.push({ |
|
|
|
this.tableData.push({ |
|
|
|
ruleOperation: 0 |
|
|
|
ruleOperation: 0 |
|
|
@ -820,7 +807,6 @@ export default { |
|
|
|
}else { |
|
|
|
}else { |
|
|
|
this.$message('请保存当前判分规则再新增!'); |
|
|
|
this.$message('请保存当前判分规则再新增!'); |
|
|
|
} |
|
|
|
} |
|
|
|
// anewPosttingData(judgmentRuleList) |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
changeResult(row) { // (左右)结果运算符(0:且 1:或 默认0) |
|
|
|
changeResult(row) { // (左右)结果运算符(0:且 1:或 默认0) |
|
|
|
row.resultOperation = row.resultOperation === 0 ? 1 : 0; |
|
|
|
row.resultOperation = row.resultOperation === 0 ? 1 : 0; |
|
|
@ -837,6 +823,9 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleSave(row, index) { // 处理保存规则 |
|
|
|
handleSave(row, index) { // 处理保存规则 |
|
|
|
let keys = this.$refs[`tree-${index}`].getCheckedKeys(); |
|
|
|
let keys = this.$refs[`tree-${index}`].getCheckedKeys(); |
|
|
|
|
|
|
|
if(!row.operationIds){ |
|
|
|
|
|
|
|
row.operationIds = keys[0] |
|
|
|
|
|
|
|
} |
|
|
|
if (!keys.length || !row.operationIds) { |
|
|
|
if (!keys.length || !row.operationIds) { |
|
|
|
this.$message.warning(`请选择操作点`); |
|
|
|
this.$message.warning(`请选择操作点`); |
|
|
|
return; |
|
|
|
return; |
|
|
@ -889,8 +878,11 @@ export default { |
|
|
|
this.$refs[`tree-${index}`].setCheckedKeys([this.tableData[index].operationIds]); |
|
|
|
this.$refs[`tree-${index}`].setCheckedKeys([this.tableData[index].operationIds]); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.tableData.splice(index-1, 2); |
|
|
|
if (index+1 == this.tableData.length){ |
|
|
|
// index ? this.tableData.splice(index - 1, 1) : this.tableData.splice(0, 1); |
|
|
|
this.tableData.splice(index - 1, 2) |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
this.tableData.splice(index,2); |
|
|
|
|
|
|
|
} |
|
|
|
this.isAddRule = false; |
|
|
|
this.isAddRule = false; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
@ -901,11 +893,11 @@ export default { |
|
|
|
type: "warning", |
|
|
|
type: "warning", |
|
|
|
center: true |
|
|
|
center: true |
|
|
|
}).then(() => { |
|
|
|
}).then(() => { |
|
|
|
// if(index+1 == this.tableData.length){ |
|
|
|
if (index+1 == this.tableData.length){ |
|
|
|
// index = index-1 |
|
|
|
this.tableData.splice(index - 1, 2) |
|
|
|
// } |
|
|
|
}else{ |
|
|
|
this.tableData.splice(index,2); |
|
|
|
this.tableData.splice(index,2); |
|
|
|
index ? this.tableData.splice(index - 1, 1) : this.tableData.splice(0, 1); |
|
|
|
} |
|
|
|
this.itemkey = Math.random() |
|
|
|
this.itemkey = Math.random() |
|
|
|
this.tableData.forEach(async (item, index) => { |
|
|
|
this.tableData.forEach(async (item, index) => { |
|
|
|
// 勾选树节点 |
|
|
|
// 勾选树节点 |
|
|
@ -972,7 +964,10 @@ export default { |
|
|
|
margin-left: 20px; |
|
|
|
margin-left: 20px; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.cell div{ |
|
|
|
|
|
|
|
margin: auto; |
|
|
|
|
|
|
|
text-align: center; |
|
|
|
|
|
|
|
} |
|
|
|
// 表单容器 |
|
|
|
// 表单容器 |
|
|
|
.form-con { |
|
|
|
.form-con { |
|
|
|
padding-bottom: 24px; |
|
|
|
padding-bottom: 24px; |
|
|
|