成工院大铁标准线实训测验模式结束后弹出的结果优化

This commit is contained in:
joylink_fanyuhong 2024-09-11 09:33:02 +08:00
parent eff99d3609
commit 5470a32bb7

View File

@ -15,6 +15,7 @@
style="width: 100%" style="width: 100%"
> >
<el-table-column prop="desc" label="步骤" /> <el-table-column prop="desc" label="步骤" />
<el-table-column prop="role" label="操作人员" />
<el-table-column prop="success" label="操作结果" width="100"> <el-table-column prop="success" label="操作结果" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.success?'正确':'错误' }}</span> <span>{{ scope.row.success?'正确':'错误' }}</span>
@ -22,7 +23,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="score" label="得分" width="100"> <el-table-column prop="score" label="得分" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.score || 0 }}</span> <span>{{ scope.row.score }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -54,7 +55,11 @@ export default {
if (scoreList && scoreList.length) { if (scoreList && scoreList.length) {
scoreList.forEach(score => { scoreList.forEach(score => {
const step = this.stepList.find(step => step.id == score.stepId); const step = this.stepList.find(step => step.id == score.stepId);
this.tableData.push({ ...score, desc: step.description }); const role = this.$store.state.training.memberData[parseInt(step.memberId)];
if (!score.hasOwnProperty('score')) {
score.score = '/';
}
this.tableData.push({ ...score, role: role.labelName, desc: step.description });
}); });
} }
this.dialogVisible = true; this.dialogVisible = true;
@ -66,7 +71,7 @@ export default {
if (index === 0) { if (index === 0) {
sums[index] = '合计'; sums[index] = '合计';
return; return;
} else if (index === 1) { } else if (index === 2) {
const MyMemberId = this.$store.state.training.myMemberId; const MyMemberId = this.$store.state.training.myMemberId;
const scoringRuleList = this.$store.state.trainingNew.scoringRules.find(rule => rule.memberId == MyMemberId ); const scoringRuleList = this.$store.state.trainingNew.scoringRules.find(rule => rule.memberId == MyMemberId );
let total = 0; let total = 0;
@ -76,7 +81,7 @@ export default {
}); });
} }
sums[index] = total; sums[index] = total;
} else if (index === 2) { } else if (index === 3) {
const values = data.map(item => Number(item[column.property])); const values = data.map(item => Number(item[column.property]));
sums[index] = values.reduce((prev, curr) => { sums[index] = values.reduce((prev, curr) => {
const value = Number(curr); const value = Number(curr);