From c4a9cad1c50e89365e2a58b50e259af642ed3b8c Mon Sep 17 00:00:00 2001 From: Codex Assistant <codex@example.com> Date: 星期二, 07 十月 2025 16:12:20 +0800 Subject: [PATCH] feat(review): 调整评审详情展示顺序与样式,描述支持多行,项目信息列宽40/60 fix(auth): 登录页与首页循环跳转保护;api.ts 在登录页不再重定向;401分支在登录页不跳转 fix(router): /login 放行策略优化,避免死循环;评审列表跳转到 /project-review/:id/detail fix(frontend): 补齐 utils/appConfig.ts,避免启动白屏 fix(review): 详情页提交评分缺少stageId时回退使用项目详情的stageId feat(backend): ActivityPlayerDetailResponse.playerInfo 补充 avatarUrl/avatar,服务组装时填充用户头像 chore(dev): 启动脚本注入本地JWT密钥,重启前后端 --- web/src/views/review-detail.vue | 69 +++++++++++++++++++++++++++++----- 1 files changed, 58 insertions(+), 11 deletions(-) diff --git a/web/src/views/review-detail.vue b/web/src/views/review-detail.vue index e015e26..848948b 100644 --- a/web/src/views/review-detail.vue +++ b/web/src/views/review-detail.vue @@ -14,12 +14,15 @@ <div class="project-section"> <!-- 椤圭洰鍩烘湰淇℃伅 --> <h4>椤圭洰淇℃伅</h4> - <el-descriptions :column="2" border> - <el-descriptions-item label="椤圭洰鍚嶇О"> - {{ projectDetail.projectName || '鏈~鍐�' }} + <el-descriptions :column="2" border class="project-info"> + <el-descriptions-item label="姣旇禌鍚嶇О" :span="2"> + {{ competitionName || '鏈~鍐�' }} </el-descriptions-item> - <el-descriptions-item label="姣旇禌鍚嶇О"> - {{ projectDetail.activityName }} + <el-descriptions-item label="姣旇禌闃舵" :span="2"> + {{ stageName || projectDetail.activityName || '鏈~鍐�' }} + </el-descriptions-item> + <el-descriptions-item label="鍙傝禌椤圭洰鍚嶇О" :span="2"> + {{ projectDetail.projectName || '鏈~鍐�' }} </el-descriptions-item> <el-descriptions-item label="椤圭洰鎻忚堪" :span="2"> <div class="description-content"> @@ -183,7 +186,7 @@ import { useRoute, useRouter } from 'vue-router' import { ElMessage, ElMessageBox } from 'element-plus' import { Document, UserFilled } from '@element-plus/icons-vue' -import { getProjectDetail, getRatingStats, submitRating, getCurrentJudgeRating } from '@/api/projectReview' +import { getProjectDetail, getRatingStats, submitRating, getCurrentJudgeRating, getActiveActivities } from '@/api/projectReview' import { userApi } from '@/api/user' import { getUserInfo } from '@/utils/auth' @@ -195,6 +198,8 @@ const submitting = ref(false) const projectDetail = ref(null) const ratingStats = ref({ ratingCount: 0, averageScore: 0 }) +const competitionName = ref('') +const stageName = ref('') const ratingItems = ref([]) const ratingComment = ref('') const previewVisible = ref(false) @@ -211,7 +216,25 @@ // 璁$畻灞炴�� const projectId = computed(() => route.params.id) -const stageId = computed(() => route.query.stageId) +const stageId = computed(() => route.query.stageId || (projectDetail.value ? projectDetail.value.stageId : null)) + +const loadStageMeta = async () => { + try { + if (!projectDetail.value || !projectDetail.value.stageId) return + const stages = await getActiveActivities() + const stage = (stages || []).find(s => String(s.id) === String(projectDetail.value.stageId)) + if (stage) { + stageName.value = stage.name || '' + competitionName.value = stage.parent?.name || '' + } else { + stageName.value = projectDetail.value.activityName || '' + competitionName.value = '' + } + } catch (e) { + stageName.value = projectDetail.value?.activityName || '' + competitionName.value = '' + } +} // 鏉冮檺楠岃瘉鏂规硶 const checkPermissions = async () => { @@ -331,6 +354,7 @@ try { const data = await getProjectDetail(projectId.value) projectDetail.value = data + await loadStageMeta() // 鍒濆鍖栬瘎鍒嗛」 if (data.ratingForm && data.ratingForm.items) { @@ -373,12 +397,13 @@ return } - // 楠岃瘉stageId - if (!stageId.value) { + // 缁熶竴鑾峰彇stageId锛堜紭鍏堣矾鐢卞弬鏁帮紝鍏舵璇︽儏閲岀殑stageId锛� + const sid = stageId.value ? parseInt(stageId.value) : (projectDetail.value?.stageId ? parseInt(projectDetail.value.stageId) : null) + if (!sid) { ElMessage.error('缂哄皯姣旇禌闃舵淇℃伅锛岃閲嶆柊杩涘叆椤甸潰') return } - + // 楠岃瘉璇勫垎 const hasEmptyScore = ratingItems.value.some(item => item.score === 0 || item.score === null) if (hasEmptyScore) { @@ -397,7 +422,7 @@ const ratingData = { activityPlayerId: parseInt(projectId.value), - stageId: parseInt(stageId.value), + stageId: sid, ratings: ratingItems.value.map(item => ({ itemId: item.id, score: item.score @@ -518,6 +543,7 @@ .description-content { line-height: 1.6; color: #606266; + white-space: pre-wrap; } .attachments { @@ -685,4 +711,25 @@ :deep(.el-card__body) { padding: 16px; } + +/* 浠呴拡瀵归」鐩俊鎭繖缁勬弿杩拌缃爣绛�/鍐呭瀹藉害姣斾緥 */ +.project-info :deep(.el-descriptions__label) { + width: 40% !important; + min-width: 40%; + box-sizing: border-box; +} +.project-info :deep(.el-descriptions__content) { + width: 60% !important; + min-width: 60%; + box-sizing: border-box; +} + +/* 绐勫睆鑷�傚簲锛氬皬灞忔椂鍥為��涓轰笂涓嬬粨鏋� */ +@media (max-width: 768px) { + .project-info :deep(.el-descriptions__label), + .project-info :deep(.el-descriptions__content) { + width: 100% !important; + min-width: 100%; + } +} </style> \ No newline at end of file -- Gitblit v1.8.0