/*
 * @Description:
 * @version: 1.0
 * @Author: 九哥
 * @Date: 2020-08-08 17:59:28
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-03-15 18:11:50
 */
// eslint-disable-next-line
import {
  UserLayout,
  BasicLayout,
  RouteView
} from '@/layouts'

export const asyncRouterMap = [{
    path: '/',
    name: 'index',
    component: BasicLayout,
    meta: {
      title: '首页'
    },
    redirect: '/dashboard/analysis',
    children: [
      // dashboard
      {
        path: '/dashboard/analysis',
        name: 'dashboard',
        component: () => import('@/views/dashboard/Analysis'),
        meta: {
          title: '首页',
          keepAlive: true
        }
      },
      // {
      //   path: '/er/index',
      //   name: 'EntityModel',
      //   component: () => import('@/views/er/index'),
      //   meta: {
      //     title: '对象建模',
      //     pageId: '',
      //     keepAlive: true
      //   }
      // },
      // pageDesign
      {
        path: '/pageDesign',
        redirect: '/lowcode/form-config-list',
        component: RouteView,
        meta: {
          title: '页面设计',
          icon: 'form'
        },
        children: [{
            path: '/lowcode/form-config-list',
            name: 'FormConfigList',
            component: () => import('@/views/lowcode/FormConfigList'),
            meta: {
              title: '表单设计',
              pageId: 'T_UM_GRID_CONFIG',
              keepAlive: true
            }
          },
          {
            path: '/lowcode/grid-config-list',
            name: 'GridConfigList',
            component: () => import('@/views/lowcode/GridConfigList'),
            meta: {
              title: '表格设计',
              pageId: 'T_UM_GRID_CONFIG',
              keepAlive: true
            }
          }
        ]
      },
      {
        path: '/gen',
        redirect: '/gen/gen-project',
        component: RouteView,
        meta: {
          title: '代码生成',
          icon: 'form'
        },
        children: [{
            path: '/gen/gen-project',
            name: 'GenProject',
            component: () => import('@/views/gen/GenProject'),
            meta: {
              title: '项目创建',
              pageId: '',
              keepAlive: true
            }
          },
          {
            path: '/gen/gen-code',
            name: 'GenCode',
            component: () => import('@/views/gen/GenCode'),
            meta: {
              title: '代码生成',
              pageId: 'GEN_CODE',
              keepAlive: true
            }
          }
        ]
      },


      {
        path: '/reportDesigner/index',
        name: 'reportDesigner',
        component: () => import('@/views/reportDesigner/index'),
        meta: {
          title: '报表设计',
          pageId: 'REPORT_DESIGNER',
          keepAlive: true
        }
      },
      {
        path: '/flow',
        name: 'flow',
        component: () => import('@/views/flow/FlowConfigList'),
        meta: {
          title: '流程设计',
          pageId: 'T_UM_FLOW_CONFIG',
          keepAlive: true
        }
      },
      {
        path: '/er/index',
        name: 'EntityModel',
        component: () => import('@/views/er/index'),
        meta: {
          title: '对象建模',
          pageId: '',
          keepAlive: true
        }
      },

      {
        path: '/demo',
        redirect: '/demo/form',
        component: RouteView,
        meta: {
          title: '演示示例',
          icon: 'form'
        },
        children: [{
            path: '/demo/form',
            name: 'formDemo',
            component: () => import('@/views/demo/form'),
            meta: {
              title: '表单演示',
              pageId: 'COST_MAINTENANCE',
              keepAlive: true
            }
          },
          {
            path: '/demo/grid',
            name: 'gridDemo',
            component: () => import('@/views/demo/grid'),
            meta: {
              title: '表格演示',
              pageId: '',
              keepAlive: true
            }
          },
        ]
      },
      {
        path: '/system',
        redirect: '/system/excel-config',
        component: RouteView,
        meta: {
          title: '系统管理',
          icon: 'setting'
        },
        children: [{
            path: '/system/excel-config',
            name: 'Excel配置',
            component: () => import('@/views/system/excelConfig/index'),
            meta: {
              title: 'Excel配置',
              pageId: 'T_UM_EXCEL_CONFIG',
              keepAlive: true
            }
          },
          // {
          //   path: '/system/version',
          //   name: 'version',
          //   component: () => import('@/views/system/version/index'),
          //   meta: {
          //     title: '版本管理',
          //     pageId: '',
          //     keepAlive: true
          //   }
          // },
          {
            path: '/system/project',
            name: 'projectList',
            component: () => import('@/views/system/project/index'),
            meta: {
              title: '项目管理',
              pageId: '',
              keepAlive: true
            }
          },
          {
            path: '/system/user',
            name: 'userList',
            component: () => import('@/views/system/user/index'),
            meta: {
              title: '用户管理',
              pageId: '',
              keepAlive: true
            }
          },
        ]
      },

    ]
  },
  {
    path: '*',
    redirect: '/404',
    hidden: true
  }
]

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [{
    path: '/user',
    component: UserLayout,
    redirect: '/user/login',
    hidden: true,
    children: [{
        path: 'login',
        name: 'login',
        component: () => import( /* webpackChunkName: "user" */ '@/views/user/Login')
      },
      {
        path: 'recover',
        name: 'recover',
        component: undefined
      }
    ]
  },
  {
    path: '/form/design',
    component: () => import( /* webpackChunkName: "fail" */ '@/views/lowcode/FormDesign')
  },
  // {
  //   path: '/flow/flowDesigner',
  //   component: () => import(/* webpackChunkName: "fail" */ '@/views/flow/FlowDesigner')
  // },
  {
    path: '/404',
    component: () => import( /* webpackChunkName: "fail" */ '@/views/exception/404')
  },
  {
    path: '/reportDesigner',
    component: () => import( /* webpackChunkName: "fail" */ '@/views/reportDesigner/ReportDesigner')
  }
]