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 () => {