From 9c2c1b7614c2b9a6ffcd12113005e7499bd9833e Mon Sep 17 00:00:00 2001 From: cat_shark <1716967236@qq.com> Date: Sat, 4 Jul 2026 17:38:00 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=89=8D=E7=AB=AF)=EF=BC=9A=E8=BF=9B?= =?UTF-8?q?=E5=BA=A6=E7=8E=AF=E6=96=B9=E5=90=91=20+=20=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=20+=20=E5=88=A0=E9=99=A4=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=20+=20=E7=A7=BB=E9=99=A4=20console.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - StartTask.vue:progress 计算改为 (total-current)/total*100,进度环从 满到空递减(正确方向) - ReviewDetail/ReviewRecall/MindMapViewer:type="primary" 全部改为 type="success",统一绿白主题 - Study.vue:删除任务增加 ElMessageBox.confirm 确认 - request.ts:移除全部 console.log --- src/components/ReviewDetail.vue | 4 ++-- src/components/ReviewRecall.vue | 6 +++--- src/components/StartTask.vue | 3 ++- src/components/Study.vue | 11 ++++++++++- src/utils/request.ts | 5 ----- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/components/ReviewDetail.vue b/src/components/ReviewDetail.vue index 8ad3c7d..3769df1 100644 --- a/src/components/ReviewDetail.vue +++ b/src/components/ReviewDetail.vue @@ -295,7 +295,7 @@ watch( />
取消 - 保存 + 保存
@@ -328,7 +328,7 @@ watch( > 上传导图文件 - + 回忆复习 diff --git a/src/components/ReviewRecall.vue b/src/components/ReviewRecall.vue index 3d91db8..be86289 100644 --- a/src/components/ReviewRecall.vue +++ b/src/components/ReviewRecall.vue @@ -328,7 +328,7 @@ onMounted(() => {

🧠 你的回忆

- + 提交对比 @@ -389,7 +389,7 @@ onMounted(() => {
- + 生成 @@ -400,7 +400,7 @@ onMounted(() => {
取消 - + 保存更新
diff --git a/src/components/StartTask.vue b/src/components/StartTask.vue index 39194b1..0738de7 100644 --- a/src/components/StartTask.vue +++ b/src/components/StartTask.vue @@ -81,7 +81,8 @@ const breakAudio = new Audio('/resource/notification.mp3'); const progress = computed(() => { const total = isBreak.value ? 5 * 60 : 25 * 60; - return ((timerMinutes.value * 60 + timerSeconds.value) / total) * 100; + const current = timerMinutes.value * 60 + timerSeconds.value; + return ((total - current) / total) * 100; }); const nowTimestamp = ref(Date.now()); diff --git a/src/components/Study.vue b/src/components/Study.vue index a90e947..c5efcb0 100644 --- a/src/components/Study.vue +++ b/src/components/Study.vue @@ -2,7 +2,7 @@ import { computed, onMounted, ref, watch } from "vue"; import request from "@/utils/request"; import router from "@/router"; -import { ElMessage } from "element-plus"; +import { ElMessage, ElMessageBox } from "element-plus"; import { getReviewTaskStatsByTask } from "@/api/review"; import { getPriorityWeights, @@ -185,6 +185,15 @@ const removeTask = async () => { return; } const target = selectedTask.value; + try { + await ElMessageBox.confirm(`确定删除任务「${target.title}」?关联的学习会话、学习报告、应用场景等数据将被一并删除。`, "确认删除", { + confirmButtonText: "确定删除", + cancelButtonText: "取消", + type: "warning", + }); + } catch { + return; // 用户取消 + } const res = await request.del(`/tasks/${target.taskId}`, {}); if (res.code === 200) { ElMessage.success(`任务 ${target.title} 删除成功`); diff --git a/src/utils/request.ts b/src/utils/request.ts index 37713f3..8dbd50f 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -11,7 +11,6 @@ const axiosInstance = axios.create({ }); const handleError = (error: any) => { - console.log(error); // 401 未授权:token 过期或未登录,直接跳转登录页 if (error?.response?.status === 401) { @@ -49,14 +48,12 @@ function get(url: string, params: Record): Promise; function get(url: string): Promise; function get(url: string, params: Record = {}) { - console.log("开始GET请求", basic_url + url, "参数:", params); return axiosInstance.get(url, { params }) .then(validateResponse) .catch(handleError); } const post = (url: string, data: any = null, config: any = {}) => { - console.log("开始POST请求", url, "参数:", data, "配置:", config); if (config.params) { // 如果传入 config.params,则作为 URL 参数 @@ -72,14 +69,12 @@ const post = (url: string, data: any = null, config: any = {}) => { }; const put = (url: string, data: any, config: any = {}) => { - console.log("开始PUT请求", basic_url + url, "参数:", data); return axiosInstance.put(url, data, config) .then(validateResponse) .catch(handleError); }; const del = (url: string, params: Record = {}, config: any = {}) => { - console.log("开始DELETE请求", basic_url + url, "参数:", params); return axiosInstance.delete(url, { params, ...config }) .then(validateResponse) .catch(handleError);