import { RouteRecordRaw } from 'vue-router';

const routes: RouteRecordRaw[] = [
  {
    path: '/login',
    component: () => import('pages/LoginPage.vue')
  },
  {
    path:'/FlowChart/:id',
    component:()=>import('layouts/MainLayout.vue'),
    children:[
      {path:'',component:()=>import('pages/FlowChart.vue')}
    ]
  },
  {
    path: '/',
    component: () => import('layouts/MainLayout.vue'),
    children: [
      { path: '', component: () => import('pages/IndexPage.vue'), props: { app: '' } },
      { path: 'ruleEditor', component: () => import('pages/RuleEditor.vue') },
      { path: 'flow', component: () => import('pages/testFlow.vue') },
      { path: 'FlowChartTest', component: () => import('pages/FlowChartTest.vue') },
      { path: 'flowEditor', component: () => import('pages/FlowEditorPage.vue') },
      // { path: 'FlowChart', component: () => import('pages/FlowChart.vue') },
      { path: 'domain', component: () => import('pages/TenantDomain.vue') },
      { path: 'userdomain', component: () => import('pages/UserDomain.vue')},
      { path: 'user', component: () => import('pages/UserManagement.vue')},
      { path: 'app', component: () => import('pages/AppManagement.vue')},
      { path: 'app/version/:id', component: () => import('pages/AppVersionManagement.vue')},
      { path: 'role', component: () => import('pages/RoleManagement.vue')},
      { path: 'condition', component: () => import('pages/conditionPage.vue') }
    ],
  },
  // Always leave this as last one,
  // but you can also remove it
  {
    path: '/:catchAll(.*)*',
    component: () => import('pages/ErrorNotFound.vue'),
  },
];

export default routes;
