feat(前端):AI 操作超时 + 加载提示

- axios 全局超时 5s → 180s(3 分钟),避免 AI 响应未到即断开
- 回忆对比按钮等待时显示旋转动画 + 已等待秒数 + 30s 后安抚文案
- 结束会话报告草稿生成时显示等待提示 + 秒数统计
This commit is contained in:
2026-07-04 16:16:33 +08:00
parent a259e0ac1a
commit 4e1c71e4d5
3 changed files with 65 additions and 1 deletions
+32
View File
@@ -20,6 +20,8 @@ const taskNum = computed(() => route.params.taskNum as string);
const loading = ref(false);
const standard = ref<StandardMindMap | null>(null);
const comparing = ref(false);
const comparingSeconds = ref(0);
let comparingTimer: ReturnType<typeof setInterval> | null = null;
const lastResult = ref<any>(null);
const hasCompared = ref(false);
@@ -139,6 +141,8 @@ const handleRecallCompare = async () => {
return;
}
comparing.value = true;
comparingSeconds.value = 0;
comparingTimer = setInterval(() => { comparingSeconds.value++; }, 1000);
try {
const res = await recallCompare(taskNum.value, outline);
standard.value = res?.data || null;
@@ -162,6 +166,7 @@ const handleRecallCompare = async () => {
ElMessage.error(e.message || "对比失败");
} finally {
comparing.value = false;
if (comparingTimer) { clearInterval(comparingTimer); comparingTimer = null; }
}
};
@@ -328,6 +333,10 @@ onMounted(() => {
清空重写
</el-button>
</div>
<p v-if="comparing" class="ai-waiting">
AI 正在对比分析中已等待 {{ comparingSeconds }}
<template v-if="comparingSeconds > 30">内容较多请耐心等待</template>
</p>
</div>
<p class="panel-hint">
凭记忆在导图上补全该任务的知识点选中节点后 Tab 加子节点Enter 加同级节点双击修改文字
@@ -530,6 +539,29 @@ onMounted(() => {
line-height: 1.5;
}
.ai-waiting {
font-size: 13px;
color: #e6a23c;
margin: 4px 0 0;
display: flex;
align-items: center;
gap: 6px;
}
.ai-waiting::before {
content: "";
width: 14px;
height: 14px;
border: 2px solid #f3d19e;
border-top-color: #e6a23c;
border-radius: 50%;
animation: spin 0.8s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
.standard-meta {
display: flex;
gap: 12px;