From 26e0c8da53e9595524eee9f24dcb7b7e32c8f042 Mon Sep 17 00:00:00 2001 From: Hermes CI Fix Date: Mon, 31 Aug 2026 15:34:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(workbench):=20=E6=88=91=E7=9A=84=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E5=8F=B0=E5=BE=85=E5=8A=9E=E8=B7=B3=E8=BD=AC=E7=9B=B4?= =?UTF-8?q?=E8=BE=BE=E8=A1=8C=E5=8A=A8=E6=96=B9=E6=A1=88=E8=AF=A6=E6=83=85?= =?UTF-8?q?=20(plan=5Fid=E5=AE=9A=E4=BD=8D)=20todo-jump-fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - MyDashboard goToDetail: action_plan 跳转带 plan_id(原只跳列表丢ID,与KPI待办直达详情语义对齐) - ActionPlanLibrary: 支持 route.query.plan_id 定位,onMounted loadData 后在列表 find 目标行并 viewDetail 直达详情弹窗 - 边界: plan_id 不存在/无权限/非plans tab → 静默不弹,保持原列表行为 --- frontend/src/views/ActionPlanLibrary.vue | 15 +++++++++++++-- frontend/src/views/MyDashboard.vue | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/ActionPlanLibrary.vue b/frontend/src/views/ActionPlanLibrary.vue index fe1209a5..2fe66496 100644 --- a/frontend/src/views/ActionPlanLibrary.vue +++ b/frontend/src/views/ActionPlanLibrary.vue @@ -605,6 +605,16 @@ function viewDetail(row: any) { showDetail.value = true } +// 路由携带 plan_id(从我的工作台待办"查看"跳入)→ 在列表定位并直达详情弹窗 +function handlePlanIdQuery() { + const pid = route.query.plan_id + if (!pid) return + if (activeTab.value !== 'plans') return + const target = list.value.find((row: any) => row.id === Number(pid)) + // plan_id 不存在/无权限 → 静默不弹,保持原列表行为 + if (target) viewDetail(target) +} + // ── 辅助函数 ── function isOverdue(row: any) { if (!row.due_date) return false @@ -656,12 +666,13 @@ async function loadCosoChecklist() { } // ── 初始化 ── -onMounted(() => { +onMounted(async () => { loadStats() - loadData() + await loadData() loadKpis() loadUsers() loadObjectives() + handlePlanIdQuery() }) diff --git a/frontend/src/views/MyDashboard.vue b/frontend/src/views/MyDashboard.vue index d83f98a2..b43f0d27 100644 --- a/frontend/src/views/MyDashboard.vue +++ b/frontend/src/views/MyDashboard.vue @@ -169,7 +169,7 @@ function planTagType(p: any) { function goToDetail(r: any) { if (r.related_type === 'kpi') router.push('/kpis/' + r.related_id) - else if (r.related_type === 'action_plan') router.push('/action-plans') + else if (r.related_type === 'action_plan') router.push('/action-plans?plan_id=' + r.related_id) } onMounted(async () => {