fix(前端):进度环方向 + 按钮颜色 + 删除确认 + 移除 console.log

- StartTask.vue:progress 计算改为 (total-current)/total*100,进度环从
  满到空递减(正确方向)
- ReviewDetail/ReviewRecall/MindMapViewer:type="primary" 全部改为
  type="success",统一绿白主题
- Study.vue:删除任务增加 ElMessageBox.confirm 确认
- request.ts:移除全部 console.log
This commit is contained in:
2026-07-04 17:38:00 +08:00
parent 89d186c82e
commit 9c2c1b7614
5 changed files with 17 additions and 12 deletions
+2 -2
View File
@@ -295,7 +295,7 @@ watch(
/> />
<div class="edit-actions"> <div class="edit-actions">
<el-button @click="cancelEdit">取消</el-button> <el-button @click="cancelEdit">取消</el-button>
<el-button type="primary" :loading="saving" @click="saveEdit">保存</el-button> <el-button type="success" :loading="saving" @click="saveEdit">保存</el-button>
</div> </div>
</div> </div>
<!-- 只读模式 --> <!-- 只读模式 -->
@@ -328,7 +328,7 @@ watch(
> >
<el-button type="success" :loading="mindMapUploading">上传导图文件</el-button> <el-button type="success" :loading="mindMapUploading">上传导图文件</el-button>
</el-upload> </el-upload>
<el-button type="primary" size="small" @click="router.push(`/review/recall/${taskNum}`)"> <el-button type="success" size="small" @click="router.push(`/review/recall/${taskNum}`)">
回忆复习 回忆复习
</el-button> </el-button>
<el-tag v-if="mindMap?.fileFormat" size="small" effect="plain"> <el-tag v-if="mindMap?.fileFormat" size="small" effect="plain">
+3 -3
View File
@@ -328,7 +328,7 @@ onMounted(() => {
<div class="panel-header"> <div class="panel-header">
<h3>🧠 你的回忆</h3> <h3>🧠 你的回忆</h3>
<div class="panel-actions"> <div class="panel-actions">
<el-button type="primary" :loading="comparing" @click="handleRecallCompare"> <el-button type="success" :loading="comparing" @click="handleRecallCompare">
提交对比 提交对比
</el-button> </el-button>
<el-button v-if="hasCompared" @click="resetRecall"> <el-button v-if="hasCompared" @click="resetRecall">
@@ -389,7 +389,7 @@ onMounted(() => {
<div v-if="!standard" class="empty-state"> <div v-if="!standard" class="empty-state">
<el-empty description="暂无标准思维导图" :image-size="64"> <el-empty description="暂无标准思维导图" :image-size="64">
<el-button type="primary" :loading="loading" @click="loadData"> <el-button type="success" :loading="loading" @click="loadData">
生成 生成
</el-button> </el-button>
</el-empty> </el-empty>
@@ -400,7 +400,7 @@ onMounted(() => {
<MindMapViewer ref="editViewer" :tree="standardTree" :editable="true" height="60vh" /> <MindMapViewer ref="editViewer" :tree="standardTree" :editable="true" height="60vh" />
<div class="edit-actions"> <div class="edit-actions">
<el-button @click="cancelStandardEdit">取消</el-button> <el-button @click="cancelStandardEdit">取消</el-button>
<el-button type="primary" :loading="savingStandard" @click="saveStandardEditFromViewer"> <el-button type="success" :loading="savingStandard" @click="saveStandardEditFromViewer">
保存更新 保存更新
</el-button> </el-button>
</div> </div>
+2 -1
View File
@@ -81,7 +81,8 @@ const breakAudio = new Audio('/resource/notification.mp3');
const progress = computed(() => { const progress = computed(() => {
const total = isBreak.value ? 5 * 60 : 25 * 60; 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()); const nowTimestamp = ref(Date.now());
+10 -1
View File
@@ -2,7 +2,7 @@
import { computed, onMounted, ref, watch } from "vue"; import { computed, onMounted, ref, watch } from "vue";
import request from "@/utils/request"; import request from "@/utils/request";
import router from "@/router"; import router from "@/router";
import { ElMessage } from "element-plus"; import { ElMessage, ElMessageBox } from "element-plus";
import { getReviewTaskStatsByTask } from "@/api/review"; import { getReviewTaskStatsByTask } from "@/api/review";
import { import {
getPriorityWeights, getPriorityWeights,
@@ -185,6 +185,15 @@ const removeTask = async () => {
return; return;
} }
const target = selectedTask.value; const target = selectedTask.value;
try {
await ElMessageBox.confirm(`确定删除任务「${target.title}」?关联的学习会话、学习报告、应用场景等数据将被一并删除。`, "确认删除", {
confirmButtonText: "确定删除",
cancelButtonText: "取消",
type: "warning",
});
} catch {
return; // 用户取消
}
const res = await request.del(`/tasks/${target.taskId}`, {}); const res = await request.del(`/tasks/${target.taskId}`, {});
if (res.code === 200) { if (res.code === 200) {
ElMessage.success(`任务 ${target.title} 删除成功`); ElMessage.success(`任务 ${target.title} 删除成功`);
-5
View File
@@ -11,7 +11,6 @@ const axiosInstance = axios.create({
}); });
const handleError = (error: any) => { const handleError = (error: any) => {
console.log(error);
// 401 未授权:token 过期或未登录,直接跳转登录页 // 401 未授权:token 过期或未登录,直接跳转登录页
if (error?.response?.status === 401) { if (error?.response?.status === 401) {
@@ -49,14 +48,12 @@ function get(url: string, params: Record<string, any>): Promise<any>;
function get(url: string): Promise<any>; function get(url: string): Promise<any>;
function get(url: string, params: Record<string, any> = {}) { function get(url: string, params: Record<string, any> = {}) {
console.log("开始GET请求", basic_url + url, "参数:", params);
return axiosInstance.get(url, { params }) return axiosInstance.get(url, { params })
.then(validateResponse) .then(validateResponse)
.catch(handleError); .catch(handleError);
} }
const post = (url: string, data: any = null, config: any = {}) => { const post = (url: string, data: any = null, config: any = {}) => {
console.log("开始POST请求", url, "参数:", data, "配置:", config);
if (config.params) { if (config.params) {
// 如果传入 config.params,则作为 URL 参数 // 如果传入 config.params,则作为 URL 参数
@@ -72,14 +69,12 @@ const post = (url: string, data: any = null, config: any = {}) => {
}; };
const put = (url: string, data: any, config: any = {}) => { const put = (url: string, data: any, config: any = {}) => {
console.log("开始PUT请求", basic_url + url, "参数:", data);
return axiosInstance.put(url, data, config) return axiosInstance.put(url, data, config)
.then(validateResponse) .then(validateResponse)
.catch(handleError); .catch(handleError);
}; };
const del = (url: string, params: Record<string, any> = {}, config: any = {}) => { const del = (url: string, params: Record<string, any> = {}, config: any = {}) => {
console.log("开始DELETE请求", basic_url + url, "参数:", params);
return axiosInstance.delete(url, { params, ...config }) return axiosInstance.delete(url, { params, ...config })
.then(validateResponse) .then(validateResponse)
.catch(handleError); .catch(handleError);