import Vue, { KeepAlive } from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: '/redirect/:path(.*)',
      component: () => import('../components/page/redirect/index.vue'),
		},
    {
      path: '/',
      redirect: '/dashboard'
    },

    /**
     * 登录
     */
    // 决策引擎系统 - 登录
		{
      path: '/login',
      component: () => import('../components/page/LoginEnginex.vue'),
      meta: { title: '登录' }
		},
    // 权限系统 - 登录
    {
      path: '/loginAuth',
      component: () => import('../components/page/LoginAuth.vue'),
      meta: { title: '登录', KeepAlive: true }
		},
    // 数据中心 - 登录
    {
      path: '/loginDatax',
      component: () => import('../components/page/LoginDatax.vue'),
      meta: { title: '登录' }
		},


    {
      path: '/',
      component: () => import('../components/common/Home.vue'),
      meta: { title: '自述文件' },
      children: [
        {
          path: '/dashboardEnginex',
          component: () => {
            const userRole = localStorage.getItem('platform');
            return import('../components/page/DashboardEnginex.vue');
          },
          meta: { title: '系统首页' }
        },
        {
          path: '/dashboard',
          component: () => {
            const userRole = localStorage.getItem('platform');
            return import('../components/page/DashboardDatax.vue');
          },
          meta: { title: '系统首页' }
        },
        {
          path: '/engineList',
          component: () => import('../components/page/EngineListV2.vue'),
          meta: { title: '引擎列表' }
        },
        {
          path: '/engine_decision_flow',
          component: () => import('../components/page/Engine_decision_flow.vue'),
          meta: { title: '决策流' }
        },
				{
          path: '/dataFlowEngine',
          component: () => import('../components/page/dataFlowEngine.vue'),
          meta: { title: '数据流引擎列表' }
        },
        {
          path: '/dataFlowEngineCont',
					name:'dataFlowEngineCont',
          component: () => import('../components/page/dataFlowEngineCont.vue'),
          meta: { title: '数据流引擎' }
        },
				{
          path: '/scorecard',
          component: () => import('../components/page/scorecard.vue'),
          meta: { title: '评分卡管理' }
				},
				{
          path: '/listOperation',
          component: () => import('../components/page/listOperation.vue'),
          meta: { title: '集合规则' }
				},
        {
          path: '/dataRinse',
          component: () => import('../components/page/dataRinse.vue'),
          meta: { title: '数据清洗' }
				},
				{
          path: '/Knowledge',
          component: () => import('../components/page/Knowledge.vue'),
          meta: { title: '复杂规则集' }
				},
        {
          path: '/groovyRule',
          component: () => import('../components/page/groovyRule.vue'),
          meta: { title: '脚本规则集' }
        },
        {
          path: '/decisionTable',
          component: () => import('../components/page/decisionTable.vue'),
          meta: { title: '决策表' }
        },
        {
          path: '/decisionTree',
          component: () => import('../components/page/decisionTree.vue'),
          meta: { title: '决策树' }
        },
        {
          path:'/blackWihiteData',
          component: () => import('../components/page/blackWhiteManage/blackWihiteData.vue'),
          meta: { title: '名单库管理' }
        },
        {
          path:'/logManagement',
          component: () => import('../components/page/systemManagement/logManagement.vue'),
          meta: { title: '日志管理' }
        },
				{
          path:'/ruleLog',
          component: () => import('../components/page/ruleLog.vue'),
          meta: { title: '规则报表' }
				},
				{
          path:'/eventLog',
          component: () => import('../components/page/eventLog.vue'),
          meta: { title: '事件报表' }
				},
				{
          path:'/examineCentre',
          component: () => import('../components/page/examineCentre.vue'),
          meta: { title: '审批管理' }
				},{
          path:'/examineCurrent',
          component: () => import('../components/page/examineCurrent.vue'),
          meta: { title: '审批流' }
				},
        {
          path:'/examineSet',
          component: () => import('../components/page/examineSet.vue'),
          meta: { title: '审批设置' }
				},
        {
          path: '/indexModels',
          component: () => import('@/components/models/index.vue'),
          meta: {title: '模型管理'}
        },
        {
          path: '/engine_result',
          component: () => import('@/components/page/Engine_watch.vue'),
          meta: {title: '决策流监控列表'}
          },
          {
            path: '/engine_result_cont/:id',
            component: () => import('@/components/page/Engine_watch_cont.vue'),
            meta: {title: '决策流监控'}
          }, 
          {
            path: '/businessRuleRel',
            component: () => import('@/components/page/businessRuleRel.vue'),
            meta: {title: '业务类型'}
          },
          {
            path: '/tendencyAnalyse',
            component: () => import('@/components/page/tendencyAnalyse.vue'),
            meta: {title: '分析中心'}
          },
          {
            path: '/testModule',
            component: () => import('../components/page/testModule.vue'),
            meta: { title: '测试' }
          },
          {
            path: '/404',
            component: () => import('../components/page/404.vue'),
            meta: { title: '404' }
          },
          {
            path: '/403',
            component: () => import('../components/page/403.vue'),
            meta: { title: '403' }
          },
          // 权限系统
          {
            path:'/userManagement',
            component: () => import('../components/page/systemManagement/userManagement.vue'),
            meta: { title: '用户管理', KeepAlive: true }
          },
          {
            path:'/roleManagement',
            component: () => import('../components/page/systemManagement/roleManagement.vue'),
            meta: { title: '角色管理' }
          },
          {
            path:'/resourceManagement',
            component: () => import('../components/page/systemManagement/resourceManagement.vue'),
            meta: { title: '资源管理' }
          },
          {
            path:'/organizationManagement',
            component: () => import('../components/page/systemManagement/organizationManagement.vue'),
            meta: { title: '组织管理' }
          },
          // 
          {
            path: '/dataManage',
            component: () => import('../components/page/Datamanage.vue'),
            meta: { title: '基础指标' }
          },
          {
            path: '/staticManage',
            component: () => import('../components/page/staticManage.vue'),
            meta: { title: '常量指标' }
          },
          {
            path: '/SQLmanage',
            component: () => import('../components/page/SQLManage.vue'),
            meta: { title: '数据库指标' }
          },
          {
            path: '/realTimeManage',
            component: () => import('../components/page/realTimeManage.vue'),
            meta: { title: '实时指标' }
          },
          { 
            path: '/derivemanage',
            component: () => import('../components/page/DeriveManage.vue'),
            meta: { title: '衍生指标' }
          },
          {
            path: '/portManage',
            component: () => import('@/components/page/portManage.vue'),
            meta: {title: '接口指标'}
          },
          {
            path: '/DataSource',
            component: () => import('@/components/page/DataSource.vue'),
            meta: {title: '数据库源'}
          },
          {
            path: '/portSource',
            component: () => import('@/components/page/portSource.vue'),
            meta: {title: '接口源'}
          },
          {
            path: '/MqSource',
            component: () => import('@/components/page/MqSource.vue'),
            meta: {title: '消息队列源'}
          },
          {
            path: '/FieldStatistics',
            component: () => import('@/components/page/FieldStatistics.vue'),
            meta: {title: '指标统计'}
          },
        ]
      },
      {
        path: '*',
        redirect: '/404'
      }
    ]
});
