Files
martial-admin-mini/mock/score.js
DevOps a3680f7d3e refactor: 裁判角色名称修改 - 裁判长→主裁判, 普通裁判→裁判员
- 修改pages目录下的Vue组件注释
- 修改api目录下的接口注释
- 修改mock目录下的模拟数据注释
- 修改utils/dataAdapter.js中的注释

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 11:37:50 +08:00

169 lines
3.7 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* Mock 数据 - 评分模块
* 模拟评分相关数据
*/
/**
* 获取扣分项列表
* @param {Object} params
* @param {String} params.projectId - 项目ID
* @returns {Object} 扣分项列表包装在records中与后端API格式一致
*/
export function getDeductions(params) {
// 模拟8个扣分项字段名与后端API保持一致
return {
records: [
{ id: '1', itemName: '动作不规范', deductionPoint: '0.1' },
{ id: '2', itemName: '节奏不稳', deductionPoint: '0.1' },
{ id: '3', itemName: '力度不足', deductionPoint: '0.1' },
{ id: '4', itemName: '平衡失误', deductionPoint: '0.1' },
{ id: '5', itemName: '器械掉落', deductionPoint: '0.2' },
{ id: '6', itemName: '出界', deductionPoint: '0.1' },
{ id: '7', itemName: '动作遗漏', deductionPoint: '0.2' },
{ id: '8', itemName: '其他失误', deductionPoint: '0.1' }
],
total: 8,
size: 100,
current: 1,
pages: 1
}
}
/**
* 提交评分
* @param {Object} params
* @param {String} params.athleteId - 选手ID
* @param {String} params.judgeId - 评委ID
* @param {Number} params.score - 评分
* @param {Array} params.deductions - 扣分项
* @param {String} params.note - 备注
* @returns {Object} 提交结果
*/
export function submitScore(params) {
const { athleteId, judgeId, score, deductions, note } = params
// 模拟提交成功
console.log('Mock提交评分:', {
athleteId,
judgeId,
score,
deductions: deductions.filter(d => d.checked).length + '项',
note
})
return {
scoreId: 'score_' + Date.now(),
athleteId,
judgeId,
score,
submitTime: new Date().toISOString(),
message: '评分提交成功'
}
}
/**
* 获取评分详情(主裁判查看)
* @param {Object} params
* @param {String} params.athleteId - 选手ID
* @returns {Object} 评分详情
*/
export function getScoreDetail(params) {
const { athleteId } = params
// 模拟选手信息和评委评分
return {
athleteInfo: {
athleteId,
name: '张三',
idCard: '123456789000000000',
team: '少林寺武术大学院',
number: '123-4567898275',
totalScore: 8.907
},
// 6位评委的评分
judgeScores: [
{
judgeId: '1',
judgeName: '欧阳丽娜',
score: 8.907,
scoreTime: '2025-06-25 09:15:00',
note: ''
},
{
judgeId: '2',
judgeName: '张三',
score: 8.901,
scoreTime: '2025-06-25 09:15:30',
note: ''
},
{
judgeId: '3',
judgeName: '裁判姓名',
score: 8.902,
scoreTime: '2025-06-25 09:16:00',
note: ''
},
{
judgeId: '4',
judgeName: '裁判姓名',
score: 8.907,
scoreTime: '2025-06-25 09:16:30',
note: ''
},
{
judgeId: '5',
judgeName: '裁判姓名',
score: 8.905,
scoreTime: '2025-06-25 09:17:00',
note: ''
},
{
judgeId: '6',
judgeName: '裁判姓名',
score: 8.904,
scoreTime: '2025-06-25 09:17:30',
note: ''
}
],
// 修改记录(如果有)
modification: null
}
}
/**
* 修改评分(主裁判)
* @param {Object} params
* @param {String} params.athleteId - 选手ID
* @param {String} params.modifierId - 修改人ID主裁判
* @param {Number} params.modifiedScore - 修改后的分数
* @param {String} params.note - 修改原因
* @returns {Object} 修改结果
*/
export function modifyScore(params) {
const { athleteId, modifierId, modifiedScore, note } = params
// 模拟修改成功
console.log('Mock修改评分:', {
athleteId,
modifierId,
originalScore: 8.907,
modifiedScore,
note
})
return {
athleteId,
originalScore: 8.907,
modifiedScore,
modifyTime: new Date().toISOString(),
message: '评分修改成功'
}
}
export default {
getDeductions,
submitScore,
getScoreDetail,
modifyScore
}