import type { RouteRecordRaw } from 'vue-router';

import {
  EosRole,
  FluentWorkflow,
  IconLog,
  IconSystem,
  MdiUser,
  RiDept,
} from '@vben/icons';

const routes: RouteRecordRaw[] = [
  {
    name: 'system',
    path: '/system',
    meta: {
      icon: IconSystem,
      title: '系统管理',
      order: 4,
      authority: ['system'],
    },
    children: [
      {
        name: 'role',
        path: '/system/role',
        component: () => import('#/views/role/list.vue'),
        meta: {
          icon: EosRole,
          title: '角色管理',
          authority: ['system:role'],
        },
      },
      {
        name: 'dept',
        path: '/system/dept',
        component: () => import('#/views/dept/list.vue'),
        meta: {
          icon: RiDept,
          title: '部门管理',
          authority: ['system:dept'],
        },
      },
      {
        name: 'user',
        path: '/system/user',
        component: () => import('#/views/user/list.vue'),
        meta: {
          icon: MdiUser,
          title: '用户管理',
          authority: ['system:user'],
        },
      },
      {
        name: 'log',
        path: '/system/log',
        component: () => import('#/views/log/list.vue'),
        meta: {
          icon: IconLog,
          title: '系统日志',
          authority: ['system:operationLog'],
        },
      },
      {
        name: 'workflow',
        path: '/system/workflow',
        component: () => import('#/views/workflow/list.vue'),
        meta: {
          icon: FluentWorkflow,
          title: '工作流管理',
          authority: ['system:workflow'],
        },
      },
    ],
  },
];

export default routes;
