feat: add estimated duration field and exception status persistence
- Add estimatedDuration field to project form with validation - Add estimatedDuration column to project table - Add updateCheckInStatus API for exception status persistence - Call backend API when marking/removing exception status
This commit is contained in:
@@ -194,3 +194,16 @@ export const exportSchedulePlans = (params) => {
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新参赛者签到状态
|
||||
* @param {Number} participantId - 参赛者ID
|
||||
* @param {String} status - 状态:未签到/已签到/异常
|
||||
*/
|
||||
export const updateCheckInStatus = (participantId, status) => {
|
||||
return request({
|
||||
url: '/api/blade-martial/schedule/update-check-in-status',
|
||||
method: 'post',
|
||||
data: { participantId, status }
|
||||
})
|
||||
}
|
||||
|
||||
@@ -177,6 +177,11 @@
|
||||
<span v-else style="color: #909399">未设置</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="estimatedDuration" label="预计时长" width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<span>{{ row.estimatedDuration || 5 }}分钟</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="报名人数" width="120" align="center">
|
||||
<template #default="{ row }">
|
||||
<span :style="{ color: row.currentCount >= row.maxParticipants ? '#f56c6c' : '#67c23a' }">
|
||||
@@ -320,6 +325,17 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="预计时长(分钟)" prop="estimatedDuration">
|
||||
<el-input-number
|
||||
v-model="form.estimatedDuration"
|
||||
:min="1"
|
||||
:max="120"
|
||||
placeholder="每人/队预计比赛时长"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报名费(元)" prop="registrationFee">
|
||||
<el-input-number
|
||||
@@ -529,6 +545,7 @@ const form = reactive({
|
||||
category: null,
|
||||
eventType: null,
|
||||
type: null,
|
||||
estimatedDuration: 5,
|
||||
registrationFee: 0,
|
||||
registrationStartTime: '',
|
||||
registrationEndTime: '',
|
||||
@@ -567,6 +584,9 @@ const rules = {
|
||||
eventType: [
|
||||
{ required: true, message: '请选择项目类型', trigger: 'change' }
|
||||
],
|
||||
estimatedDuration: [
|
||||
{ required: true, message: '请输入预计时长', trigger: 'blur' }
|
||||
],
|
||||
type: [
|
||||
{ required: true, message: '请选择参赛类型', trigger: 'change' }
|
||||
],
|
||||
@@ -771,6 +791,7 @@ const resetForm = () => {
|
||||
category: null,
|
||||
eventType: null,
|
||||
type: null,
|
||||
estimatedDuration: 5,
|
||||
registrationFee: 0,
|
||||
registrationStartTime: '',
|
||||
registrationEndTime: '',
|
||||
|
||||
@@ -381,6 +381,7 @@ import { ArrowDown, ArrowRight } from '@element-plus/icons-vue'
|
||||
import { getVenuesByCompetition } from '@/api/martial/venue'
|
||||
import { getCompetitionDetail } from '@/api/martial/competition'
|
||||
import { getScheduleResult, saveAndLockSchedule, saveDraftSchedule, triggerAutoArrange, moveScheduleGroup, exportSchedule } from '@/api/martial/activitySchedule'
|
||||
import { updateCheckInStatus } from '@/api/martial/schedulePlan'
|
||||
|
||||
export default {
|
||||
name: 'MartialScheduleList',
|
||||
@@ -737,7 +738,12 @@ export default {
|
||||
status: '异常'
|
||||
})
|
||||
|
||||
this.$message.success(`已将 ${player.playerName} 标记为异常`)
|
||||
// 调用后端API保存状态
|
||||
updateCheckInStatus(player.id, '异常').then(() => {
|
||||
this.$message.success(`已将 ${player.playerName} 标记为异常`)
|
||||
}).catch(err => {
|
||||
console.error('保存异常状态失败:', err)
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
@@ -993,7 +999,12 @@ export default {
|
||||
status: '异常'
|
||||
})
|
||||
|
||||
this.$message.success(`已将 ${item.schoolUnit} 标记为异常`)
|
||||
// 调用后端API保存状态
|
||||
updateCheckInStatus(item.id, '异常').then(() => {
|
||||
this.$message.success(`已将 ${item.schoolUnit} 标记为异常`)
|
||||
}).catch(err => {
|
||||
console.error('保存异常状态失败:', err)
|
||||
})
|
||||
},
|
||||
|
||||
// 显示异常组对话框
|
||||
@@ -1020,7 +1031,12 @@ export default {
|
||||
|
||||
// 从异常列表中移除
|
||||
this.exceptionList.splice(index, 1)
|
||||
this.$message.success(`已将 ${exceptionItem.schoolUnit} 从异常组移除`)
|
||||
// 调用后端API恢复状态
|
||||
updateCheckInStatus(exceptionItem.participantId, '未签到').then(() => {
|
||||
this.$message.success(`已将 ${exceptionItem.schoolUnit} 从异常组移除`)
|
||||
}).catch(err => {
|
||||
console.error('恢复状态失败:', err)
|
||||
})
|
||||
},
|
||||
|
||||
// 触发自动编排
|
||||
|
||||
Reference in New Issue
Block a user