feat: 复习跳转改为先进入目标页

This commit is contained in:
2026-08-05 21:40:12 +08:00
parent 605495fd53
commit 4d9b3c0b02
5 changed files with 61 additions and 54 deletions
+14 -1
View File
@@ -2,6 +2,7 @@
import { ref, onMounted, computed } from "vue";
import { useRoute, useRouter } from "vue-router";
import {
findNode,
getStandardMindMap,
regenerateStandardMindMap,
recallCompare,
@@ -31,6 +32,7 @@ const hasCompared = ref(false);
// 起点节点选择
const focusPath = ref((route.query.focusPath as string) || "");
const focusContent = ref((route.query.focusContent as string) || "");
const focusConfirmVisible = ref(false);
const selectedNodeInfo = ref<{ title: string; path: string; childCount: number } | null>(null);
@@ -114,6 +116,17 @@ const loadData = async () => {
try {
const res = await getStandardMindMap(taskNum.value);
standard.value = res?.data || null;
if (focusContent.value && standard.value) {
try {
const nodeRes = await findNode(taskNum.value, focusContent.value.substring(0, 500));
const data = nodeRes?.data;
if (data?.path) {
focusPath.value = data.path;
}
} catch {
// 匹配失败时仍可进入回忆页
}
}
} catch (e: any) {
standard.value = null;
} finally {
@@ -382,7 +395,7 @@ onMounted(() => {
</script>
<template>
<section class="recall-page">
<section class="recall-page" v-loading="loading">
<!-- 顶部操作栏 -->
<div class="page-header">
<h2>回忆复习</h2>