diff --git a/src/components/ReviewRecall.vue b/src/components/ReviewRecall.vue index f25175a..521c460 100644 --- a/src/components/ReviewRecall.vue +++ b/src/components/ReviewRecall.vue @@ -51,6 +51,7 @@ const editViewer = ref | null>(null); // 回忆历史 const historyRecords = ref([]); const showHistory = ref(false); +const historyLoading = ref(false); // 解析标准导图 JSON 为树节点 const standardTree = computed(() => { @@ -250,6 +251,8 @@ const resetComparison = () => { hasCompared.value = false; focusPath.value = ""; recallTree.value = buildEmptyRecallTree(); + standardExpanded.value = true; + editingStandard.value = false; }; // 编辑标准导图 @@ -294,12 +297,19 @@ const cancelStandardEdit = () => { // 查看回忆历史 const loadHistory = async () => { + if (showHistory.value) { + showHistory.value = false; + return; + } + historyLoading.value = true; try { const res = await listRecallRecords(taskNum.value); historyRecords.value = res?.data || []; showHistory.value = true; } catch { ElMessage.error("加载历史记录失败"); + } finally { + historyLoading.value = false; } }; @@ -311,6 +321,8 @@ const selectHistoryRecord = (record: RecallRecord) => { const tree = parseOutlineToTree(record.recallContent); if (tree) recallTree.value = tree; hasCompared.value = true; + focusPath.value = record.focusPath || ""; + standardExpanded.value = true; } catch { ElMessage.error("解析对比记录失败"); } @@ -375,8 +387,8 @@ onMounted(() => { @@ -384,7 +396,7 @@ onMounted(() => {
复习起点 {{ focusPath }} - 重选节点 + 重选节点
@@ -420,9 +432,9 @@ onMounted(() => { -
+

回忆历史

-
+
{ ✅{{ record.matchedCount }} ❌{{ record.missedCount }} ➕{{ record.extraCount }}
+