|
|
@ -23,6 +23,7 @@ |
|
|
|
<div class="label">判分点名称</div> |
|
|
|
<div class="label">判分点名称</div> |
|
|
|
<el-input |
|
|
|
<el-input |
|
|
|
v-model.trim="formData.lcJudgmentPoint.name" |
|
|
|
v-model.trim="formData.lcJudgmentPoint.name" |
|
|
|
|
|
|
|
:readonly="isView" |
|
|
|
@blur="handleBlur" |
|
|
|
@blur="handleBlur" |
|
|
|
placeholder="请输入内容" |
|
|
|
placeholder="请输入内容" |
|
|
|
clearable |
|
|
|
clearable |
|
|
@ -31,8 +32,14 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="item"> |
|
|
|
<div class="item"> |
|
|
|
<div class="label">实验要求</div> |
|
|
|
<div class="label">实验要求</div> |
|
|
|
<quill :border="true" v-model="formData.lcJudgmentPoint.experimentalRequirements" :minHeight="150" |
|
|
|
<quill |
|
|
|
:height="150"/> |
|
|
|
v-model="formData.lcJudgmentPoint.experimentalRequirements" |
|
|
|
|
|
|
|
:readonly="isView" |
|
|
|
|
|
|
|
:border="true" |
|
|
|
|
|
|
|
:minHeight="150" |
|
|
|
|
|
|
|
:height="150" |
|
|
|
|
|
|
|
style="width: 100%" |
|
|
|
|
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
@ -102,7 +109,7 @@ |
|
|
|
<!-- type: 题目类型(1选择 2判断 3填空 4问答 5指标结果) --> |
|
|
|
<!-- type: 题目类型(1选择 2判断 3填空 4问答 5指标结果) --> |
|
|
|
<template v-if="scope.row.type == 1"> |
|
|
|
<template v-if="scope.row.type == 1"> |
|
|
|
<div class="line"> |
|
|
|
<div class="line"> |
|
|
|
<span class="label" style="width: auto;text-align: left">{{ scope.row.name }}</span> |
|
|
|
<div>{{ scope.row.name }}</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="line"> |
|
|
|
<div class="line"> |
|
|
|
<span class="label mini">正确答案</span> |
|
|
|
<span class="label mini">正确答案</span> |
|
|
@ -127,7 +134,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
<template v-if="scope.row.type == 2"> |
|
|
|
<template v-if="scope.row.type == 2"> |
|
|
|
<div class="line"> |
|
|
|
<div class="line"> |
|
|
|
<span class="label" style="width: auto;text-align: left">{{ scope.row.name }}</span> |
|
|
|
<div>{{ scope.row.name }}</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="line"> |
|
|
|
<div class="line"> |
|
|
|
<span class="label mini">正确答案</span> |
|
|
|
<span class="label mini">正确答案</span> |
|
|
@ -215,6 +222,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
<template v-if="scope.row.type == 5"> |
|
|
|
<template v-if="scope.row.type == 5"> |
|
|
|
<div class="line"> |
|
|
|
<div class="line"> |
|
|
|
|
|
|
|
<!-- |
|
|
|
<span class="label">选择指标</span> |
|
|
|
<span class="label">选择指标</span> |
|
|
|
<div class="action"> |
|
|
|
<div class="action"> |
|
|
|
<el-select |
|
|
|
<el-select |
|
|
@ -230,6 +238,9 @@ |
|
|
|
></el-option> |
|
|
|
></el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
--> |
|
|
|
|
|
|
|
<div>{{ scope.row.name }}</div> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="line"> |
|
|
|
<div class="line"> |
|
|
|
<span class="label">交易指标区间</span> |
|
|
|
<span class="label">交易指标区间</span> |
|
|
@ -274,9 +285,9 @@ |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" width="300" v-if="!isView"> |
|
|
|
<el-table-column label="操作" width="300" v-if="!isView"> |
|
|
|
<template slot-scope="scope" v-if="scope.row.isSubject"> |
|
|
|
<template slot-scope="scope" v-if="scope.row.isSubject"> |
|
|
|
<el-button v-if="!scope.row.isSave" size="mini" type="text" @click="handleEdit(scope.row)">编辑</el-button> |
|
|
|
<el-button v-show="scope.row.isDisabled" size="mini" type="text" @click="handleEdit(scope.row)">编辑</el-button> |
|
|
|
<el-button v-if="scope.row.isSave" size="mini" type="text" @click="handleSave(scope.row, scope.$index)">保存</el-button> |
|
|
|
<el-button v-show="!scope.row.isDisabled" size="mini" type="text" @click="handleSave(scope.row, scope.$index)">保存</el-button> |
|
|
|
<el-button v-if="scope.row.isSave" size="mini" type="text" @click="handleCancel(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 size="mini" type="text" @click="handleDelete(scope.row, scope.$index)">删除</el-button> |
|
|
|
<el-button size="mini" type="text" @click="handleDelete(scope.row, scope.$index)">删除</el-button> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
@ -294,9 +305,10 @@ export default { |
|
|
|
components: {quill}, |
|
|
|
components: {quill}, |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
isAdd: false, // 添加 |
|
|
|
lcId: "", // 流程类判分点id |
|
|
|
isEdit: false, // 编辑 |
|
|
|
isAdd: Boolean(this.$route.query.isAdd), // 添加 |
|
|
|
isView: false, // 查看 |
|
|
|
isEdit: Boolean(this.$route.query.isEdit), // 编辑 |
|
|
|
|
|
|
|
isView: Boolean(this.$route.query.isView), // 查看 |
|
|
|
isNameRepeat: false, // 名称是否重复 |
|
|
|
isNameRepeat: false, // 名称是否重复 |
|
|
|
treeData: [], // 树结构数据 |
|
|
|
treeData: [], // 树结构数据 |
|
|
|
defaultProps: { |
|
|
|
defaultProps: { |
|
|
@ -317,22 +329,16 @@ export default { |
|
|
|
}, // 表单参数 |
|
|
|
}, // 表单参数 |
|
|
|
tableData: [], // 规则表格数据 |
|
|
|
tableData: [], // 规则表格数据 |
|
|
|
tableDataCopy: [], // 规则表格数据备份 |
|
|
|
tableDataCopy: [], // 规则表格数据备份 |
|
|
|
isAddRule: false, // 是否可以新增规则 |
|
|
|
isAddRule: false, // 是否禁用新增规则按钮 |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
mounted() { |
|
|
|
this.$route.query.token && this.$store.commit('setParam', { |
|
|
|
this.$route.query.token && this.$store.commit('setParam', { |
|
|
|
token: atob(decodeURI(this.$route.query.token)) |
|
|
|
token: atob(decodeURI(this.$route.query.token)) |
|
|
|
}); |
|
|
|
}); |
|
|
|
if (this.$route.query.isView) { |
|
|
|
|
|
|
|
this.isView = true; |
|
|
|
|
|
|
|
} else if (this.$route.query.isEdit) { |
|
|
|
|
|
|
|
this.isEdit = true; |
|
|
|
|
|
|
|
} else if (this.$route.query.isAdd) { |
|
|
|
|
|
|
|
this.isAdd = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.getTreeData(); |
|
|
|
this.getTreeData(); |
|
|
|
if (this.$route.query.lcId) { |
|
|
|
if (this.$route.query.lcId) { |
|
|
|
|
|
|
|
this.lcId = this.$route.query.lcId; |
|
|
|
this.getInfoData(this.$route.query.lcId); |
|
|
|
this.getInfoData(this.$route.query.lcId); |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.$route.query.systemId) { |
|
|
|
if (this.$route.query.systemId) { |
|
|
@ -353,9 +359,14 @@ export default { |
|
|
|
let length = judgmentRuleList.length; |
|
|
|
let length = judgmentRuleList.length; |
|
|
|
let tempArr = []; |
|
|
|
let tempArr = []; |
|
|
|
judgmentRuleList.forEach((item, index) => { |
|
|
|
judgmentRuleList.forEach((item, index) => { |
|
|
|
let obj = { ...item, isSubject: true, isDisabled: true, isSave: false}; |
|
|
|
let obj = { |
|
|
|
|
|
|
|
...item, |
|
|
|
|
|
|
|
isSubject: true, |
|
|
|
|
|
|
|
isDisabled: true, // 已禁用 |
|
|
|
|
|
|
|
isSave: true // 已保存 |
|
|
|
|
|
|
|
}; |
|
|
|
//题目类型(1选择 2判断 3填空 4问答 5指标结果) |
|
|
|
//题目类型(1选择 2判断 3填空 4问答 5指标结果) |
|
|
|
if (item.type == 1) { |
|
|
|
if (item.type == 1 || item.type == 2) { |
|
|
|
obj.subjectId = Number(item.emptyOne); |
|
|
|
obj.subjectId = Number(item.emptyOne); |
|
|
|
obj.value1 = Number(item.emptyTwo); |
|
|
|
obj.value1 = Number(item.emptyTwo); |
|
|
|
} else if (item.type == 3) { |
|
|
|
} else if (item.type == 3) { |
|
|
@ -367,8 +378,8 @@ export default { |
|
|
|
obj.value1 = item.emptyOne; |
|
|
|
obj.value1 = item.emptyOne; |
|
|
|
obj.value2 = ""; |
|
|
|
obj.value2 = ""; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
obj.value1 = item.emptyOne.substring(1,item.emptyOne.indexOf(',')); |
|
|
|
obj.value1 = item.emptyOne.substring(0,item.emptyOne.indexOf(',')); |
|
|
|
obj.value2 = item.emptyOne.substring(item.emptyOne.indexOf(',') + 1,item.emptyOne.length - 1) |
|
|
|
obj.value2 = item.emptyOne.substring(item.emptyOne.indexOf(',') + 1,item.emptyOne.length) |
|
|
|
} |
|
|
|
} |
|
|
|
obj.value3 = item.emptyTwo; |
|
|
|
obj.value3 = item.emptyTwo; |
|
|
|
} else if (item.type == 5) { |
|
|
|
} else if (item.type == 5) { |
|
|
@ -385,7 +396,7 @@ export default { |
|
|
|
this.tableData = tempArr; |
|
|
|
this.tableData = tempArr; |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
this.tableData.forEach((item, index) => { |
|
|
|
this.tableData.forEach(async (item, index) => { |
|
|
|
// 勾选树节点 |
|
|
|
// 勾选树节点 |
|
|
|
if (item.operationIds) { |
|
|
|
if (item.operationIds) { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$nextTick(() => { |
|
|
@ -393,8 +404,8 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
// 根据题目id,获取题目信息 |
|
|
|
// 根据题目id,获取题目信息 |
|
|
|
if (item.type && item.type != 4 && item.emptyOne) { |
|
|
|
if (item.isSubject && item.type && item.type != 4 && item.emptyOne) { |
|
|
|
this.getSubjectData(item.subjectId, index); |
|
|
|
await this.getSubjectData(item.emptyOne, index); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
@ -470,7 +481,7 @@ export default { |
|
|
|
handleBlur() { // 新增/编辑判分点名称判重 |
|
|
|
handleBlur() { // 新增/编辑判分点名称判重 |
|
|
|
if (this.formData.lcJudgmentPoint.name) { |
|
|
|
if (this.formData.lcJudgmentPoint.name) { |
|
|
|
let params = { |
|
|
|
let params = { |
|
|
|
lcId: this.$route.query.lcId ? this.$route.query.lcId : "", |
|
|
|
lcId: this.lcId, |
|
|
|
name: this.formData.lcJudgmentPoint.name |
|
|
|
name: this.formData.lcJudgmentPoint.name |
|
|
|
} |
|
|
|
} |
|
|
|
this.$post(this.api.queryNameIsExist, params).then(res => { |
|
|
|
this.$post(this.api.queryNameIsExist, params).then(res => { |
|
|
@ -505,7 +516,7 @@ export default { |
|
|
|
if (this.tableData[i].isSubject && !this.tableData[i].operationIds) { |
|
|
|
if (this.tableData[i].isSubject && !this.tableData[i].operationIds) { |
|
|
|
this.$message.warning(`第${i + 1}项请选择操作点`); |
|
|
|
this.$message.warning(`第${i + 1}项请选择操作点`); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} else if (this.tableData[i].isSave) { |
|
|
|
} else if (this.tableData[i].isSubject && !this.tableData[i].isSave) { |
|
|
|
this.$message.warning(`第${i + 1}项,未保存`); |
|
|
|
this.$message.warning(`第${i + 1}项,未保存`); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -518,7 +529,7 @@ export default { |
|
|
|
emptyOne: "", |
|
|
|
emptyOne: "", |
|
|
|
emptyTwo: "", |
|
|
|
emptyTwo: "", |
|
|
|
id: i.id ? i.id : "", |
|
|
|
id: i.id ? i.id : "", |
|
|
|
lcId: i.lcId ? i.lcId : "", |
|
|
|
lcId: i.lcId, |
|
|
|
type: i.type ? i.type : "", |
|
|
|
type: i.type ? i.type : "", |
|
|
|
operationIds: i.operationIds, |
|
|
|
operationIds: i.operationIds, |
|
|
|
resultOperation: i.resultOperation, |
|
|
|
resultOperation: i.resultOperation, |
|
|
@ -577,8 +588,9 @@ export default { |
|
|
|
this.tableData.length && this.tableData.push({ruleOperation: 0}); |
|
|
|
this.tableData.length && this.tableData.push({ruleOperation: 0}); |
|
|
|
this.tableData.push({ |
|
|
|
this.tableData.push({ |
|
|
|
isSubject: true, |
|
|
|
isSubject: true, |
|
|
|
isDisabled: true, |
|
|
|
isDisabled: false, // 不禁用 |
|
|
|
isSave: false, |
|
|
|
isSave: false, // 未保存 |
|
|
|
|
|
|
|
lcId: this.lcId, |
|
|
|
resultOperation: 0, |
|
|
|
resultOperation: 0, |
|
|
|
ruleOperation: 0, |
|
|
|
ruleOperation: 0, |
|
|
|
operationIds: "", |
|
|
|
operationIds: "", |
|
|
@ -599,7 +611,6 @@ export default { |
|
|
|
handleEdit(row) { // 处理编辑规则 |
|
|
|
handleEdit(row) { // 处理编辑规则 |
|
|
|
this.tableDataCopy = deepCopy(this.tableData); // 深拷贝 |
|
|
|
this.tableDataCopy = deepCopy(this.tableData); // 深拷贝 |
|
|
|
row.isDisabled = false; |
|
|
|
row.isDisabled = false; |
|
|
|
row.isSave = true; |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
handleSave(row, index) { // 处理保存规则 |
|
|
|
handleSave(row, index) { // 处理保存规则 |
|
|
|
let keys = this.$refs[`tree-${index}`].getCheckedKeys(); |
|
|
|
let keys = this.$refs[`tree-${index}`].getCheckedKeys(); |
|
|
@ -641,17 +652,23 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
row.isSave = false; |
|
|
|
row.isSave = true; |
|
|
|
row.isDisabled = true; |
|
|
|
row.isDisabled = true; |
|
|
|
this.isAddRule = false; |
|
|
|
this.isAddRule = false; |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleCancel(row, index) { // 处理取消编辑规则 |
|
|
|
handleCancel(row, index) { // 处理取消编辑规则 |
|
|
|
|
|
|
|
if (row.isSave) { |
|
|
|
this.$set(this.tableData, index, this.tableDataCopy[index]); |
|
|
|
this.$set(this.tableData, index, this.tableDataCopy[index]); |
|
|
|
if (!this.tableData[index].operationIds) { |
|
|
|
if (!this.tableData[index].operationIds) { |
|
|
|
this.$refs[`tree-${index}`].setCheckedKeys([]); |
|
|
|
this.$refs[`tree-${index}`].setCheckedKeys([]); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.$refs[`tree-${index}`].setCheckedKeys([this.tableData[index].operationIds]); |
|
|
|
this.$refs[`tree-${index}`].setCheckedKeys([this.tableData[index].operationIds]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.tableData.splice(index, 1); |
|
|
|
|
|
|
|
index ? this.tableData.splice(index - 1, 1) : this.tableData.splice(0, 1); |
|
|
|
|
|
|
|
this.isAddRule = false; |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleDelete(row, index) { // 处理删除规则 |
|
|
|
handleDelete(row, index) { // 处理删除规则 |
|
|
|
this.$confirm("此操作将永久删除该规则, 是否继续?", "提示", { |
|
|
|
this.$confirm("此操作将永久删除该规则, 是否继续?", "提示", { |
|
|
@ -662,7 +679,7 @@ export default { |
|
|
|
}).then(() => { |
|
|
|
}).then(() => { |
|
|
|
this.tableData.splice(index, 1); |
|
|
|
this.tableData.splice(index, 1); |
|
|
|
index ? this.tableData.splice(index - 1, 1) : this.tableData.splice(0, 1); |
|
|
|
index ? this.tableData.splice(index - 1, 1) : this.tableData.splice(0, 1); |
|
|
|
this.isAddRule = index === 0 ? false : true; |
|
|
|
this.isAddRule = false; |
|
|
|
}).catch(() => {}) |
|
|
|
}).catch(() => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 表头样式设置 |
|
|
|
// 表头样式设置 |
|
|
@ -795,6 +812,7 @@ export default { |
|
|
|
position: absolute; |
|
|
|
position: absolute; |
|
|
|
top: 0; |
|
|
|
top: 0; |
|
|
|
bottom: 0; |
|
|
|
bottom: 0; |
|
|
|
|
|
|
|
right: 10px; |
|
|
|
cursor:not-allowed; |
|
|
|
cursor:not-allowed; |
|
|
|
z-index: 99999; |
|
|
|
z-index: 99999; |
|
|
|
} |
|
|
|
} |
|
|
|