From c61b368233c19882ba95c6137df4693faad6f3fc Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 17 Jan 2026 09:31:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BB=BB=E5=8A=A1=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E4=B8=AD=E9=99=84=E4=BB=B6=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E9=9C=80=E6=8A=A2=E5=8D=95=E5=90=8E=E6=89=8D=E8=83=BD=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/TaskHall.vue | 49 +++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/frontend/src/views/TaskHall.vue b/frontend/src/views/TaskHall.vue index d8e1466..2418a5f 100644 --- a/frontend/src/views/TaskHall.vue +++ b/frontend/src/views/TaskHall.vue @@ -2340,14 +2340,22 @@

附件

@@ -3347,6 +3355,20 @@ const isHighScoreTask = (task: TaskOrSubTask) => { return task.score && task.score >= 500 } +// 判断是否可以下载附件(非pending状态或管理员可下载) +const canDownloadAttachment = (task: TaskOrSubTask) => { + // 管理员可以下载 + const userInfo = JSON.parse(localStorage.getItem('userInfo') || '{}') + if (userInfo.isAdmin === 1 || userInfo.isAdmin === true) { + return true + } + // 非pending状态可以下载(已接单、进行中、已完成等) + if (task.status !== 'pending') { + return true + } + return false +} + // 加载配置数据(从全局store加载) const loadConfigs = async () => { try { @@ -7044,6 +7066,17 @@ onUnmounted(() => { color: #31f08b; } } + + .attachment-locked-notice { + display: inline-flex; + align-items: center; + padding: $space-sm $space-md; + background: rgba(255, 255, 255, 0.05); + border: 1px dashed rgba(255, 255, 255, 0.15); + border-radius: $radius-md; + color: #888; + font-size: 13px; + } } // 分页