fix(workbench): 我的工作台待办跳转直达行动方案详情 (plan_id定位) todo-jump-fix
- MyDashboard goToDetail: action_plan 跳转带 plan_id(原只跳列表丢ID,与KPI待办直达详情语义对齐) - ActionPlanLibrary: 支持 route.query.plan_id 定位,onMounted loadData 后在列表 find 目标行并 viewDetail 直达详情弹窗 - 边界: plan_id 不存在/无权限/非plans tab → 静默不弹,保持原列表行为
This commit is contained in:
@@ -605,6 +605,16 @@ function viewDetail(row: any) {
|
|||||||
showDetail.value = true
|
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) {
|
function isOverdue(row: any) {
|
||||||
if (!row.due_date) return false
|
if (!row.due_date) return false
|
||||||
@@ -656,12 +666,13 @@ async function loadCosoChecklist() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ── 初始化 ──
|
// ── 初始化 ──
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
loadStats()
|
loadStats()
|
||||||
loadData()
|
await loadData()
|
||||||
loadKpis()
|
loadKpis()
|
||||||
loadUsers()
|
loadUsers()
|
||||||
loadObjectives()
|
loadObjectives()
|
||||||
|
handlePlanIdQuery()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ function planTagType(p: any) {
|
|||||||
|
|
||||||
function goToDetail(r: any) {
|
function goToDetail(r: any) {
|
||||||
if (r.related_type === 'kpi') router.push('/kpis/' + r.related_id)
|
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 () => {
|
onMounted(async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user