style: 成果详情三步操作按钮按当前步骤高亮主色

Made-with: Cursor
This commit is contained in:
zhonghua 2026-04-16 17:19:09 +08:00
parent aca472aa54
commit eed14d87c8

View File

@ -56,15 +56,34 @@
<!-- 操作步骤未发布时显示 --> <!-- 操作步骤未发布时显示 -->
<div v-if="!isSuperAdmin && contestInfo?.resultState !== 'published'" class="action-bar"> <div v-if="!isSuperAdmin && contestInfo?.resultState !== 'published'" class="action-bar">
<a-space> <a-space>
<a-button @click="handleCalculateScores" :loading="calcScoreLoading"> <a-button
:type="activeWorkflowStep === 1 ? 'primary' : 'default'"
class="action-step-btn"
:class="{ 'action-step-btn--current': activeWorkflowStep === 1 }"
@click="handleCalculateScores"
:loading="calcScoreLoading"
>
<template #icon><calculator-outlined /></template> <template #icon><calculator-outlined /></template>
第一步计算得分 第一步计算得分
</a-button> </a-button>
<a-button @click="handleCalculateRankings" :loading="calcRankLoading" :disabled="summary.scoredWorks === 0"> <a-button
:type="activeWorkflowStep === 2 ? 'primary' : 'default'"
class="action-step-btn"
:class="{ 'action-step-btn--current': activeWorkflowStep === 2 }"
@click="handleCalculateRankings"
:loading="calcRankLoading"
:disabled="summary.scoredWorks === 0"
>
<template #icon><ordered-list-outlined /></template> <template #icon><ordered-list-outlined /></template>
第二步计算排名 第二步计算排名
</a-button> </a-button>
<a-button @click="autoAwardVisible = true" :disabled="summary.rankedWorks === 0"> <a-button
:type="activeWorkflowStep === 3 ? 'primary' : 'default'"
class="action-step-btn"
:class="{ 'action-step-btn--current': activeWorkflowStep === 3 }"
@click="autoAwardVisible = true"
:disabled="summary.rankedWorks === 0"
>
<template #icon><trophy-outlined /></template> <template #icon><trophy-outlined /></template>
第三步设置奖项 第三步设置奖项
</a-button> </a-button>
@ -251,6 +270,15 @@ const showResultsList = computed(() => {
return summary.value.scoredWorks > 0 return summary.value.scoredWorks > 0
}) })
/** 成果流程当前步骤1 计算得分 → 2 计算排名 → 3 设置奖项0 表示前三步已齐(可发布或维护) */
const activeWorkflowStep = computed(() => {
const { scoredWorks, rankedWorks, awardedWorks } = summary.value
if (scoredWorks === 0) return 1
if (rankedWorks === 0) return 2
if (awardedWorks < rankedWorks) return 3
return 0
})
// //
const awardFilterOptions = computed(() => { const awardFilterOptions = computed(() => {
const names = new Set<string>() const names = new Set<string>()
@ -526,6 +554,11 @@ $primary: #6366f1;
border: 1px dashed rgba($primary, 0.15); border: 1px dashed rgba($primary, 0.15);
border-radius: 12px; border-radius: 12px;
margin-bottom: 16px; margin-bottom: 16px;
:deep(.action-step-btn--current.ant-btn-primary:not(:disabled)) {
font-weight: 600;
box-shadow: 0 2px 10px rgba($primary, 0.42);
}
} }
.step-guide-card { .step-guide-card {