import type { RouteRecordRaw } from 'vue-router'

const Layout = () => import('@/layouts/index.vue')

const routes: RouteRecordRaw[] = [
  {
    path: '/model',
    component: Layout,
    redirect: '/model/index',
    name: 'model',
    meta: {
      title: '数据模型',
      icon: 'bx:bxs-component',
    },
    children: [
      {
        path: 'index',
        name: 'model_object_list',
        component: () => import('@/views/model/model/index.vue'),
        meta: {
          title: '对象定义',
          sidebar: false,
          breadcrumb: false,
          activeMenu: '/model',
        },
      },
      {
        path: 'object/:modelId/:objectId',
        name: 'modelObjectDetails',
        component: () => import('@/views/model/object/index.vue'),
        meta: {
          title: '数据对象',
          sidebar: false,
          activeMenu: '/model',
          cache: true,
          noCache: 'modelObjectDetails',
        },
      },
      {
        path: 'object/oam/:modelId/:objectId',
        name: 'modelObjectOAM',
        component: () => import('@/views/model/oam/index.vue'),
        meta: {
          title: '行为定义',
          sidebar: false,
          activeMenu: '/model',
          cache: true,
          noCache: 'modelObjectOAM',
        },
      },
    ],
  },
]
export default routes
