import type { RouteRecordRaw } from 'vue-router'

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

const routes: RouteRecordRaw[] = [
  {
    path: '/biz/object',
    component: Layout,
    redirect: '/biz/object/index',
    name: 'biz_object',
    meta: {
      title: '业务模型',
      icon: 'ep:element-plus',
    },
    children: [
      {
        path: 'index',
        name: 'biz_object_index',
        component: () => import('@/views/biz/object/index.vue'),
        meta: {
          title: '业务对象',
          sidebar: false,
          breadcrumb: false,
          activeMenu: '/biz/object',
        },
      },
      {
        path: 'attr/:bizId/:objectId',
        name: 'bizObjectEdit',
        component: () => import('@/views/biz/attr/index.vue'),
        meta: {
          title: '对象编辑',
          sidebar: false,
          activeMenu: '/biz/object',
          cache: true,
          noCache: 'bizObjectEdit',
        },
      },
      {
        path: '/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
