import type { Route } from '@/global'

const Layout = () => import('@/layouts/index.vue')

const routes: Route.recordRaw[] = [
  {
    path: '/baseInfo',
    component: Layout,
    redirect: '/baseInfo/dept',
    name: 'BaseInfo',
    meta: {
      title: '基本信息管理',
      icon: 'ep:key',
      auth: '/sys/baseInfo',
    },
    children: [
      {
        path: 'dept',
        name: 'Dept',
        component: () => import('@/views/system/baseInfo/dept/list.vue'),
        meta: {
          title: '部门管理',
          icon: 'ep:key',
          auth: '/sys/baseInfo/dept',
        },
      },
      {
        path: 'dept/:type/:id?/:obj',
        name: 'DeptDetail',
        component: () => import('@/views/system/baseInfo/dept/detail.vue'),
        meta: {
          title: '部门管理详情',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/baseInfo/dept',
        },
        props: route => ({ row: route.query.row }),
      },
      {
        path: 'dict',
        name: 'Dict',
        component: () => import('@/views/system/baseInfo/dict/listDict.vue'),
        meta: {
          title: '字典管理',
          icon: 'ep:key',
          auth: '/sys/dict',
        },
      },
      {
        path: 'remind',
        name: 'Remind',
        component: () => import('@/views/system/baseInfo/remind/list.vue'),
        meta: {
          title: '到期提醒管理',
          icon: 'ep:key',
          auth: '/sys/baseInfo/remind',
        },
      },
      {
        path: 'autograph',
        name: 'logAutograph',
        component: () => import('@/views/system/baseInfo/autograph/autograph.vue'),
        meta: {
          title: '签名管理',
          icon: 'ep:key',
          auth: '/sys/baseInfo/autograph',
        },
      },
    ],
  },
  // {
  //   path: '/area',
  //   component: Layout,
  //   redirect: '/area/list',
  //   name: 'AreaManage',
  //   meta: {
  //     title: '区域管理',
  //     icon: 'ep:key',
  //     auth: '/sys/area',
  //   },
  //   children: [
  //     {
  //       path: 'list',
  //       name: 'AreaList',
  //       component: () => import('@/views/system/area/listArea.vue'),
  //       meta: {
  //         title: '区域管理',
  //         auth: '/sys/area',
  //         sidebar: false,
  //         breadcrumb: true,
  //         activeMenu: '/area',
  //       },
  //     },
  //   ],
  // },
  {
    path: '/resource',
    component: Layout,
    redirect: '/resource/list',
    name: 'ResourceManage',
    meta: {
      title: '资源管理',
      icon: 'ep:key',
      auth: '/sys/resource',
    },
    children: [
      {
        path: 'list',
        name: 'ResourceList',
        component: () => import('@/views/system/resource/listResource.vue'),
        meta: {
          title: '资源管理',
          auth: '/sys/resource',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/resource',
        },
      },
    ],
  },
  {
    path: '/dept',
    component: Layout,
    redirect: '/dept/list',
    name: 'DeptManage',
    meta: {
      title: '组织管理',
      icon: 'ep:key',
      auth: '/sys/dept',
    },
    children: [
      {
        path: 'list',
        name: 'DeptList',
        component: () => import('@/views/system/dept/listDept.vue'),
        meta: {
          title: '组织管理',
          auth: '/sys/dept',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/dept',
        },
      },
    ],
  },
  {
    path: '/role',
    component: Layout,
    redirect: '/role/list',
    name: 'RoleManage',
    meta: {
      title: '角色管理',
      icon: 'ep:key',
      auth: '/sys/role',
    },
    children: [
      {
        path: 'list',
        name: 'RoleList',
        component: () => import('@/views/system/role/listRole.vue'),
        meta: {
          title: '角色管理',
          auth: '/sys/role',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/role',
        },
      },
    ],
  },
  {
    path: '/user',
    component: Layout,
    redirect: '/user/list',
    name: 'UserManage',
    meta: {
      title: '用户管理',
      icon: 'ep:key',
      auth: '/sys/mgr',
    },
    children: [
      {
        path: 'list',
        name: 'UserList',
        component: () => import('@/views/system/user/listUser.vue'),
        meta: {
          title: '用户管理',
          auth: '/sys/mgr',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/user',
        },
      },
    ],
  },
  {
    path: '/process',
    component: Layout,
    redirect: '/process/list',
    name: 'Process',
    meta: {
      title: '流程管理',
      icon: 'ep:key',
      auth: '/sys/process',
    },
    children: [
      {
        path: 'list',
        name: 'ProcessList',
        component: () => import('@/views/system/process/process.vue'),
        meta: {
          title: '流程管理',
          icon: 'ep:key',
          auth: '/sys/process',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/process',
        },
      },
      {
        path: 'edit',
        name: 'ProcessListEdit',
        component: () => import('@/views/system/process/editProcess.vue'),
        meta: {
          title: '流程管理',
          icon: 'ep:key',
          auth: '/sys/process',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/process/list',
        },
      },
      {
        path: 'detail',
        name: 'ProcessListDetail',
        component: () => import('@/views/system/process/detailProcess.vue'),
        meta: {
          title: '流程管理',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/process/list',
        },
      },
      {
        path: 'add',
        name: 'ProcessListAdd',
        component: () => import('@/views/system/process/addProcess.vue'),
        meta: {
          title: '流程管理',
          icon: 'ep:key',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/process/list',
        },
      },
    ],
  },
  {
    path: '/tenant',
    component: Layout,
    redirect: '/tenant/list',
    name: 'TenantManage',
    meta: {
      title: '项目管理',
      icon: 'ep:key',
      auth: '/sys/tenantSys/list',
    },
    children: [
      {
        path: 'list',
        name: 'TenantList',
        component: () => import('@/views/system/tenant/list.tenant.vue'),
        meta: {
          title: '项目管理',
          auth: '/sys/tenantSys/list',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/tenant',
        },
      },
    ],
  },
  {
    path: '/log',
    component: Layout,
    redirect: '/businessLog',
    name: 'Log',
    meta: {
      title: '日志管理',
      icon: 'ep:key',
      auth: '/sys/log',
    },
    children: [
      {
        path: 'businessLog',
        name: 'BusinessLog',
        component: () => import('@/views/system/log/listLog.vue'),
        meta: {
          title: '业务日志',
          icon: 'ep:key',
          auth: '/sys/log/biz/list',
        },
      },
      {
        path: 'error',
        name: 'ErrorLog',
        component: () => import('@/views/system/log/listErrorLog.vue'),
        meta: {
          title: '异常日志',
          icon: 'ep:key',
          auth: '/sys/log/error/list',
        },
      },
      {
        path: 'loginDiary',
        name: 'LoginDiaryLog',
        component: () => import('@/views/system/log/LoginLog.vue'),
        meta: {
          title: '登录日志',
          icon: 'ep:key',
          auth: '/sys/loginLog',
        },
      },
    ],
  },
  {
    path: '/notice',
    component: Layout,
    redirect: '/notice/list',
    name: 'noticeManger',
    meta: {
      title: '通知公告',
      icon: 'ep:key',
      auth: '/sys/notice/list',
    },
    children: [
      {
        path: 'list',
        name: 'noticeList',
        component: () => import('@/views/system/notice/noteList.vue'),
        meta: {
          title: '通知公告',
          auth: '/sys/notice/list',
          sidebar: false,
          breadcrumb: true,
          activeMenu: '/notice',
        },
      },
    ],
  },
  {
    path: '/file',
    component: Layout,
    redirect: '/configuration',
    name: 'LogManage',
    meta: {
      title: '文件管理',
      icon: 'ep:key',
      auth: '/sys/file',
    },
    children: [
      {
        path: 'configuration',
        name: 'Configuration',
        component: () => import('@/views/system/file/fileConfiguration/configuration.vue'),
        meta: {
          title: '文件配置管理',
          icon: 'ep:key',
          auth: '/sys/file/configuration',
        },
      },
      {
        path: 'template',
        name: 'Template',
        component: () => import('@/views/system/file/template/document.vue'),
        meta: {
          title: '文件模板管理',
          icon: 'ep:key',
          auth: '/sys/file/document',
        },
      },
    ],
  },
]

export default routes
