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; + } } // 分页