feat(admin,player,api): 优胜冠军通用管理与界面精简
管理端新增冠军盘列表/编辑、展开懒加载与 ECharts 修复;各列表页去掉重复标题。玩家端支持多赛事冠军盘、分批加载与语言切换刷新。API 扩展 outright CRUD 与列表性能优化。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -15,7 +15,7 @@ const adminMenus = computed(() => [
|
||||
{ path: '/users', label: t('nav.users') },
|
||||
{ path: '/agents', label: t('nav.agents') },
|
||||
{ path: '/matches', label: t('nav.matches') },
|
||||
{ path: '/world-cup-outright', label: t('nav.outright') },
|
||||
{ path: '/outrights', label: t('nav.outrights'), matchPrefix: true },
|
||||
{ path: '/bets', label: t('nav.bets') },
|
||||
{ path: '/cashback', label: t('nav.cashback') },
|
||||
{ path: '/audit', label: t('nav.audit') },
|
||||
@@ -30,9 +30,15 @@ const agentMenus = computed(() => [
|
||||
|
||||
const menus = computed(() => (auth.isAdmin.value ? adminMenus.value : agentMenus.value));
|
||||
|
||||
const currentLabel = computed(() =>
|
||||
menus.value.find(m => m.path === route.path)?.label ?? ''
|
||||
);
|
||||
const currentLabel = computed(() => {
|
||||
const hit = menus.value.find((m) => {
|
||||
if ('matchPrefix' in m && m.matchPrefix) {
|
||||
return route.path === m.path || route.path.startsWith(`${m.path}/`);
|
||||
}
|
||||
return route.path === m.path;
|
||||
});
|
||||
return hit?.label ?? '';
|
||||
});
|
||||
|
||||
const userInitial = computed(() =>
|
||||
(auth.user?.username ?? '').charAt(0).toUpperCase()
|
||||
@@ -55,7 +61,12 @@ function logout() {
|
||||
<nav class="nav">
|
||||
<RouterLink
|
||||
v-for="m in menus" :key="m.path" :to="m.path"
|
||||
class="nav-item" :class="{ active: route.path === m.path }"
|
||||
class="nav-item"
|
||||
:class="{
|
||||
active:
|
||||
route.path === m.path ||
|
||||
('matchPrefix' in m && m.matchPrefix && route.path.startsWith(`${m.path}/`)),
|
||||
}"
|
||||
>
|
||||
{{ m.label }}
|
||||
</RouterLink>
|
||||
|
||||
Reference in New Issue
Block a user