From 010d99ce781ad6b6a8fadaaf16dbc4bbc691626f Mon Sep 17 00:00:00 2001 From: MoeSnowyFox Date: Thu, 18 Sep 2025 00:07:58 +0800 Subject: [PATCH] =?UTF-8?q?feat(router):=20=E6=B7=BB=E5=8A=A0=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E8=B7=B3=E8=BD=AC=E5=B7=A5=E5=85=B7=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E5=B9=B6=E4=BC=98=E5=8C=96=E8=AE=A1=E5=88=92=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/router/index.ts | 45 ++ .../views/MAAUserEdit/StageConfigSection.vue | 68 +-- frontend/src/views/Plans.vue | 399 +++++++++++------- 3 files changed, 330 insertions(+), 182 deletions(-) diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index 7eb53aa..ecbaa13 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -149,4 +149,49 @@ router.beforeEach(async (to, from, next) => { next() }) +// 路由跳转函数 +export function navigateTo( + path: string, + options?: { + replace?: boolean + query?: Record + } +) { + const { replace = false, query } = options || {} + + if (replace) { + return router.replace({ path, query }) + } else { + return router.push({ path, query }) + } +} + +// 通过路由名称跳转的函数 +export function navigateToByName( + name: string, + options?: { + replace?: boolean + query?: Record + params?: Record + } +) { + const { replace = false, query, params } = options || {} + + if (replace) { + return router.replace({ name, query, params }) + } else { + return router.push({ name, query, params }) + } +} + +// 返回上一页的函数 +export function goBack() { + return router.back() +} + +// 前进到下一页的函数 +export function goForward() { + return router.forward() +} + export default router diff --git a/frontend/src/views/MAAUserEdit/StageConfigSection.vue b/frontend/src/views/MAAUserEdit/StageConfigSection.vue index 375cdf0..694a2e8 100644 --- a/frontend/src/views/MAAUserEdit/StageConfigSection.vue +++ b/frontend/src/views/MAAUserEdit/StageConfigSection.vue @@ -2,6 +2,13 @@

关卡配置

+ + + + 跳转到计划表 +
@@ -172,9 +179,7 @@