赛事报名

This commit is contained in:
马梓彭 2026-04-15 10:40:44 +08:00
parent 94a975a89e
commit d5358f8526
2 changed files with 47 additions and 58 deletions

View File

@ -147,24 +147,26 @@
</div> </div>
<div class="athlete-list-panel"> <div class="athlete-list-panel">
<ProTable ref="tableuu" :request-api="eventscorePageathletePost" <div v-loading="isScoreTableLoading" style="width: 100%; height: 100%;">
:columns="columnsScore" :pagination="true" :tool-button="false" :initParam="scoreQueryParam" toolButton <ProTable ref="tableuu" :request-api="eventscorePageathletePost"
preserve-expanded-content @selectionChange="selection"> :columns="columnsScore" :pagination="true" :tool-button="false" :initParam="scoreQueryParam" toolButton
<template #tools> preserve-expanded-content @selectionChange="selection">
<el-button v-auth="'event:add'" type="primary" :loading="importingScore" @click="inScore"> 导入成绩 </el-button> <template #tools>
<el-button v-auth="'event:add'" type="primary" @click="downloadTemplate"> 下载模板 </el-button> <el-button v-auth="'event:add'" type="primary" :loading="importingScore" @click="inScore"> 导入成绩 </el-button>
<el-button v-auth="'event:add'" type="primary" @click="openIssueCertificateDialog"> 发放证书 </el-button> <el-button v-auth="'event:add'" type="primary" @click="downloadTemplate"> 下载模板 </el-button>
<el-button v-auth="'event:add'" type="primary" @click="exportCertificate"> 导出证书 </el-button> <el-button v-auth="'event:add'" type="primary" @click="openIssueCertificateDialog"> 发放证书 </el-button>
<el-button v-auth="'event:add'" type="success" :loading="issuingPoints" @click="handleIssuePoints"> 发放积分 </el-button> <el-button v-auth="'event:add'" type="primary" @click="exportCertificate"> 导出证书 </el-button>
</template> <el-button v-auth="'event:add'" type="success" :loading="issuingPoints" @click="handleIssuePoints"> 发放积分 </el-button>
<template #index="scope"> </template>
{{ scope.$index + 1 }} <template #index="scope">
</template> {{ scope.$index + 1 }}
<template #action="scope"> </template>
<el-button size="small" text type="primary" @click="viewCertificate(scope.row.id)"> 查看证书 <template #action="scope">
</el-button> <el-button size="small" text type="primary" @click="viewCertificate(scope.row.id)"> 查看证书
</template> </el-button>
</ProTable> </template>
</ProTable>
</div>
</div> </div>
</div> </div>
@ -207,7 +209,7 @@
<el-option <el-option
v-for="template in certificateTemplateList" v-for="template in certificateTemplateList"
:key="template.id" :key="template.id"
:label="template.displayName || `模板 ${template.id} (v${template.version})`" :label="template.DisplayName || `模板 ${template.id} (v${template.version})`"
:value="template.id" :value="template.id"
/> />
</el-select> </el-select>
@ -788,21 +790,14 @@ const allSure = async () => {
//=================================成绩与证书================================== //=================================成绩与证书==================================
const user = ref('运动员') const user = ref('运动员')
// 加载状态
const isScoreTableLoading = ref(false)
// 监听用户切换,确保切换到运动员页面时刷新数据 // 监听用户切换,确保切换到运动员页面时刷新数据
watch(user, (newValue) => { watch(user, (newValue) => {
if (newValue === '运动员') { nextTick(() => {
nextTick(() => { refreshScoreTable()
refreshScoreTable() })
})
} else if (newValue === '教练') {
nextTick(() => {
refreshScoreTable()
})
} else if (newValue === '领队') {
nextTick(() => {
refreshScoreTable()
})
}
}) })
const columnsScore = ref([ const columnsScore = ref([
@ -848,6 +843,7 @@ const buildProjectGroupTree = (projects) => {
const projectNode = { const projectNode = {
nodeKey: `project-${project.id}`, nodeKey: `project-${project.id}`,
id: project.id, id: project.id,
projectId: project.id,
type: 'project', type: 'project',
label: project.name, label: project.name,
children: [] children: []
@ -858,6 +854,7 @@ const buildProjectGroupTree = (projects) => {
projectNode.children.push({ projectNode.children.push({
nodeKey: `group-${project.id}-${idx}`, nodeKey: `group-${project.id}-${idx}`,
id: project.id, id: project.id,
projectId: project.id,
type: 'group', type: 'group',
groupName: group.groupName, groupName: group.groupName,
label: group.groupName label: group.groupName
@ -874,7 +871,7 @@ const buildProjectGroupTree = (projects) => {
const handleTreeNodeClick = (data) => { const handleTreeNodeClick = (data) => {
selectedProjectGroup.value = data selectedProjectGroup.value = data
nextTick(() => { nextTick(() => {
tableuu.value?.getTableList?.() refreshScoreTable()
}) })
} }
@ -884,7 +881,7 @@ const resetSelectedGroup = () => {
projectGroupTreeRef.value.setCurrentKey(null) projectGroupTreeRef.value.setCurrentKey(null)
} }
nextTick(() => { nextTick(() => {
tableuu.value?.getTableList?.() refreshScoreTable()
}) })
} }
const columnsCoach = ref([ const columnsCoach = ref([
@ -927,17 +924,22 @@ const columnsLeader = ref([
]) ])
const refreshScoreTable = () => { const refreshScoreTable = () => {
if (user.value === '运动员') { isScoreTableLoading.value = true
tableuu.value?.getTableList?.(); nextTick(() => {
return; try {
} if (user.value === '运动员') {
if (user.value === '教练') { tableuu.value?.getTableList?.()
tableCoach.value?.getTableList?.(); } else if (user.value === '教练') {
return; tableCoach.value?.getTableList?.()
} } else if (user.value === '领队') {
if (user.value === '领队') { tableLeader.value?.getTableList?.()
tableLeader.value?.getTableList?.(); }
} } finally {
setTimeout(() => {
isScoreTableLoading.value = false
}, 500)
}
})
}; };
const inScore = () => { const inScore = () => {

View File

@ -300,19 +300,6 @@
<!-- 验证提示区域 --> <!-- 验证提示区域 -->
<div class="validation-notes-section"> <div class="validation-notes-section">
<!-- 验证加载中提示 -->
<el-alert
v-if="validationLoading"
title="正在验证队员信息..."
type="info"
:closable="false"
style="margin-bottom: 12px;"
>
<template #icon>
<el-icon class="is-loading"><Loading /></el-icon>
</template>
</el-alert>
<!-- 年龄性别不符合要求提示 --> <!-- 年龄性别不符合要求提示 -->
<el-alert <el-alert
v-if="hasAnyValidationErrors()" v-if="hasAnyValidationErrors()"