|
|
|
@ -62,12 +62,12 @@ |
|
|
|
|
header-align="center" |
|
|
|
|
:header-cell-style="headClass" |
|
|
|
|
> |
|
|
|
|
<el-table-column prop="id" type="index" label="序号" width="80"></el-table-column> |
|
|
|
|
<el-table-column prop="indexNo" label="序号" width="80"></el-table-column> |
|
|
|
|
<el-table-column label="流程判分正确答案"> |
|
|
|
|
<template slot-scope="scope" v-if="scope.row.isSubject"> |
|
|
|
|
<p class="p">操作一致性规则:用户完成的功能操作与下方设置的操作点一致</p> |
|
|
|
|
<div class="tree-con"> |
|
|
|
|
<div class="block"> |
|
|
|
|
<div class="block1"> |
|
|
|
|
<my-tree |
|
|
|
|
class="action" |
|
|
|
|
:ref="'tree-'+scope.$index" |
|
|
|
@ -95,10 +95,10 @@ |
|
|
|
|
@click="changeResult(scope.row)" |
|
|
|
|
style="position: absolute; right: 55px" |
|
|
|
|
> |
|
|
|
|
{{ scope.row.resultOperation === 0 ? '且' : '或' }} |
|
|
|
|
{{ scope.row.resultOperation === 0 ? "且" : "或" }} |
|
|
|
|
</el-button> |
|
|
|
|
<el-button v-else type="primary" circle @click="changeRule(scope.row, scope.$index)"> |
|
|
|
|
{{ scope.row.ruleOperation === 0 ? '且' : '或' }} |
|
|
|
|
{{ scope.row.ruleOperation === 0 ? "且" : "或" }} |
|
|
|
|
</el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
@ -206,6 +206,8 @@ |
|
|
|
|
class="number-input" |
|
|
|
|
v-model.trim="scope.row.value2" |
|
|
|
|
:disabled="isView || scope.row.isDisabled" |
|
|
|
|
onkeyup="value=this.value.replace(/\D+/g,'')" |
|
|
|
|
oninput="value=value.replace(/[^0-9.]/g,'')" |
|
|
|
|
type="number" |
|
|
|
|
min="1" |
|
|
|
|
size="mini" |
|
|
|
@ -300,10 +302,17 @@ |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="操作" width="300" v-if="!isView"> |
|
|
|
|
<template slot-scope="scope" v-if="scope.row.isSubject"> |
|
|
|
|
<el-button v-show="scope.row.isDisabled" size="mini" type="text" @click="handleEdit(scope.row)">编辑</el-button> |
|
|
|
|
<el-button v-show="!scope.row.isDisabled" size="mini" type="text" @click="handleSave(scope.row, scope.$index)">保存</el-button> |
|
|
|
|
<el-button v-show="!scope.row.isDisabled" size="mini" type="text" @click="handleCancel(scope.row, scope.$index)">取消</el-button> |
|
|
|
|
<el-button v-show="scope.row.isDisabled" size="mini" type="text" @click="handleDelete(scope.row, scope.$index)">删除</el-button> |
|
|
|
|
<el-button v-show="scope.row.isDisabled" size="mini" type="text" @click="handleEdit(scope.row)">编辑 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button v-show="!scope.row.isDisabled" size="mini" type="text" |
|
|
|
|
@click="handleSave(scope.row, scope.$index)">保存 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button v-show="!scope.row.isDisabled" size="mini" type="text" |
|
|
|
|
@click="handleCancel(scope.row, scope.$index)">取消 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button v-show="scope.row.isDisabled" size="mini" type="text" |
|
|
|
|
@click="handleDelete(scope.row, scope.$index)">删除 |
|
|
|
|
</el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
@ -314,9 +323,10 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import quill from '@/components/quill' |
|
|
|
|
import MyTree from '@/components/myTree/src/tree' |
|
|
|
|
import {deepCopy} from '@/utils/deepCopy' |
|
|
|
|
import quill from "@/components/quill"; |
|
|
|
|
import MyTree from "@/components/myTree/src/tree"; |
|
|
|
|
import {deepCopy} from "@/utils/deepCopy"; |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
components: {quill, MyTree}, |
|
|
|
|
data() { |
|
|
|
@ -328,8 +338,8 @@ export default { |
|
|
|
|
isNameRepeat: false, // 名称是否重复 |
|
|
|
|
treeData: [], // 树结构数据 |
|
|
|
|
defaultProps: { |
|
|
|
|
children: 'children', |
|
|
|
|
label: 'name' |
|
|
|
|
children: "children", |
|
|
|
|
label: "name" |
|
|
|
|
}, // 树结构配置项 |
|
|
|
|
currentNodeData: {}, // 当前选中的节点 |
|
|
|
|
formData: { |
|
|
|
@ -345,11 +355,11 @@ export default { |
|
|
|
|
}, // 表单参数 |
|
|
|
|
tableData: [], // 规则表格数据 |
|
|
|
|
tableDataCopy: [], // 规则表格数据备份 |
|
|
|
|
isAddRule: false, // 是否禁用新增规则按钮 |
|
|
|
|
isAddRule: false // 是否禁用新增规则按钮 |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
this.$route.query.token && this.$store.commit('setParam', { |
|
|
|
|
this.$route.query.token && this.$store.commit("setParam", { |
|
|
|
|
token: atob(decodeURI(this.$route.query.token)) |
|
|
|
|
}); |
|
|
|
|
this.getTreeData(); |
|
|
|
@ -369,7 +379,7 @@ export default { |
|
|
|
|
this.formData = { |
|
|
|
|
lcJudgmentPoint: judgmentPoint, |
|
|
|
|
lcJudgmentRuleList: judgmentRuleList |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// 重新封装数据 |
|
|
|
|
let length = judgmentRuleList.length; |
|
|
|
@ -390,24 +400,24 @@ export default { |
|
|
|
|
obj.value1 = item.emptyTwo; |
|
|
|
|
} else if (item.type == 4) { |
|
|
|
|
// 需要提目id |
|
|
|
|
if (item.emptyOne === '无限制') { |
|
|
|
|
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.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.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)) { |
|
|
|
|
tempArr.push({ruleOperation: item.ruleOperation}) |
|
|
|
|
tempArr.push({ruleOperation: item.ruleOperation}); |
|
|
|
|
} |
|
|
|
|
this.tableData = tempArr; |
|
|
|
|
}); |
|
|
|
@ -426,10 +436,10 @@ export default { |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
this.$message.warning(res.message) |
|
|
|
|
this.$message.warning(res.message); |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
|
console.log(err) |
|
|
|
|
console.log(err); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
getSubjectData(subjectId, index) { // 获取题目信息 |
|
|
|
@ -439,12 +449,12 @@ export default { |
|
|
|
|
...this.tableData[index], |
|
|
|
|
...res.subject, |
|
|
|
|
items: res.items |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
this.$set(this.tableData, index, item); |
|
|
|
|
// console.log(JSON.stringify(this.tableData)) |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
|
console.log(err) |
|
|
|
|
console.log(err); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
handleCheckChange(data, checked, indeterminate, row, index) { // 处理勾选 |
|
|
|
@ -477,7 +487,7 @@ export default { |
|
|
|
|
this.$message.warning(res.message); |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
|
console.log(err) |
|
|
|
|
console.log(err); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
toTreeId(data, parentId) { // id重新串连成(父+子+孙),已便达到树节点需要的key唯一性,且后面提交数据,需要传这个id串到后台 |
|
|
|
@ -507,7 +517,7 @@ export default { |
|
|
|
|
let params = { |
|
|
|
|
lcId: this.lcId, |
|
|
|
|
name: this.formData.lcJudgmentPoint.name |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
this.$post(this.api.queryNameIsExist, params).then(res => { |
|
|
|
|
if (res.status === 200) { |
|
|
|
|
this.isNameRepeat = false; |
|
|
|
@ -515,7 +525,7 @@ export default { |
|
|
|
|
this.isNameRepeat = true; |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
|
console.log(err) |
|
|
|
|
console.log(err); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -567,7 +577,7 @@ export default { |
|
|
|
|
obj.emptyOne = i.subjectId ? i.subjectId.toString() : ""; |
|
|
|
|
obj.emptyTwo = i.value1; |
|
|
|
|
} else if (i.type == 4) { |
|
|
|
|
if (i.value1 === '无限制') { |
|
|
|
|
if (i.value1 === "无限制") { |
|
|
|
|
obj.emptyOne = i.value1; // 问答题,传的不是题目id |
|
|
|
|
} else if (i.value1 && i.value2) { |
|
|
|
|
obj.emptyOne = `${i.value1},${i.value2}`; // 问答题,传的不是题目id |
|
|
|
@ -580,7 +590,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
tempArr.push(obj); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.formData.lcJudgmentRuleList = tempArr; |
|
|
|
|
if (this.isAdd) { // 新增判分点 |
|
|
|
@ -592,8 +602,8 @@ export default { |
|
|
|
|
this.$message.warning(res.message); |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
|
console.log(err) |
|
|
|
|
}) |
|
|
|
|
console.log(err); |
|
|
|
|
}); |
|
|
|
|
} else if (this.isEdit) { // 编辑判分点 |
|
|
|
|
this.$post(this.api.updateJudgmentPoint, this.formData).then(res => { |
|
|
|
|
if (res.status === 200) { |
|
|
|
@ -603,14 +613,15 @@ export default { |
|
|
|
|
this.$message.warning(res.message); |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
|
console.log(err) |
|
|
|
|
}) |
|
|
|
|
console.log(err); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
addRule() { // 新增规则 |
|
|
|
|
this.isAddRule = true; |
|
|
|
|
this.tableData.length && this.tableData.push({ruleOperation: 0}); |
|
|
|
|
this.tableData.length && this.tableData.push({ruleOperation: 0, indexNo: ""}); |
|
|
|
|
this.tableData.push({ |
|
|
|
|
indexNo: this.tableData.length ? parseInt(this.tableData.length/2)+1 : 1, |
|
|
|
|
isSubject: true, |
|
|
|
|
isDisabled: false, // 不禁用 |
|
|
|
|
isSave: false, // 未保存 |
|
|
|
@ -622,8 +633,8 @@ export default { |
|
|
|
|
value2: "", |
|
|
|
|
value3: "", |
|
|
|
|
value4: "", |
|
|
|
|
value5: "", |
|
|
|
|
}) |
|
|
|
|
value5: "" |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
changeResult(row) { // (左右)结果运算符(0:且 1:或 默认0) |
|
|
|
|
row.resultOperation = row.resultOperation === 0 ? 1 : 0; |
|
|
|
@ -635,6 +646,7 @@ export default { |
|
|
|
|
handleEdit(row) { // 处理编辑规则 |
|
|
|
|
this.tableDataCopy = deepCopy(this.tableData); // 深拷贝 |
|
|
|
|
row.isDisabled = false; |
|
|
|
|
row.isSave = false; |
|
|
|
|
}, |
|
|
|
|
handleSave(row, index) { // 处理保存规则 |
|
|
|
|
let keys = this.$refs[`tree-${index}`].getCheckedKeys(); |
|
|
|
@ -657,7 +669,7 @@ export default { |
|
|
|
|
if (!row.value1) { |
|
|
|
|
this.$message.warning(`请选择字数要求`); |
|
|
|
|
return; |
|
|
|
|
} else if (row.value1 !== '无限制' && !row.value2) { |
|
|
|
|
} else if (row.value1 !== "无限制" && !row.value2) { |
|
|
|
|
this.$message.warning(`请输入字数要求`); |
|
|
|
|
return; |
|
|
|
|
} else if (!row.value3) { |
|
|
|
@ -699,12 +711,13 @@ export default { |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning", |
|
|
|
|
center: true, |
|
|
|
|
center: true |
|
|
|
|
}).then(() => { |
|
|
|
|
this.tableData.splice(index, 1); |
|
|
|
|
index ? this.tableData.splice(index - 1, 1) : this.tableData.splice(0, 1); |
|
|
|
|
this.isAddRule = false; |
|
|
|
|
}).catch(() => {}) |
|
|
|
|
}).catch(() => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 表头样式设置 |
|
|
|
|
headClass() { |
|
|
|
@ -827,9 +840,11 @@ export default { |
|
|
|
|
border-radius: 0; |
|
|
|
|
background: #dddddd; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.tree-con { |
|
|
|
|
height: 230px; |
|
|
|
|
position: relative; |
|
|
|
|
|
|
|
|
|
.mask { |
|
|
|
|
width: 100%; |
|
|
|
|
height: 100%; |
|
|
|
@ -847,19 +862,27 @@ export default { |
|
|
|
|
border: 1px solid #e4e7ed; |
|
|
|
|
border-radius: 4px; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.block { |
|
|
|
|
.block1 { |
|
|
|
|
@include block; |
|
|
|
|
height: 230px; |
|
|
|
|
background-color: #fff; |
|
|
|
|
overflow: auto; |
|
|
|
|
} |
|
|
|
|
.block { |
|
|
|
|
@include block; |
|
|
|
|
min-height: 100px; |
|
|
|
|
background-color: #fff; |
|
|
|
|
overflow: auto; |
|
|
|
|
|
|
|
|
|
.box { |
|
|
|
|
padding: 0 24px; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.line { |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
|
margin: 12px 0; |
|
|
|
|
|
|
|
|
|
.label { |
|
|
|
|
//width: 100px; |
|
|
|
|
margin-right: 10px; |
|
|
|
|