|
|
@ -71,7 +71,7 @@ |
|
|
|
> |
|
|
|
> |
|
|
|
<el-table-column prop="id" type="index" label="序号" width="80"></el-table-column> |
|
|
|
<el-table-column prop="id" type="index" label="序号" width="80"></el-table-column> |
|
|
|
<el-table-column label="编译器中正确答案" align="center"> |
|
|
|
<el-table-column label="编译器中正确答案" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope" v-if="scope.row.isSubject"> |
|
|
|
<p class="p">字段一致性规则:用户编辑器中至少出现如下语句</p> |
|
|
|
<p class="p">字段一致性规则:用户编辑器中至少出现如下语句</p> |
|
|
|
<el-input |
|
|
|
<el-input |
|
|
|
type="textarea" |
|
|
|
type="textarea" |
|
|
@ -84,6 +84,7 @@ |
|
|
|
<el-table-column label=" " width="150"> |
|
|
|
<el-table-column label=" " width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button |
|
|
|
<el-button |
|
|
|
|
|
|
|
v-if="scope.row.isSubject" |
|
|
|
:disabled="isView || scope.row.isDisabled" |
|
|
|
:disabled="isView || scope.row.isDisabled" |
|
|
|
type="primary" circle |
|
|
|
type="primary" circle |
|
|
|
@click="changeResult(scope.row)" |
|
|
|
@click="changeResult(scope.row)" |
|
|
@ -91,10 +92,13 @@ |
|
|
|
> |
|
|
|
> |
|
|
|
{{ scope.row.withOr === 0 ? '且' : '或' }} |
|
|
|
{{ scope.row.withOr === 0 ? '且' : '或' }} |
|
|
|
</el-button> |
|
|
|
</el-button> |
|
|
|
|
|
|
|
<el-button v-else type="primary" circle @click="changeRule(scope.row, scope.$index)"> |
|
|
|
|
|
|
|
{{ scope.row.ruleOperation === 0 ? "且" : "或" }} |
|
|
|
|
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="终端中正确答案" align="center"> |
|
|
|
<el-table-column label="终端中正确答案" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope" v-if="scope.row.isSubject"> |
|
|
|
<p class="p">运行结果一致性规则:用户运行结果需要与下方代码运行结果一致</p> |
|
|
|
<p class="p">运行结果一致性规则:用户运行结果需要与下方代码运行结果一致</p> |
|
|
|
<el-input |
|
|
|
<el-input |
|
|
|
type="textarea" |
|
|
|
type="textarea" |
|
|
@ -105,7 +109,7 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</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"> |
|
|
|
<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="handleEdit(scope.row)">编辑</el-button> |
|
|
|
<el-button v-show="!scope.row.isDisabled" size="mini" type="text" @click="handleSave(scope.row)">保存</el-button> |
|
|
|
<el-button v-show="!scope.row.isDisabled" size="mini" type="text" @click="handleSave(scope.row)">保存</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="handleCancel(scope.row, scope.$index)">取消</el-button> |
|
|
@ -178,14 +182,15 @@ export default { |
|
|
|
bcJudgmentRuleList: judgmentRule |
|
|
|
bcJudgmentRuleList: judgmentRule |
|
|
|
} |
|
|
|
} |
|
|
|
// 重新封装数据 |
|
|
|
// 重新封装数据 |
|
|
|
judgmentRule.forEach((item, index) => { |
|
|
|
this.anewPosttingData(judgmentRule) |
|
|
|
this.tableData.push({ |
|
|
|
// judgmentRule.forEach((item, index) => { |
|
|
|
...item, |
|
|
|
// this.tableData.push({ |
|
|
|
isSubject: true, |
|
|
|
// ...item, |
|
|
|
isDisabled: true, |
|
|
|
// isSubject: true, |
|
|
|
isSave: true |
|
|
|
// isDisabled: true, |
|
|
|
}); |
|
|
|
// isSave: true |
|
|
|
}) |
|
|
|
// }); |
|
|
|
|
|
|
|
// }) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.$message.warning(res.message); |
|
|
|
this.$message.warning(res.message); |
|
|
|
} |
|
|
|
} |
|
|
@ -193,6 +198,49 @@ export default { |
|
|
|
console.log(err) |
|
|
|
console.log(err) |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 重新封装数据 |
|
|
|
|
|
|
|
anewPosttingData(judgmentRule){ |
|
|
|
|
|
|
|
let length = judgmentRule.length; |
|
|
|
|
|
|
|
let tempArr = []; |
|
|
|
|
|
|
|
judgmentRule.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)) { |
|
|
|
|
|
|
|
tempArr.push({ruleOperation: item.ruleOperation}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.tableData = tempArr; |
|
|
|
|
|
|
|
console.log(this.tableData) |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
handleBlur() { // 新增/编辑判分点名称判重 |
|
|
|
handleBlur() { // 新增/编辑判分点名称判重 |
|
|
|
if (this.formData.points.name) { |
|
|
|
if (this.formData.points.name) { |
|
|
|
let params = { |
|
|
|
let params = { |
|
|
@ -281,19 +329,53 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
addRule() { // 新增规则 |
|
|
|
addRule() { // 新增规则 |
|
|
|
|
|
|
|
if(!this.isAddRule) { |
|
|
|
this.isAddRule = true; |
|
|
|
this.isAddRule = true; |
|
|
|
|
|
|
|
// this.tableData.length && this.tableData.push({ruleOperation: 0, indexNo: ""}); |
|
|
|
|
|
|
|
if (this.tableData.length > 0) { |
|
|
|
this.tableData.push({ |
|
|
|
this.tableData.push({ |
|
|
|
|
|
|
|
ruleOperation: 0 |
|
|
|
|
|
|
|
}, { |
|
|
|
|
|
|
|
indexNo: this.tableData.length + 1, |
|
|
|
|
|
|
|
isSubject: true, |
|
|
|
isDisabled: false, // 不禁用 |
|
|
|
isDisabled: false, // 不禁用 |
|
|
|
isSave: false, // 未保存 |
|
|
|
isSave: false, // 未保存 |
|
|
|
bcId: this.bcId, |
|
|
|
lcId: this.lcId, |
|
|
|
required: "", |
|
|
|
resultOperation: 0, |
|
|
|
result: "", |
|
|
|
ruleOperation: 0, |
|
|
|
withOr: 0 |
|
|
|
operationIds: "", |
|
|
|
|
|
|
|
value1: "", |
|
|
|
|
|
|
|
value2: "", |
|
|
|
|
|
|
|
value3: "", |
|
|
|
|
|
|
|
value4: "", |
|
|
|
|
|
|
|
value5: "" |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.tableData.push({ |
|
|
|
|
|
|
|
indexNo: this.tableData.length + 1, |
|
|
|
|
|
|
|
isSubject: true, |
|
|
|
|
|
|
|
isDisabled: false, // 不禁用 |
|
|
|
|
|
|
|
isSave: false, // 未保存 |
|
|
|
|
|
|
|
lcId: this.lcId, |
|
|
|
|
|
|
|
resultOperation: 0, |
|
|
|
|
|
|
|
ruleOperation: 0, |
|
|
|
|
|
|
|
operationIds: "", |
|
|
|
|
|
|
|
value1: "", |
|
|
|
|
|
|
|
value2: "", |
|
|
|
|
|
|
|
value3: "", |
|
|
|
|
|
|
|
value4: "", |
|
|
|
|
|
|
|
value5: "" |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
changeResult(row) { // (左右)结果运算符(0:且 1:或 默认0) |
|
|
|
changeResult(row) { // (左右)结果运算符(0:且 1:或 默认0) |
|
|
|
row.withOr = row.withOr === 0 ? 1 : 0; |
|
|
|
row.withOr = row.withOr === 0 ? 1 : 0; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
changeRule(row, index) { // (上下)规则运算符(0:且 1:或 默认0) |
|
|
|
|
|
|
|
row.ruleOperation = row.ruleOperation === 0 ? 1 : 0; |
|
|
|
|
|
|
|
this.tableData[index - 1].ruleOperation = row.ruleOperation; |
|
|
|
|
|
|
|
}, |
|
|
|
handleEdit(row) { // 处理编辑规则 |
|
|
|
handleEdit(row) { // 处理编辑规则 |
|
|
|
this.tableDataCopy = deepCopy(this.tableData); // 深拷贝 |
|
|
|
this.tableDataCopy = deepCopy(this.tableData); // 深拷贝 |
|
|
|
row.isDisabled = false; |
|
|
|
row.isDisabled = false; |
|
|
@ -315,7 +397,8 @@ export default { |
|
|
|
if (row.isSave) { |
|
|
|
if (row.isSave) { |
|
|
|
this.$set(this.tableData, index, this.tableDataCopy[index]); |
|
|
|
this.$set(this.tableData, index, this.tableDataCopy[index]); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.tableData.splice(index, 1); |
|
|
|
this.tableData.splice(index-1, 2); |
|
|
|
|
|
|
|
// this.tableData.splice(index, 1); |
|
|
|
this.isAddRule = false; |
|
|
|
this.isAddRule = false; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
@ -326,7 +409,16 @@ export default { |
|
|
|
type: "warning", |
|
|
|
type: "warning", |
|
|
|
center: true, |
|
|
|
center: true, |
|
|
|
}).then(() => { |
|
|
|
}).then(() => { |
|
|
|
this.tableData.splice(index, 1); |
|
|
|
// this.tableData.splice(index, 1); |
|
|
|
|
|
|
|
console.log(index) |
|
|
|
|
|
|
|
console.log(this.tableData.length) |
|
|
|
|
|
|
|
if (index+1 == this.tableData.length){ |
|
|
|
|
|
|
|
this.tableData.splice(index - 1, 2) |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
this.tableData.splice(index,2); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.itemkey = Math.random() |
|
|
|
this.isAddRule = false; |
|
|
|
this.isAddRule = false; |
|
|
|
}).catch(() => {}) |
|
|
|
}).catch(() => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
|