fix: 评审进度详情仅在全部评委评分后显示最终分
Made-with: Cursor
This commit is contained in:
parent
b8019ac4ee
commit
e054895c81
@ -21,7 +21,9 @@
|
|||||||
{{ contestType === 'team' ? '未提交作品队伍' : '未提交作品选手' }}
|
{{ contestType === 'team' ? '未提交作品队伍' : '未提交作品选手' }}
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button>
|
<a-button>
|
||||||
<template #icon><DownloadOutlined /></template>
|
<template #icon>
|
||||||
|
<DownloadOutlined />
|
||||||
|
</template>
|
||||||
导出
|
导出
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-space>
|
</a-space>
|
||||||
@ -31,29 +33,14 @@
|
|||||||
<!-- 搜索表单 -->
|
<!-- 搜索表单 -->
|
||||||
<a-form :model="searchParams" layout="inline" class="search-form" @finish="handleSearch">
|
<a-form :model="searchParams" layout="inline" class="search-form" @finish="handleSearch">
|
||||||
<a-form-item label="作品编号">
|
<a-form-item label="作品编号">
|
||||||
<a-input
|
<a-input v-model:value="searchParams.workNo" placeholder="请输入作品编号" allow-clear style="width: 150px" />
|
||||||
v-model:value="searchParams.workNo"
|
|
||||||
placeholder="请输入作品编号"
|
|
||||||
allow-clear
|
|
||||||
style="width: 150px"
|
|
||||||
/>
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="报名账号">
|
<a-form-item label="报名账号">
|
||||||
<a-input
|
<a-input v-model:value="searchParams.username" placeholder="请输入报名账号" allow-clear style="width: 150px" />
|
||||||
v-model:value="searchParams.username"
|
|
||||||
placeholder="请输入报名账号"
|
|
||||||
allow-clear
|
|
||||||
style="width: 150px"
|
|
||||||
/>
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="评审进度">
|
<a-form-item label="评审进度">
|
||||||
<a-select
|
<a-select v-model:value="searchParams.reviewProgress" placeholder="请选择评审进度" allow-clear style="width: 150px"
|
||||||
v-model:value="searchParams.reviewProgress"
|
@change="handleSearch">
|
||||||
placeholder="请选择评审进度"
|
|
||||||
allow-clear
|
|
||||||
style="width: 150px"
|
|
||||||
@change="handleSearch"
|
|
||||||
>
|
|
||||||
<a-select-option value="not_reviewed">未评审</a-select-option>
|
<a-select-option value="not_reviewed">未评审</a-select-option>
|
||||||
<a-select-option value="in_progress">评审中</a-select-option>
|
<a-select-option value="in_progress">评审中</a-select-option>
|
||||||
<a-select-option value="completed">已完成</a-select-option>
|
<a-select-option value="completed">已完成</a-select-option>
|
||||||
@ -61,25 +48,23 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<a-button type="primary" html-type="submit">
|
<a-button type="primary" html-type="submit">
|
||||||
<template #icon><SearchOutlined /></template>
|
<template #icon>
|
||||||
|
<SearchOutlined />
|
||||||
|
</template>
|
||||||
搜索
|
搜索
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button style="margin-left: 8px" @click="handleReset">
|
<a-button style="margin-left: 8px" @click="handleReset">
|
||||||
<template #icon><ReloadOutlined /></template>
|
<template #icon>
|
||||||
|
<ReloadOutlined />
|
||||||
|
</template>
|
||||||
重置
|
重置
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-form>
|
</a-form>
|
||||||
|
|
||||||
<!-- 数据表格 -->
|
<!-- 数据表格 -->
|
||||||
<a-table
|
<a-table :columns="columns" :data-source="dataSource" :loading="loading" :pagination="pagination" row-key="id"
|
||||||
:columns="columns"
|
@change="handleTableChange">
|
||||||
:data-source="dataSource"
|
|
||||||
:loading="loading"
|
|
||||||
:pagination="pagination"
|
|
||||||
row-key="id"
|
|
||||||
@change="handleTableChange"
|
|
||||||
>
|
|
||||||
<template #bodyCell="{ column, record, index }">
|
<template #bodyCell="{ column, record, index }">
|
||||||
<template v-if="column.key === 'index'">
|
<template v-if="column.key === 'index'">
|
||||||
{{ (pagination.current - 1) * pagination.pageSize + index + 1 }}
|
{{ (pagination.current - 1) * pagination.pageSize + index + 1 }}
|
||||||
@ -93,7 +78,7 @@
|
|||||||
{{ record.submitterAccountNo || record.registration?.user?.username || "-" }}
|
{{ record.submitterAccountNo || record.registration?.user?.username || "-" }}
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="column.key === 'judgeScore'">
|
<template v-else-if="column.key === 'judgeScore'">
|
||||||
{{ formatWorkJudgeScore(record) ?? "-" }}
|
{{ formatWorkJudgeScore(record) }}
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="column.key === 'reviewProgress'">
|
<template v-else-if="column.key === 'reviewProgress'">
|
||||||
<a-tag :color="getProgressColor(record)">
|
<a-tag :color="getProgressColor(record)">
|
||||||
@ -109,20 +94,9 @@
|
|||||||
</a-table>
|
</a-table>
|
||||||
|
|
||||||
<!-- 评审详情抽屉 -->
|
<!-- 评审详情抽屉 -->
|
||||||
<a-drawer
|
<a-drawer v-model:open="scoreDrawerVisible" title="评审详情" placement="right" width="700">
|
||||||
v-model:open="scoreDrawerVisible"
|
<a-table :columns="scoreColumns" :data-source="scoreList" :loading="scoreLoading" :pagination="false"
|
||||||
title="评审详情"
|
row-key="scoreId" size="small">
|
||||||
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 #bodyCell="{ column, record }">
|
||||||
<template v-if="column.key === 'judgeName'">
|
<template v-if="column.key === 'judgeName'">
|
||||||
{{
|
{{
|
||||||
@ -157,30 +131,16 @@
|
|||||||
</a-drawer>
|
</a-drawer>
|
||||||
|
|
||||||
<!-- 评委替换抽屉 -->
|
<!-- 评委替换抽屉 -->
|
||||||
<a-drawer
|
<a-drawer v-model:open="replaceJudgeDrawerVisible" title="评委替换" placement="right" width="700"
|
||||||
v-model:open="replaceJudgeDrawerVisible"
|
:footer-style="{ textAlign: 'right' }">
|
||||||
title="评委替换"
|
|
||||||
placement="right"
|
|
||||||
width="700"
|
|
||||||
:footer-style="{ textAlign: 'right' }"
|
|
||||||
>
|
|
||||||
<!-- 搜索 -->
|
<!-- 搜索 -->
|
||||||
<a-form layout="inline" class="mb-3">
|
<a-form layout="inline" class="mb-3">
|
||||||
<a-form-item label="姓名">
|
<a-form-item label="姓名">
|
||||||
<a-input
|
<a-input v-model:value="judgeSearchParams.nickname" placeholder="请输入姓名" allow-clear style="width: 150px" />
|
||||||
v-model:value="judgeSearchParams.nickname"
|
|
||||||
placeholder="请输入姓名"
|
|
||||||
allow-clear
|
|
||||||
style="width: 150px"
|
|
||||||
/>
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="机构信息">
|
<a-form-item label="机构信息">
|
||||||
<a-input
|
<a-input v-model:value="judgeSearchParams.tenantName" placeholder="请输入机构信息" allow-clear
|
||||||
v-model:value="judgeSearchParams.tenantName"
|
style="width: 150px" />
|
||||||
placeholder="请输入机构信息"
|
|
||||||
allow-clear
|
|
||||||
style="width: 150px"
|
|
||||||
/>
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<a-button type="primary" @click="handleSearchJudges">搜索</a-button>
|
<a-button type="primary" @click="handleSearchJudges">搜索</a-button>
|
||||||
@ -189,16 +149,9 @@
|
|||||||
</a-form>
|
</a-form>
|
||||||
|
|
||||||
<!-- 评委列表 -->
|
<!-- 评委列表 -->
|
||||||
<a-table
|
<a-table :columns="judgeSelectColumns" :data-source="judgeList" :loading="judgeListLoading"
|
||||||
:columns="judgeSelectColumns"
|
:pagination="judgePagination" :row-selection="judgeRowSelection" row-key="id" size="small"
|
||||||
:data-source="judgeList"
|
@change="handleJudgeTableChange">
|
||||||
:loading="judgeListLoading"
|
|
||||||
:pagination="judgePagination"
|
|
||||||
:row-selection="judgeRowSelection"
|
|
||||||
row-key="id"
|
|
||||||
size="small"
|
|
||||||
@change="handleJudgeTableChange"
|
|
||||||
>
|
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.key === 'judgeName'">
|
<template v-if="column.key === 'judgeName'">
|
||||||
{{ record.nickname || record.username || "-" }}
|
{{ record.nickname || record.username || "-" }}
|
||||||
@ -223,26 +176,13 @@
|
|||||||
</a-drawer>
|
</a-drawer>
|
||||||
|
|
||||||
<!-- 作品详情弹框 -->
|
<!-- 作品详情弹框 -->
|
||||||
<WorkDetailModal
|
<WorkDetailModal v-model:open="workDetailModalVisible" :work-id="currentWorkId" />
|
||||||
v-model:open="workDetailModalVisible"
|
|
||||||
:work-id="currentWorkId"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 未提交作品弹框 -->
|
<!-- 未提交作品弹框 -->
|
||||||
<a-modal
|
<a-modal v-model:open="notSubmittedModalVisible" :title="contestType === 'team' ? '未提交作品队伍' : '未提交作品选手'"
|
||||||
v-model:open="notSubmittedModalVisible"
|
width="700px" :footer="null">
|
||||||
:title="contestType === 'team' ? '未提交作品队伍' : '未提交作品选手'"
|
<a-table :columns="notSubmittedColumns" :data-source="notSubmittedList" :loading="notSubmittedLoading"
|
||||||
width="700px"
|
:pagination="false" row-key="id" size="small">
|
||||||
:footer="null"
|
|
||||||
>
|
|
||||||
<a-table
|
|
||||||
:columns="notSubmittedColumns"
|
|
||||||
:data-source="notSubmittedList"
|
|
||||||
:loading="notSubmittedLoading"
|
|
||||||
:pagination="false"
|
|
||||||
row-key="id"
|
|
||||||
size="small"
|
|
||||||
>
|
|
||||||
<template #bodyCell="{ column, record, index }">
|
<template #bodyCell="{ column, record, index }">
|
||||||
<template v-if="column.key === 'index'">
|
<template v-if="column.key === 'index'">
|
||||||
{{ index + 1 }}
|
{{ index + 1 }}
|
||||||
@ -406,10 +346,19 @@ const formatDate = (dateStr?: string) => {
|
|||||||
return dayjs(dateStr).format("YYYY-MM-DD HH:mm")
|
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
|
const v = record.finalScore ?? record.averageScore
|
||||||
if (v === undefined || v === null) return null
|
if (v === undefined || v === null) return "-"
|
||||||
return Number(v).toFixed(2)
|
return Number(v).toFixed(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user