原来结果是提交按钮下面的 n-popover:点一下外面就收起、最高 600px、盖住编辑器, 学生没法一边看「正确输出 / 你的输出」一边改代码,还得靠「上次结果」按钮找回来。 - 左栏新增「结果」页签(手机上排在「代码」后面),交上去或者语法检查没过就自动切过去; 页签标题带状态图标(✕ / ✓ / ! / 判题中转圈),不只靠颜色 - 页签用 show:lazy:切走不卸载,编辑器里的错误标记、AI 提示都留着 - 「题目描述」改叫「题目」;去掉浮层和「上次结果」按钮 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
44 lines
1.5 KiB
Vue
44 lines
1.5 KiB
Vue
<script setup lang="ts">
|
|
import { storeToRefs } from "pinia"
|
|
import { useSubmissionStore } from "oj/store/submission"
|
|
|
|
/**
|
|
* 左栏「结果」页签的内容:提交前语法检查没过的说明、这一次提交的判题结果,或者空状态。
|
|
*
|
|
* 原来是提交按钮下面的一个浮层(n-popover),点一下外面就收起、最高 600px、盖住编辑器,
|
|
* 学生没法一边看「正确输出 / 你的输出」一边改代码。放进左栏页签之后编辑器整列都在,
|
|
* 改代码时结果就摆在旁边(见 docs/specs/2026-09-28-problem-page-redesign-design.md)。
|
|
*/
|
|
|
|
// 第一次切到「结果」时才加载:它带着 DataTable 和 Markdown 渲染,只看题不提交的人不用付
|
|
const SubmissionResult = defineAsyncComponent(() => import("./SubmissionResult.vue"))
|
|
const PythonErrorExplain = defineAsyncComponent(() => import("./PythonErrorExplain.vue"))
|
|
|
|
const { submission, syntaxErrorInfo } = storeToRefs(useSubmissionStore())
|
|
</script>
|
|
|
|
<template>
|
|
<div class="result-pane">
|
|
<n-flex v-if="syntaxErrorInfo" vertical>
|
|
<n-alert type="warning" title="代码有语法错误,还没有提交" />
|
|
<PythonErrorExplain :err-info="syntaxErrorInfo" />
|
|
</n-flex>
|
|
<SubmissionResult v-else-if="submission" :submission="submission" />
|
|
<n-empty
|
|
v-else
|
|
class="empty"
|
|
description="还没有提交过。写完代码按「提交代码」,结果会出现在这里"
|
|
/>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.result-pane {
|
|
padding: 4px 0 16px;
|
|
}
|
|
|
|
.empty {
|
|
margin-top: 48px;
|
|
}
|
|
</style>
|