84fe452e80
- MindMapViewer 新增 selectable 模式,点击节点 emit node-select 事件 - ReviewRecall.vue 移除会话选择器,改为节点选择交互 - 支持 URL ?focusPath= 参数自动预设复习起点 - 节点选择弹窗确认后回忆导图根节点=选中节点标题 - ReviewDetail 和 Welcome 中调用 findNode API 匹配节点后跳转 - API: recallCompare 使用 focusPath 替代 sessionNum - API: 新增 findNode 端点
78 lines
2.4 KiB
TypeScript
78 lines
2.4 KiB
TypeScript
import request from "@/utils/request";
|
|
import type { ReviewMindMap } from "./review";
|
|
|
|
// ============ 标准思维导图 ============
|
|
|
|
export interface StandardMindMap {
|
|
id: number;
|
|
taskNum: string;
|
|
title: string;
|
|
content: string;
|
|
outline: string;
|
|
summary: string;
|
|
generator: "BUILTIN" | "AI" | "USER" | "USER_MERGE";
|
|
generatorVersion?: string;
|
|
sourceReportCount: number;
|
|
sourceFragmentCount: number;
|
|
generatedTime?: string;
|
|
createdTime?: string;
|
|
lastModifiedTime?: string;
|
|
}
|
|
|
|
export interface RecallRecord {
|
|
id: number;
|
|
taskNum: string;
|
|
standardMapId: number;
|
|
focusPath?: string;
|
|
recallContent: string;
|
|
compareResult: string;
|
|
recallRatio: number;
|
|
matchedCount: number;
|
|
missedCount: number;
|
|
extraCount: number;
|
|
createdTime: string;
|
|
}
|
|
|
|
export interface FindNodeResult {
|
|
path: string;
|
|
nodeTitle: string;
|
|
score: number;
|
|
}
|
|
|
|
/** 获取/自动生成标准思维导图 */
|
|
export const getStandardMindMap = (taskNum: string) => {
|
|
return request.get(`/review/standard-mind-map/${taskNum}`);
|
|
};
|
|
|
|
/** 强制重新生成标准思维导图(全量或增量) */
|
|
export const regenerateStandardMindMap = (taskNum: string, mode: "full" | "incremental" = "full") => {
|
|
return request.post(`/review/standard-mind-map/${taskNum}/regenerate?mode=${mode}`);
|
|
};
|
|
|
|
/** 用户编辑标准思维导图(大纲文本) */
|
|
export const updateStandardMindMap = (taskNum: string, outline: string) => {
|
|
return request.put(`/review/standard-mind-map/${taskNum}`, { outline });
|
|
};
|
|
|
|
/** 用户提交回忆大纲,与标准导图对比(可选指定起始节点路径) */
|
|
export const recallCompare = (taskNum: string, recallOutline: string, focusPath?: string) => {
|
|
const body: Record<string, any> = { recallOutline };
|
|
if (focusPath) body.focusPath = focusPath;
|
|
return request.post(`/review/standard-mind-map/${taskNum}/recall`, body);
|
|
};
|
|
|
|
/** 在标准导图中查找与内容最匹配的节点 */
|
|
export const findNode = (taskNum: string, content: string) => {
|
|
return request.post(`/review/standard-mind-map/${taskNum}/find-node`, { content });
|
|
};
|
|
|
|
/** 获取该任务的所有回忆对比记录 */
|
|
export const listRecallRecords = (taskNum: string) => {
|
|
return request.get(`/review/standard-mind-map/${taskNum}/recall-records`);
|
|
};
|
|
|
|
/** 获取单条回忆对比记录 */
|
|
export const getRecallRecord = (recordId: number) => {
|
|
return request.get(`/review/standard-mind-map/recall-records/${recordId}`);
|
|
};
|