import type { RouteRecordRaw } from 'vue-router'

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

const routes: RouteRecordRaw[] = [
  {
    path: '/biz',
    component: Layout,
    redirect: '/biz/index',
    name: 'biz_index',
    meta: {
      title: '事务模型',
      icon: 'bx:bxs-component',
    },
    children: [
      {
        path: 'index',
        name: 'biz_object_list',
        component: () => import('@/views/biz/biz/index.vue'),
        meta: {
          title: '事务对象',
          sidebar: false,
          breadcrumb: false,
          activeMenu: '/biz',
        },
      },
      {
        path: 'object/:bizId/:objectId',
        name: 'bizObjectDetails',
        component: () => import('@/views/biz/object/index.vue'),
        meta: {
          title: '对象详情',
          sidebar: false,
          activeMenu: '/biz/object',
          cache: true,
          noCache: 'bizObjectDetails',
        },
      },
      {
        path: 'object/oam/:bizId/:objectId',
        name: 'bizObjectOAM',
        component: () => import('@/views/biz/oam/index.vue'),
        meta: {
          title: '行为定义',
          sidebar: false,
          activeMenu: '/biz/object',
          cache: true,
          noCache: 'bizObjectOAM',
        },
      },
    ],
  },
  {
    path: '/biz/rule',
    component: Layout,
    redirect: '/biz/rule/index',
    name: 'rule',
    meta: {
      title: '操作规则',
      icon: 'ep:promotion',
    },
    children: [
      {
        path: 'index',
        name: 'ruleList',
        component: () => import('@/views/biz/rule/index.vue'),
        meta: {
          title: '操作规则',
          sidebar: false,
          breadcrumb: false,
          activeMenu: '/biz/rule',
        },
      },
    ],
  },
]
export default routes
