在windows上修复一些bug

This commit is contained in:
chenqiang 2025-08-12 22:35:36 +08:00
parent 0de17d0251
commit e55476133f
3 changed files with 11 additions and 7 deletions

View File

@ -84,7 +84,6 @@ function createWindow() {
preload: path.join(__dirname, "../electron/preload.js"),
nodeIntegration: false,
contextIsolation: true,
openDevTools: true,
},
});

View File

@ -9,9 +9,11 @@
<!-- 交卷结果卡片 -->
<div class="bg-white rounded-4 shadow-lg p-4 w-100 max-w-2xl border-2 border-primary/20">
<el-result icon="success" title="考试已完成" sub-title="您已成功提交试卷感谢您的参与">
<!--
<template #extra>
<p v-if="pdfPath">{{ pdfPath.filePath }}</p>
</template>
-->
</el-result>
<el-divider />
@ -170,9 +172,11 @@ const formatDuration = (startTime, endTime) => {
const end = new Date(endTime)
const diff = end - start
const minutes = Math.floor(diff / (1000 * 60))
const hours = Math.floor(minutes / 60)
const mins = minutes % 60
return `${hours}小时${mins}分钟`
return `${minutes}分钟`
// const hours = Math.floor(minutes / 60)
// const mins = minutes % 60
// return `${hours}${mins}`
}
//
@ -212,7 +216,8 @@ const checkAnswers = async () => {
pdfPath.value = await window.electronAPI.generatePaperPdf(result.data)
console.log('生成的试卷PDF文件路径:', pdfPath.value)
// store
userStore.setPaper(JSON.stringify(result.data))
userStore.setPaper(JSON.parse(result.data))
console.log("paper.value: ", paper.value)
console.log('试卷数据已更新到store得分:', result.data.paper_score_real)
} else {
console.error('判卷失败:', result.message)

View File

@ -63,7 +63,7 @@
考试时长
</div>
</template>
{{ formatExamDuration(lastExam?.exam_minutes) }}
{{ lastExam?.exam_minutes }}分钟
</el-descriptions-item>
<el-descriptions-item>
<template #label>
@ -74,7 +74,7 @@
最短考试时长
</div>
</template>
{{ formatExamDuration(lastExam?.exam_minutes_min) }}
{{ lastExam?.exam_minutes_min }}分钟
</el-descriptions-item>
<el-descriptions-item>
<template #label>