import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router';

// 路由配置信息
const routes = [
  { path: '/', redirect: '/OrganizationPage' },
  {
    path: '/Test',
    name: 'Test',
    component: () => import('@/components/Test.vue'),
  },
  {
    path: '/OrganizationPage',
    name: 'OrganizationPage',
    component: () => import('@/views/Organization/OrganizationPage.vue'),
  },
  {
    path: '/AdminGroupManagement',
    name: 'AdminGroupManagement',
    component: () => import('@/views/AdminGroupManagement/AdminGroupManagement.vue'),
  },
  {
    path: '/GroupManagement',
    name: 'GroupManagement',
    component: () => import('@/views/GroupManagement/GroupManagement.vue'),
  },
  {
    path: '/UserManagement',
    name: 'UserManagement',
    component: () => import('@/views/UserManagement/UserIndex.vue'),
  },
  {
    path: '/RoleManagement',
    name: 'RoleManagement',
    component: () => import('@/views/RoleManagement/RoleIndex.vue'),
  },
  {
    path: '/PostManagement',
    name: 'PostManagement',
    component: () => import('@/views/PostManagement/PostIndex.vue'),
  },
  {
    path: '/TenantManagement',
    name: 'TenantManagement',
    component: () => import('@/views/TenantManagement/TenantManagement.vue'),
  },
  {
    path: '/TenantIndex',
    name: 'TenantIndex',
    component: () => import('@/views/TenantManagement/TenantIndex.vue'),
    redirect: '/TenantManagement',
    children: [
      {
        path: '/TenantManagement',
        name: 'TenantManagement',
        component: () => import('@/views/TenantManagement/TenantManagement.vue'),
      },
      {
        path: '/TenantAuthorization',
        name: 'TenantAuthorization',
        component: () => import('@/views/TenantManagement/TenantAuthorization.vue'),
      },
    ],
  },
  {
    path: '/DictManagement',
    name: 'DictManagement',
    component: () => import('@/views/DictManagement/Demo.vue'),
  },
  {
    path: '/AuthManagement',
    name: 'AuthManagement',
    component: () => import('@/views/AuthManagement/AuthIndex.vue'),
  },
  {
    path: '/DataPermission',
    name: 'DataPermission',
    component: () => import('@/views/Permission/DataPermission/indexInfo.vue'),
    redirect: '/DataPermissionPolicy',
    children: [
      {
        path: '/DataPermissionPolicy',
        name: 'DataPermissionPolicy',
        component: () =>
          import('@/views/Permission/DataPermission/DataPermissionPolicy/DataPermissionPolicy.vue'),
      },
      {
        path: '/DataPermissionParameters',
        name: 'DataPermissionParameters',
        component: () =>
          import(
            '@/views/Permission/DataPermission/DataPermissionParameters/DataPermissionParameters.vue'
          ),
      },
      {
        path: '/ProductionPermission',
        name: 'ProductionPermission',
        component: () =>
          import('@/views/Permission/DataPermission/ProductionPermission/ProductionPermission.vue'),
      },
      {
        path: '/PermissionPllicy',
        name: 'PermissionPllicy',
        component: () =>
          import('@/views/Permission/DataPermission/DataPermissionPolicy/PermissionPllicy.vue'),
      },
      {
        path: '/AddPermissionPolicy/:pid',
        name: 'AddPermissionPolicy',
        component: () =>
          import('@/views/Permission/DataPermission/DataPermissionPolicy/AddPermissionPolicy.vue'),
      },
      {
        path: '/EditPermissionPolicy/:pid/:id',
        name: 'EditPermissionPolicy',
        component: () =>
          import('@/views/Permission/DataPermission/DataPermissionPolicy/EditPermissionPolicy.vue'),
      },
      {
        path: '/DetailPermissionPolicy/:pid/:id',
        name: 'DetailPermissionPolicy',
        component: () =>
          import(
            '@/views/Permission/DataPermission/DataPermissionPolicy/DetailPermissionPolicy.vue'
          ),
      },
    ],
  },
  {
    path: '/CodeManagement',
    name: 'CodeManagement',
    component: () => import('@/views/CodeManagement/CodeManagement.vue'),
  },
  // 导入配置
  {
    path: '/FileImport',
    name: 'FileImport',
    component: () => import('@/views/ImpExp/FileImport/FileImport.vue'),
  },
  // 导出配置
  {
    path: '/FileExport',
    name: 'FileExport',
    component: () => import('@/views/ImpExp/FileExport/FileExport.vue'),
  },
  // 座位管理
  {
    path: '/ImexTest',
    name: 'ImexTest',
    component: () => import('@/views/ImpExp/ImexTest.vue'),
  },
  // 应用管理
  {
    path: '/AppManagement',
    name: 'AppManagement',
    component: () => import('@/views/AppManagement/AppIndex.vue'),
  },
  // 简单查询
  {
    path: '/SimpleQuery',
    name: 'SimpleQuery',
    component: () => import('@/views/QueryConfiguration/SimpleQuery/Index.vue'),
  },
  //通用与分类查询
  {
    path: '/GeneralQueryIndex',
    name: 'GeneralQueryIndex',
    component: () => import('@/views/GeneralQuery/GeneralQueryIndex.vue'),
  },
  //索引管理
  {
    path: '/EsIndexConfiguration',
    name: 'EsIndexConfiguration',
    component: () => import('@/views/QueryConfiguration/EsIndexConfiguration/Index.vue'),
  },
  //简单查询配置(DB)
  {
    path: '/DBConfigguration',
    name: 'DBConfigguration',
    component: () => import('@/views/QueryConfiguration/DBConfigguration/Index.vue'),
  },
  //通用查询配置
  {
    path: '/GeneralQueryConfig',
    name: 'GeneralQueryConfig',
    component: () =>
      import('@/views/QueryConfiguration/GeneralQueryConfig/GeneralQueryConfigIndex.vue'),
  },
  //GeneralQueryConfigCreate
  {
    path: '/GeneralQueryConfigCreate',
    name: 'GeneralQueryConfigCreate',
    component: () =>
      import('@/views/QueryConfiguration/GeneralQueryConfig/GeneralQueryConfigCreate.vue'),
  },
  //GeneralQueryConfigEdit
  {
    path: '/GeneralQueryConfigEdit',
    name: 'GeneralQueryConfigEdit',
    component: () =>
      import('@/views/QueryConfiguration/GeneralQueryConfig/GeneralQueryConfigEdit.vue'),
  },
  //GeneralQueryConfigView
  {
    path: '/GeneralQueryConfigView',
    name: 'GeneralQueryConfigView',
    component: () =>
      import('@/views/QueryConfiguration/GeneralQueryConfig/GeneralQueryConfigView.vue'),
  },
];

// 创建路由
const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
