Explorar el Código

fix: 雷达大屏跳转画像改用动态路由查找

router.getRoutes() 按 path 结尾匹配 employeeProfile,
避免硬编码 route name 与数据库菜单配置不一致的问题。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
simonlll hace 1 mes
padre
commit
a91844314a
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. 6 1
      src/views/score/radar/index.vue

+ 6 - 1
src/views/score/radar/index.vue

@@ -90,7 +90,12 @@ defineOptions({ name: 'ScoreRadar' })
90 90
 const router = useRouter()
91 91
 
92 92
 function goToPortrait(personName) {
93
-  router.push({ name: 'EmployeeProfile', query: { personName } })
93
+  const target = router.getRoutes().find(r => /[/]employeeProfile$/.test(r.path))
94
+  if (target) {
95
+    router.push({ path: target.path, query: { personName } })
96
+  } else {
97
+    ElMessage.warning('未找到员工画像页面,请确认菜单中已配置该页面')
98
+  }
94 99
 }
95 100
 
96 101
 // ── 状态 ──────────────────────────────────────────────