实验报告且或

master
yujialong 6 months ago
parent 480e5f35fe
commit 1174a60114
  1. 56
      src/views/report/Index.vue

@ -87,38 +87,37 @@
</h6>
<el-table class="mb-4" :data="expData" border header-align="center">
<el-table-column type="index" label="序号" align="center" width="60">
<template #default="{ row, $index }">
<template #default="{ $index }">
{{ $index + 1 }}
</template>
</el-table-column>
<el-table-column prop="judgmentName" label="判分点" width="200" align="center"></el-table-column>
<el-table-column prop="judgmentName" label="考核点" align="center" width="150">
<template #default="{ row }">
<div v-for="(item, i) in row.lcRuleRecords" :key="i">
<span>
<span>{{ i + 1 }}. </span>{{ item.name }}
</span>
<div v-for="(item, i) in row.lcRuleRecords" :key="i" class="rule-line">
<span>{{ item.index }}. </span>{{ item.name }}
<p v-if="item.ruleOperation === '或'" class="my-1">
{{ item.ruleOperation === '或' ? '或' : '' }}
</p>
</div>
</template>
</el-table-column>
<el-table-column prop="ruleAnswer" label="参考答案" style="word-wrap: break-word">
<template #default="{ row }">
<div v-for="(item, i) in row?.lcRuleRecords" :key="i">
<span>
<span>{{ i + 1 }}. </span>{{ item.ruleAnswer }}
</span>
<div v-if="row.lcRuleRecords">
<div v-for="(item, i) in row.lcRuleRecords" :key="i" class="rule-line">
<span>{{ item.index }}. </span>{{ item.ruleAnswer }}
<p v-if="item.ruleOperation === '或'" class="pl-1 my-1">
{{ item.ruleOperation === '或' ? '或' : '' }}
</p>
</div>
</div>
</template>
</el-table-column>
<el-table-column prop="userAnswer" label="学生答案">
<template #default="{ row }">
<div v-for="(item, i) in row?.lcRuleRecords" :key="i">
<span v-if="item.userAnswer">
<span>{{ i + 1 }}. </span>{{ item.userAnswer }}
</span>
<span v-else>
<span>{{ i + 1 }}. </span>未填写
</span>
<div v-if="row.lcStudentAnswer">
<div v-for="(item, i) in row.lcStudentAnswer" :key="i" class="rule-line">{{ i + 1 }}. {{ item.userAnswer || '未填写' }}</div>
</div>
</template>
</el-table-column>
@ -162,11 +161,22 @@ const handleList = (list: Record<string, any>[]) => {
e.assessmentPoint = '';
e.referenceAnswer = '';
e.answer = '';
e?.lcRuleRecords?.map((n, i) => {
e.assessmentPoint += `${i + 1}.${n.name}`;
// e.referenceAnswer += `${i + 1}.${n.ruleAnswer}`;
e.referenceAnswer += `${i + 1}.${n.ruleAnswer}`;
e.answer += `${i + 1}.${n.userAnswer || '未填写'}`;
let index = 1;
e.lcRuleRecords.map((n, i) => {
n.index = index;
//
e.assessmentPoint += `${index}.${n.name};${n.ruleOperation === '或' ? '\n或\n' : ''}`;
e.referenceAnswer += `${index}.${n.ruleAnswer};${n.ruleOperation === '或' ? '\n或\n' : ''}`;
if (!n.userAnswer) n.userAnswer = '未填写';
if (n.ruleOperation === '或') {
index = 1;
} else {
index++;
}
});
e.lcStudentAnswer.map((n, i) => {
e.answer += `${i + 1}.${n.userAnswer || '未填写'};`
});
});
console.log('🚀 ~ file: Index.vue:235 ~ handleList ~ list:', list);
@ -233,9 +243,7 @@ const toLevel = () => {
router.push('/');
};
onMounted(() => {
getData();
});
onMounted(getData);
</script>
<style lang="scss" scoped>

Loading…
Cancel
Save