Skip to content

Commit 373e35d

Browse files
committed
feat: contest management
1 parent 7a27272 commit 373e35d

18 files changed

Lines changed: 7201 additions & 20 deletions

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"preview": "vite preview"
1010
},
1111
"devDependencies": {
12+
"@types/js-yaml": "^4.0.9",
1213
"@types/uuid": "^10.0.0",
1314
"terser": "^5.43.1",
1415
"typescript": "~5.7.3",
@@ -20,9 +21,11 @@
2021
"@types/node": "^24.3.0",
2122
"@vitejs/plugin-vue": "^5.2.3",
2223
"axios": "^1.8.4",
24+
"js-yaml": "^4.1.0",
2325
"sse.js": "^2.6.0",
2426
"uuid": "^11.1.0",
2527
"vue": "^3.5.13",
26-
"vue-router": "4"
28+
"vue-router": "4",
29+
"xlsx": "^0.18.5"
2730
}
2831
}

pnpm-lock.yaml

Lines changed: 96 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/tournament-config.yaml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# 蛇王争霸赛 2025年赛制配置
2+
tournament:
3+
name: "2025第九届蛇王争霸赛"
4+
date: "2025-09-03"
5+
time: "14:00"
6+
7+
stages:
8+
group_stage:
9+
name: "小组赛"
10+
description: "所有参赛选手随机分为10个小组,每组20人"
11+
start_time: "14:00"
12+
end_time: "15:20"
13+
groups:
14+
count: 10
15+
size: 20
16+
rounds: 2
17+
scoring:
18+
type: "rank_based"
19+
top_n: 8
20+
points: [8, 7, 6, 5, 4, 3, 2, 1] # 前8名得分
21+
outcomes:
22+
advance_to_finals:
23+
ranks: [1, 2] # 每组前2名直接晋级决赛
24+
destination: "finals"
25+
advance_to_playoffs:
26+
ranks: [3] # 每组第3名进入附加赛
27+
destination: "playoffs"
28+
award_merit:
29+
ranks: [4, 5, 6] # 第4-6名获得优胜奖
30+
award: "优胜奖"
31+
tiebreaker:
32+
- "total_score" # 优先比较总积分
33+
- "highest_raw_score" # 其次比较最高原始得分
34+
- "playoff_required" # 仍相同则需要加赛
35+
36+
playoffs:
37+
name: "附加赛"
38+
description: "小组赛各组第3名组成新的小组进行比赛"
39+
start_time: "15:20"
40+
end_time: "15:30"
41+
participants_from: "group_stage.advance_to_playoffs"
42+
rounds: 2
43+
scoring:
44+
type: "rank_based"
45+
top_n: 10 # 所有选手都有排名
46+
points: [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
47+
outcomes:
48+
award_third:
49+
ranks: [1, 2, 3, 4] # 前4名获得三等奖
50+
award: "三等奖"
51+
award_merit:
52+
ranks: [5, 6, 7, 8, 9, 10] # 其余选手获得优胜奖
53+
award: "优胜奖"
54+
tiebreaker:
55+
- "total_score"
56+
- "highest_raw_score"
57+
- "playoff_required"
58+
59+
finals:
60+
name: "决赛"
61+
description: "小组赛各组前2名合并为一组进行比赛"
62+
start_time: "15:30"
63+
end_time: "16:00"
64+
participants_from: "group_stage.advance_to_finals"
65+
rounds: 3
66+
scoring:
67+
type: "rank_based"
68+
top_n: 20 # 所有选手都有排名
69+
points: [20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
70+
outcomes:
71+
award_first:
72+
ranks: [1, 2, 3, 4] # 前4名获得一等奖
73+
award: "一等奖"
74+
award_second:
75+
ranks: [5, 6, 7, 8, 9, 10, 11, 12] # 第5-12名获得二等奖
76+
award: "二等奖"
77+
award_third:
78+
ranks: [13, 14, 15, 16, 17, 18, 19, 20] # 第13-20名获得三等奖
79+
award: "三等奖"
80+
tiebreaker:
81+
- "total_score"
82+
- "highest_raw_score"
83+
- "playoff_required"
84+
85+
# 比赛显示配置
86+
display:
87+
show_participant_list_before_match: true
88+
show_realtime_scores: false # 不显示实时分数,只在结束后显示
89+
announcement_duration: 5 # 公告显示时长(秒)

src/components/TopAppBar.vue

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const avatarId = computed(() => state.user?.avatarId || 0);
6868
// 根据路由判断是否显示顶部导航栏
6969
const shouldShowAppBar = computed(() => {
7070
// 登录、注册等页面不显示顶部导航栏
71-
const hiddenRoutes = ['/login', '/register', '/oauth-callback'];
71+
const hiddenRoutes = ['/login', '/register', '/oauth-callback', '/tournament/display'];
7272
return !hiddenRoutes.includes(route.path);
7373
});
7474
@@ -85,14 +85,14 @@ const defaultAvatarId = ref(1); // 默认值为1
8585
8686
// 获取默认头像ID
8787
const fetchDefaultAvatarId = async () => {
88-
try {
89-
const response = await avatarService.getDefaultAvatarId();
90-
if (response.data && response.data.avatarId) {
91-
defaultAvatarId.value = response.data.avatarId;
92-
}
93-
} catch (err) {
94-
console.error('获取默认头像ID失败:', err);
95-
}
88+
// try {
89+
// const response = await avatarService.getDefaultAvatarId();
90+
// if (response.data && response.data.avatarId) {
91+
// defaultAvatarId.value = response.data.avatarId;
92+
// }
93+
// } catch (err) {
94+
// console.error('获取默认头像ID失败:', err);
95+
// }
9696
};
9797
9898
// 获取头像URL

0 commit comments

Comments
 (0)