import type { AppRouteRecord } from '@/types/router'

/**
 * 字典管理相关路由模块
 * 包含：系统字典管理、租户字典管理、字典覆盖配置、缓存监控
 */
const dictionaryRoutes: AppRouteRecord = {
  path: '/dictionary',
  name: 'Dictionary',
  component: '/index/index',
  redirect: '/dictionary/system',
  meta: {
    title: 'menus.dictionary.title',
    icon: 'ri:book-2-line',
    order: 5
  },
  children: [
    {
      path: 'system',
      name: 'SystemDictionary',
      component: () => import('@views/system/dictionary/index.vue'),
      meta: {
        title: 'menus.dictionary.system',
        icon: 'ri:book-2-line',
        roles: ['PlatformAdmin'],
        permission: ['dictionary:group:read']
      }
    },
    {
      path: 'label-override',
      name: 'PlatformLabelOverride',
      component: () => import('@views/system/dictionary-label-override/index.vue'),
      meta: {
        title: 'menus.dictionary.labelOverride',
        icon: 'ri:exchange-line',
        roles: ['PlatformAdmin'],
        permission: ['dictionary:override:platform:read']
      }
    },
    {
      path: 'metrics',
      name: 'DictionaryMetrics',
      component: () => import('@views/system/dictionary-metrics/index.vue'),
      meta: {
        title: 'menus.dictionary.metrics',
        icon: 'ri:bar-chart-box-line',
        roles: ['PlatformAdmin'],
        permission: ['dictionary:group:read']
      }
    }
  ]
}

export default dictionaryRoutes
