refactor(流程图): 评分状态挪进 store——交完切去写代码,这次的评分结果不再丢
Deploy / deploy (push) Canceled after 0s

SubmitFlowchart 只在语言选成 Flowchart 时才挂载,评分的全部状态(WebSocket 订阅、
轮询兜底、3 分钟超时)都长在它身上:交完马上切去写代码,组件一卸载就断开连接,
正在评的那次结果丢了 —— 不提示分数,评到 A/S 也不亮到「我的流程图」。

- oj/store/flowchart.ts:提交、评分跟踪、评完的提示、A/S 亮图、最近一次分数;
  换题和离开页面时收掉
- SubmitFlowchart 只剩从画布取图和评分详情弹框
- 顺手补了登录检查:原来没登录也能点,请求发出去才被拦,只看到一句「提交失败」

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-09-28 13:49:45 +08:00
1 parent 26e22e2542
commit 5cb7cfa924
3 files changed
+295 -243

No files matched your search

+3
View File
@@ -8,6 +8,7 @@ import { useScreenModeStore } from "shared/store/screenMode"
import { useMyFlowchartStore } from "shared/store/myFlowchart"
import { useUserStore } from "shared/store/user"
import { useSubmissionStore } from "oj/store/submission"
import { useFlowchartStore } from "oj/store/flowchart"
// 判完之后该发生的事(烟花、点评、回题单)。静态引入:它得在第一次判完之前就挂好
import SubmissionEffects from "./components/SubmissionEffects.vue"
@@ -137,6 +138,8 @@ onBeforeUnmount(() => {
// 提交状态在 store 里、离开页面也不会自己没:不清的话回到题目页(哪怕换了一道题),
// 结果面板里还是上一次的那条
useSubmissionStore().reset()
// 流程图那边同理,还在评的那次不再跟(照常评完落库)
useFlowchartStore().reset()
problem.value = null
errMsg.value = "无数据"
screenModeStore.resetScreenMode()