fix(schedule): 修复展开选手详情中的异常状态持久化API调用
- markPlayerAsException方法添加updateCheckInStatus API调用 - removePlayerException方法添加updateCheckInStatus API调用 - 添加编排完成状态检查
This commit is contained in:
@@ -530,6 +530,11 @@ export default {
|
|||||||
|
|
||||||
// 标记选手为异常
|
// 标记选手为异常
|
||||||
markPlayerAsException(group, team, playerIndex) {
|
markPlayerAsException(group, team, playerIndex) {
|
||||||
|
if (this.isScheduleCompleted) {
|
||||||
|
this.$message.warning('编排已完成,无法标记异常')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const player = team.players[playerIndex]
|
const player = team.players[playerIndex]
|
||||||
if (player) {
|
if (player) {
|
||||||
player.status = '异常'
|
player.status = '异常'
|
||||||
@@ -543,12 +548,23 @@ export default {
|
|||||||
playerName: player.playerName,
|
playerName: player.playerName,
|
||||||
status: '异常'
|
status: '异常'
|
||||||
})
|
})
|
||||||
this.$message.success('已标记为异常')
|
|
||||||
|
// 调用后端API保存状态
|
||||||
|
updateCheckInStatus(player.id, '异常').then(() => {
|
||||||
|
this.$message.success(`已将 ${player.playerName} 标记为异常`)
|
||||||
|
}).catch(err => {
|
||||||
|
console.error('保存异常状态失败:', err)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 取消选手异常状态
|
// 取消选手异常状态
|
||||||
removePlayerException(group, team, playerIndex) {
|
removePlayerException(group, team, playerIndex) {
|
||||||
|
if (this.isScheduleCompleted) {
|
||||||
|
this.$message.warning('编排已完成,无法取消异常')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const player = team.players[playerIndex]
|
const player = team.players[playerIndex]
|
||||||
if (player) {
|
if (player) {
|
||||||
player.status = '未签到'
|
player.status = '未签到'
|
||||||
@@ -559,7 +575,13 @@ export default {
|
|||||||
if (idx !== -1) {
|
if (idx !== -1) {
|
||||||
this.exceptionList.splice(idx, 1)
|
this.exceptionList.splice(idx, 1)
|
||||||
}
|
}
|
||||||
this.$message.success('已取消异常标记')
|
|
||||||
|
// 调用后端API恢复状态
|
||||||
|
updateCheckInStatus(player.id, '未签到').then(() => {
|
||||||
|
this.$message.success(`已将 ${player.playerName} 取消异常标记`)
|
||||||
|
}).catch(err => {
|
||||||
|
console.error('恢复状态失败:', err)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user