import {AppRouteRecordRaw} from '@/router/types';
import { getParentLayout } from '@/router/constant';

export const <%= entityInstance %>Routes: AppRouteRecordRaw = {
  path: '<%= entityFileName %>',
  name: '<%= (moduleName || clientRootFolder) ? (moduleName || clientRootFolder) + entityAngularName : entityInstance %>',
  component: getParentLayout('<%= (moduleName || clientRootFolder) ? (moduleName || clientRootFolder) + entityAngularName : entityInstance %>'),
  meta: {
    title: '<%= bcTitle %>',
  },
  redirect: '/<%= clientRootFolder || moduleName %>/<%= entityFileName %>/list',
  children: [
    {
      path: 'list',
      name: '<%= (moduleName || clientRootFolder) ? (moduleName || clientRootFolder) + entityAngularName : entityInstance %>List',
      component: () => import('@/views/<%= entityFolderName%>/<%= entityFileName %>-list.vue'),
      meta: { title: '<%= bcTitle %>列表', hideMenu: true }
    },
    {
      path: 'new<%= (extendData && multiModel) ? '/:'+multiModel+'Id' : ''%>',
      name: '<%= (moduleName || clientRootFolder) ? (moduleName || clientRootFolder) + entityAngularName : entityInstance%>New',
      component: () => import('@/views/<%= entityFolderName%>/<%= entityFileName %>-edit.vue'),
      meta: { title: '新建<%= bcTitle %>', hideMenu: true }
    },
    {
      path: ':entityId/edit<%= (extendData && multiModel) ? '/:'+multiModel+'Id' : ''%>',
      name: '<%= (moduleName || clientRootFolder) ? (moduleName || clientRootFolder) + entityAngularName : entityInstance %>Edit',
      component: () => import('@/views/<%= entityFolderName%>/<%= entityFileName %>-edit.vue'),
      meta: { title: '编辑<%= bcTitle %>', hideMenu: true }
    },
    {
      path: ':entityId/detail<%= (extendData && multiModel) ? '/:'+multiModel+'Id' : ''%>',
      name: '<%= (moduleName || clientRootFolder) ? (moduleName || clientRootFolder) + entityAngularName : entityInstance%>Detail',
      component: () => import('@/views/<%= entityFolderName%>/<%= entityFileName %>-detail.vue'),
      meta: { title: '查看<%= bcTitle %>', hideMenu: true }
    }
  ]
};
