fix: 评审进度详情仅在全部评委评分后显示最终分

Made-with: Cursor
This commit is contained in:
zhonghua 2026-04-15 11:54:56 +08:00
parent b8019ac4ee
commit e054895c81

View File

@ -21,7 +21,9 @@
{{ contestType === 'team' ? '未提交作品队伍' : '未提交作品选手' }}
</a-button>
<a-button>
<template #icon><DownloadOutlined /></template>
<template #icon>
<DownloadOutlined />
</template>
导出
</a-button>
</a-space>
@ -31,29 +33,14 @@
<!-- 搜索表单 -->
<a-form :model="searchParams" layout="inline" class="search-form" @finish="handleSearch">
<a-form-item label="作品编号">
<a-input
v-model:value="searchParams.workNo"
placeholder="请输入作品编号"
allow-clear
style="width: 150px"
/>
<a-input v-model:value="searchParams.workNo" placeholder="请输入作品编号" allow-clear style="width: 150px" />
</a-form-item>
<a-form-item label="报名账号">
<a-input
v-model:value="searchParams.username"
placeholder="请输入报名账号"
allow-clear
style="width: 150px"
/>
<a-input v-model:value="searchParams.username" placeholder="请输入报名账号" allow-clear style="width: 150px" />
</a-form-item>
<a-form-item label="评审进度">
<a-select
v-model:value="searchParams.reviewProgress"
placeholder="请选择评审进度"
allow-clear
style="width: 150px"
@change="handleSearch"
>
<a-select v-model:value="searchParams.reviewProgress" placeholder="请选择评审进度" allow-clear style="width: 150px"
@change="handleSearch">
<a-select-option value="not_reviewed">未评审</a-select-option>
<a-select-option value="in_progress">评审中</a-select-option>
<a-select-option value="completed">已完成</a-select-option>
@ -61,25 +48,23 @@
</a-form-item>
<a-form-item>
<a-button type="primary" html-type="submit">
<template #icon><SearchOutlined /></template>
<template #icon>
<SearchOutlined />
</template>
搜索
</a-button>
<a-button style="margin-left: 8px" @click="handleReset">
<template #icon><ReloadOutlined /></template>
<template #icon>
<ReloadOutlined />
</template>
重置
</a-button>
</a-form-item>
</a-form>
<!-- 数据表格 -->
<a-table
:columns="columns"
:data-source="dataSource"
:loading="loading"
:pagination="pagination"
row-key="id"
@change="handleTableChange"
>
<a-table :columns="columns" :data-source="dataSource" :loading="loading" :pagination="pagination" row-key="id"
@change="handleTableChange">
<template #bodyCell="{ column, record, index }">
<template v-if="column.key === 'index'">
{{ (pagination.current - 1) * pagination.pageSize + index + 1 }}
@ -93,7 +78,7 @@
{{ record.submitterAccountNo || record.registration?.user?.username || "-" }}
</template>
<template v-else-if="column.key === 'judgeScore'">
{{ formatWorkJudgeScore(record) ?? "-" }}
{{ formatWorkJudgeScore(record) }}
</template>
<template v-else-if="column.key === 'reviewProgress'">
<a-tag :color="getProgressColor(record)">
@ -109,20 +94,9 @@
</a-table>
<!-- 评审详情抽屉 -->
<a-drawer
v-model:open="scoreDrawerVisible"
title="评审详情"
placement="right"
width="700"
>
<a-table
:columns="scoreColumns"
:data-source="scoreList"
:loading="scoreLoading"
:pagination="false"
row-key="scoreId"
size="small"
>
<a-drawer v-model:open="scoreDrawerVisible" title="评审详情" placement="right" width="700">
<a-table :columns="scoreColumns" :data-source="scoreList" :loading="scoreLoading" :pagination="false"
row-key="scoreId" size="small">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'judgeName'">
{{
@ -157,30 +131,16 @@
</a-drawer>
<!-- 评委替换抽屉 -->
<a-drawer
v-model:open="replaceJudgeDrawerVisible"
title="评委替换"
placement="right"
width="700"
:footer-style="{ textAlign: 'right' }"
>
<a-drawer v-model:open="replaceJudgeDrawerVisible" title="评委替换" placement="right" width="700"
:footer-style="{ textAlign: 'right' }">
<!-- 搜索 -->
<a-form layout="inline" class="mb-3">
<a-form-item label="姓名">
<a-input
v-model:value="judgeSearchParams.nickname"
placeholder="请输入姓名"
allow-clear
style="width: 150px"
/>
<a-input v-model:value="judgeSearchParams.nickname" placeholder="请输入姓名" allow-clear style="width: 150px" />
</a-form-item>
<a-form-item label="机构信息">
<a-input
v-model:value="judgeSearchParams.tenantName"
placeholder="请输入机构信息"
allow-clear
style="width: 150px"
/>
<a-input v-model:value="judgeSearchParams.tenantName" placeholder="请输入机构信息" allow-clear
style="width: 150px" />
</a-form-item>
<a-form-item>
<a-button type="primary" @click="handleSearchJudges">搜索</a-button>
@ -189,16 +149,9 @@
</a-form>
<!-- 评委列表 -->
<a-table
:columns="judgeSelectColumns"
:data-source="judgeList"
:loading="judgeListLoading"
:pagination="judgePagination"
:row-selection="judgeRowSelection"
row-key="id"
size="small"
@change="handleJudgeTableChange"
>
<a-table :columns="judgeSelectColumns" :data-source="judgeList" :loading="judgeListLoading"
:pagination="judgePagination" :row-selection="judgeRowSelection" row-key="id" size="small"
@change="handleJudgeTableChange">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'judgeName'">
{{ record.nickname || record.username || "-" }}
@ -223,26 +176,13 @@
</a-drawer>
<!-- 作品详情弹框 -->
<WorkDetailModal
v-model:open="workDetailModalVisible"
:work-id="currentWorkId"
/>
<WorkDetailModal v-model:open="workDetailModalVisible" :work-id="currentWorkId" />
<!-- 未提交作品弹框 -->
<a-modal
v-model:open="notSubmittedModalVisible"
:title="contestType === 'team' ? '未提交作品队伍' : '未提交作品选手'"
width="700px"
:footer="null"
>
<a-table
:columns="notSubmittedColumns"
:data-source="notSubmittedList"
:loading="notSubmittedLoading"
:pagination="false"
row-key="id"
size="small"
>
<a-modal v-model:open="notSubmittedModalVisible" :title="contestType === 'team' ? '未提交作品队伍' : '未提交作品选手'"
width="700px" :footer="null">
<a-table :columns="notSubmittedColumns" :data-source="notSubmittedList" :loading="notSubmittedLoading"
:pagination="false" row-key="id" size="small">
<template #bodyCell="{ column, record, index }">
<template v-if="column.key === 'index'">
{{ index + 1 }}
@ -406,10 +346,19 @@ const formatDate = (dateStr?: string) => {
return dayjs(dateStr).format("YYYY-MM-DD HH:mm")
}
/** 主表「评委评分」:列表接口优先返回 finalScore兼容 averageScore */
const formatWorkJudgeScore = (record: ContestWork): string | null => {
/** 与「已完成」评审进度一致:全部评委已评 */
const isAllJudgesScored = (record: ContestWork): boolean => {
const reviewed = record.reviewedCount ?? 0
const total = record.totalJudgesCount ?? 0
if (total <= 0) return false
return reviewed >= total
}
/** 主表「评委评分」:仅当所有评委评完后展示最终分;未出分前不显示数值(占位「-」) */
const formatWorkJudgeScore = (record: ContestWork): string => {
if (!isAllJudgesScored(record)) return "-"
const v = record.finalScore ?? record.averageScore
if (v === undefined || v === null) return null
if (v === undefined || v === null) return "-"
return Number(v).toFixed(2)
}
@ -694,21 +643,21 @@ $gradient-primary: linear-gradient(135deg, $primary 0%, $primary-dark 100%);
overflow: hidden;
.ant-table {
.ant-table-thead > tr > th {
.ant-table-thead>tr>th {
background: #fafafa;
font-weight: 600;
color: rgba(0, 0, 0, 0.85);
border-bottom: 1px solid #f0f0f0;
}
.ant-table-tbody > tr {
.ant-table-tbody>tr {
transition: all 0.2s ease;
&:hover > td {
&:hover>td {
background: rgba($primary, 0.04);
}
> td {
>td {
border-bottom: 1px solid #f5f5f5;
}
}