From 280e360506f602289f64db9b628431c775b53c4b Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Thu, 6 Aug 2026 08:25:53 -0600 Subject: [PATCH] fix --- src/admin/api.ts | 6 -- src/admin/problem/list.vue | 22 ++++- src/admin/reaction/list.vue | 96 ---------------------- src/oj/problem/composables/useFireworks.ts | 81 ++++++++++-------- src/routes.ts | 6 -- src/shared/layout/admin.vue | 9 -- src/utils/types.ts | 9 +- 7 files changed, 70 insertions(+), 159 deletions(-) delete mode 100644 src/admin/reaction/list.vue diff --git a/src/admin/api.ts b/src/admin/api.ts index 07a28ff..9a32961 100644 --- a/src/admin/api.ts +++ b/src/admin/api.ts @@ -287,12 +287,6 @@ export function createAnnouncement(announcement: AnnouncementEdit) { return http.post("admin/announcement", announcement) } -export function getReactionStats(offset = 0, limit = 10, problem: string) { - return http.get("admin/reaction", { - params: { offset, limit, problem }, - }) -} - export async function getTutorialList() { const res = await http.get("admin/tutorial") return res.data diff --git a/src/admin/problem/list.vue b/src/admin/problem/list.vue index 0dd98ee..94161a8 100644 --- a/src/admin/problem/list.vue +++ b/src/admin/problem/list.vue @@ -1,11 +1,11 @@ - - diff --git a/src/oj/problem/composables/useFireworks.ts b/src/oj/problem/composables/useFireworks.ts index 3170e05..8da2e86 100644 --- a/src/oj/problem/composables/useFireworks.ts +++ b/src/oj/problem/composables/useFireworks.ts @@ -138,6 +138,7 @@ export function useFireworks() { confetti({ particleCount: 12, + angle: 270, spread: 100, startVelocity: 12, gravity: 0.6, @@ -145,7 +146,7 @@ export function useFireworks() { ticks: 200, scalar: 1.2, shapes: ["star"], - origin: { x: Math.random(), y: -0.1 }, + origin: { x: Math.random(), y: 0 }, colors: ["#FFD700", "#FFA500", "#FFFF00", "#FF69B4", "#00CED1"], }) }, 150) @@ -285,29 +286,32 @@ export function useFireworks() { // 效果7: 螺旋上升 () => { - const defaults = { - spread: 360, - ticks: 100, - gravity: 0, - decay: 0.94, - startVelocity: 30, - } + const steps = 16 + const colors = ["#a864fd", "#29cdff", "#78ff44", "#ff718d", "#fdff6a"] - function shoot() { - confetti({ - ...defaults, - particleCount: 50, - scalar: 1.2, - shapes: ["circle", "square"], - colors: ["#a864fd", "#29cdff", "#78ff44", "#ff718d", "#fdff6a"], - }) - } + for (let step = 0; step < steps; step++) { + runLater(() => { + const progress = step / (steps - 1) + const phase = step * (Math.PI / 4) - runLater(shoot, 0) - runLater(shoot, 100) - runLater(shoot, 200) - runLater(shoot, 300) - runLater(shoot, 400) + confetti({ + particleCount: 7, + angle: 90 + Math.cos(phase) * 18, + spread: 25, + startVelocity: 16, + gravity: 0.25, + decay: 0.94, + ticks: 100, + scalar: 0.9, + shapes: ["circle", "square"], + origin: { + x: 0.5 + Math.sin(phase) * 0.14, + y: 0.85 - progress * 0.55, + }, + colors, + }) + }, step * 65) + } }, // 效果8: 表情包烟花 @@ -315,6 +319,7 @@ export function useFireworks() { loadEmojiShapes().then((emojiShapes) => { confetti({ shapes: emojiShapes, + flat: true, scalar: 6, particleCount: 18, spread: 360, @@ -349,16 +354,28 @@ export function useFireworks() { // 效果10: 礼花瀑布 () => { - confetti({ - particleCount: 150, - spread: 180, - startVelocity: 0, - gravity: 1.2, - decay: 0.95, - ticks: 300, - origin: { x: 0.5, y: 0 }, - colors: ["#f6d365", "#fda085", "#fbc2eb", "#a6c1ee", "#84fab0"], - }) + const animationEnd = Date.now() + 1800 + const colors = ["#f6d365", "#fda085", "#fbc2eb", "#a6c1ee", "#84fab0"] + + const interval = setInterval(() => { + if (Date.now() >= animationEnd) return stopTimer(interval) + + for (let column = 0; column < 6; column++) { + confetti({ + particleCount: 2, + angle: 270, + spread: 30, + startVelocity: 5, + gravity: 1, + decay: 0.96, + ticks: 240, + scalar: 1.1, + origin: { x: (column + Math.random()) / 6, y: 0 }, + colors, + }) + } + }, 120) + timers.add(interval) }, ] diff --git a/src/routes.ts b/src/routes.ts index 443f63a..b815626 100644 --- a/src/routes.ts +++ b/src/routes.ts @@ -257,12 +257,6 @@ export const admins: RouteRecordRaw = { props: true, meta: { requiresSuperAdmin: true }, }, - { - path: "reaction/list", - name: "admin reaction list", - component: () => import("admin/reaction/list.vue"), - meta: { requiresSuperAdmin: true }, - }, { path: "message/list", name: "admin message list", diff --git a/src/shared/layout/admin.vue b/src/shared/layout/admin.vue index 92a8b72..e83042b 100644 --- a/src/shared/layout/admin.vue +++ b/src/shared/layout/admin.vue @@ -114,15 +114,6 @@ const options = computed(() => { h(RouterLink, { to: "/admin/user/list" }, { default: () => "用户" }), key: "admin user list", }, - { - label: () => - h( - RouterLink, - { to: "/admin/reaction/list" }, - { default: () => "反馈" }, - ), - key: "admin reaction list", - }, { label: () => h( diff --git a/src/utils/types.ts b/src/utils/types.ts index c9f92f4..c94014c 100644 --- a/src/utils/types.ts +++ b/src/utils/types.ts @@ -226,6 +226,8 @@ export interface AdminProblemFiltered { has_ast_rules: boolean allow_flowchart: boolean show_flowchart: boolean + // 比赛题目列表接口不返回这个字段 + top_reaction?: { type: ReactionKey; count: number } | null } // 题单相关类型 @@ -610,13 +612,6 @@ export interface ReactionState { counts: ReactionCounts | null } -export interface ReactionStatsRow extends ReactionCounts { - pid: string - title: string - users: number - last_time: string -} - export interface Tutorial { id: number title: string