diff --git a/src/layout/components/sidebar/components/SideMenu.vue b/src/layout/components/sidebar/components/SideMenu.vue index c42a24e..7b0a258 100644 --- a/src/layout/components/sidebar/components/SideMenu.vue +++ b/src/layout/components/sidebar/components/SideMenu.vue @@ -58,32 +58,32 @@ function getMenuItem(route, basePath = '') { if (!visibleChildren.length) return menuItem - if (visibleChildren.length === 1) { - // 单个子路由处理 - const singleRoute = visibleChildren[0] - menuItem = { - ...menuItem, - label: singleRoute.meta?.title || singleRoute.name, - key: singleRoute.name, - path: resolvePath(menuItem.path, singleRoute.path), - icon: getIcon(singleRoute.meta), - } - const visibleItems = singleRoute.children - ? singleRoute.children.filter((item) => item.name && !item.isHidden) - : [] + // if (visibleChildren.length === 1) { + // 单个子路由处理 + // const singleRoute = visibleChildren[0] + // menuItem = { + // ...menuItem, + // label: singleRoute.meta?.title || singleRoute.name, + // key: singleRoute.name, + // path: resolvePath(menuItem.path, singleRoute.path), + // icon: getIcon(singleRoute.meta), + // } + // const visibleItems = singleRoute.children + // ? singleRoute.children.filter((item) => item.name && !item.isHidden) + // : [] - if (visibleItems.length === 1) { - menuItem = getMenuItem(visibleItems[0], menuItem.path) - } else if (visibleItems.length > 1) { - menuItem.children = visibleItems - .map((item) => getMenuItem(item, menuItem.path)) - .sort((a, b) => a.order - b.order) - } - } else { - menuItem.children = visibleChildren - .map((item) => getMenuItem(item, menuItem.path)) - .sort((a, b) => a.order - b.order) - } + // if (visibleItems.length === 1) { + // menuItem = getMenuItem(visibleItems[0], menuItem.path) + // } else if (visibleItems.length > 1) { + // menuItem.children = visibleItems + // .map((item) => getMenuItem(item, menuItem.path)) + // .sort((a, b) => a.order - b.order) + // } + // } else { + menuItem.children = visibleChildren + .map((item) => getMenuItem(item, menuItem.path)) + .sort((a, b) => a.order - b.order) + // } return menuItem } diff --git a/src/views/game/jl/api.js b/src/views/game/jl/api.js new file mode 100644 index 0000000..6d91541 --- /dev/null +++ b/src/views/game/jl/api.js @@ -0,0 +1,8 @@ +import { request } from '@/utils' + +export default { + // 游戏列表 + getGmaeList: () => request.post('/game/list'), + // 豆子记录 + getData: (data) => request.post('/coin/list', data), +} diff --git a/src/views/game/jl/index.vue b/src/views/game/jl/index.vue new file mode 100644 index 0000000..30c9f60 --- /dev/null +++ b/src/views/game/jl/index.vue @@ -0,0 +1,222 @@ + + + + + diff --git a/src/views/game/route.js b/src/views/game/route.js new file mode 100644 index 0000000..20cf597 --- /dev/null +++ b/src/views/game/route.js @@ -0,0 +1,24 @@ +const Layout = () => import('@/layout/index.vue') + +export default { + name: 'game', + path: '/game', + component: Layout, + redirect: '/game_jl', + meta: { + title: '游戏统计', + icon: 'mdi:home', + order: 100, + }, + children: [ + { + name: 'game_jl', + path: 'game_jl', + component: () => import('./jl/index.vue'), + meta: { + title: '豆子记录', + icon: 'mdi:home', + }, + }, + ], +} diff --git a/src/views/workbench/route.js b/src/views/workbench/route.js index 2b4771a..c1a8796 100644 --- a/src/views/workbench/route.js +++ b/src/views/workbench/route.js @@ -1,13 +1,13 @@ const Layout = () => import('@/layout/index.vue') export default { - name: 'Dashboard', + name: '工作台', path: '/', component: Layout, redirect: '/workbench', children: [ { - name: 'Workbench', + name: 'workbench', path: 'workbench', component: () => import('./index.vue'), meta: {