/*
 * @Author: Mm
 * @Date: 2025-11-08 10:33:03
 * @LastEditors: Mm
 * @LastEditTime: 2026-02-24 15:41:19
 * 不写bug的程序员不是一个好程序员!
 */
import type { RouteRecordStringComponent } from '@vben/types';

import { $t } from '@vben/locales';

/**
 * 该文件放非后台返回的路由 比如个人中心 等需要跳转显示的页面
 */
const localRoutes: RouteRecordStringComponent[] = [
  {
    component: '/_core/profile/index',
    meta: {
      icon: 'mingcute:profile-line',
      title: $t('ui.widgets.profile'),
      hideInMenu: true,
    },
    name: 'Profile',
    path: '/profile',
  },
  {
    component: '/system/oss-config/index',
    meta: {
      activePath: '/system/oss',
      icon: 'ant-design:setting-outlined',
      title: 'oss配置',
      hideInMenu: true,
    },
    name: 'OssConfig',
    path: '/system/oss-config',
  },
  {
    component: '/tool/gen/edit-gen',
    meta: {
      activePath: '/tool/gen',
      icon: 'tabler:code',
      title: '生成配置',
      hideInMenu: true,
    },
    name: 'GenConfig',
    path: '/code-gen/edit/:tableId',
  },
  {
    component: '/system/role-assign/index',
    meta: {
      activePath: '/system/role',
      icon: 'eos-icons:role-binding-outlined',
      title: '分配角色',
      hideInMenu: true,
    },
    name: 'RoleAssign',
    path: '/system/role-assign/:roleId',
  },
  {
    component: '/biz/salary/detail',
    meta: {
      icon: 'eos-icons:role-binding-outlined',
      title: '工资明细',
      hideInMenu: true,
      maxNumOfOpenTab: 1,
    },
    name: 'salaryDetail',
    path: '/detail/:id',
  },

];

/**
 * 这里放本地路由
 */
export const localMenuList: RouteRecordStringComponent[] = [
  {
    component: 'BasicLayout',
    meta: {
      order: -1,
      title: 'page.dashboard.title',
      // 不使用基础布局（仅在顶级生效）
      noBasicLayout: true,
      hideChildrenInMenu: true,
      icon: 'ic:baseline-house',
    },
    name: 'Dashboard',
    path: '/',
    redirect: '/workspace',
    children: [
      {
        name: 'Analytics',
        path: '/analytics',
        component: '/dashboard/analytics/index',
        meta: {
          affixTab: true,
          title: 'page.dashboard.analytics',
        },
      },{
        name: 'Workspace',
        path: '/workspace',
        component: '/dashboard/workspace/index',
        meta: {
          affixTab: true,
          title: 'page.dashboard.workspace',
        },
      },
    ],
  },
  ...localRoutes,
];
